|
|
|
@ -4,6 +4,7 @@ import com.spring.common.utils.DateUtils; |
|
|
|
import com.spring.ifs.data.*; |
|
|
|
import com.spring.ifs.utils.IfsConverterToMap; |
|
|
|
import com.spring.ifs.utils.IfsPlsqlUtils; |
|
|
|
import com.spring.modules.base.entity.WorkCenterCost; |
|
|
|
import com.spring.modules.base.vo.PersonnelLevelVo; |
|
|
|
import com.spring.modules.part.vo.InventoryPartUnitCostSumVo; |
|
|
|
import com.spring.modules.part.vo.LocationInformationVo; |
|
|
|
@ -418,4 +419,72 @@ public class BaseSearchApi { |
|
|
|
return technicalAttributes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 加工中心成本 |
|
|
|
* @author LR |
|
|
|
* @date 2025/2/10 15:17 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<WorkCenterCost> getWorkCenterCosts(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { |
|
|
|
StringBuilder searchSql = new StringBuilder(); |
|
|
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, CONTRACT, WORK_CENTER_NO,"); |
|
|
|
searchSql.append(" ifsapp.WORK_CENTER_API.Get_Description(CONTRACT, WORK_CENTER_NO) workCenterDesc,"); |
|
|
|
searchSql.append(" COST_SET, ifsapp.COST_SET_API.Get_Description(CONTRACT,COST_SET) costSetDesc, WC_RATE, WC_COST_CODE,"); |
|
|
|
searchSql.append(" OVERHEAD1_FAC, OVERHEAD1_APPL, OVERHEAD2_FAC, OVERHEAD2_APPL,"); |
|
|
|
searchSql.append(" to_char(START_DATE, 'yyyy-MM-dd') START_DATE, to_char(END_DATE, 'yyyy-MM-dd') END_DATE"); |
|
|
|
searchSql.append(" FROM ifsapp.WORK_CENTER_COST"); |
|
|
|
searchSql.append(" WHERE ifsapp.Work_Center_API.Get_Work_Center_Code_Db(contract, work_center_no) = 'I'"); |
|
|
|
|
|
|
|
//设置查询的入参 |
|
|
|
Map<String, String> inParam = new HashMap<>(); |
|
|
|
//判断是否存在入参 |
|
|
|
if ((ifsRowVersion == null || "".equals(ifsRowVersion))){ |
|
|
|
searchSql.append(" AND OBJVERSION >= :ifsRowVersion"); |
|
|
|
inParam.put("ifsRowVersion", ifsRowVersion); |
|
|
|
} |
|
|
|
//添加排序语句 |
|
|
|
searchSql.append(" ORDER BY OBJVERSION, CONTRACT, WORK_CENTER_NO"); |
|
|
|
//添加分页的查询语句 |
|
|
|
searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY"); |
|
|
|
//调用查询的通用方法 |
|
|
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
|
|
|
//判断能否返回 |
|
|
|
if (recordCollection == null) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} else { |
|
|
|
List<WorkCenterCost> technicalAttributes = new ArrayList<>(); |
|
|
|
//处理结果集 |
|
|
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
|
|
|
//获取数据转bean |
|
|
|
for (int i = 0; i < resultList.size(); i++) { |
|
|
|
Map<String, String> tempMap = resultList.get(i); |
|
|
|
WorkCenterCost tempItem = new WorkCenterCost(); |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setSite(tempMap.get("CONTRACT")); |
|
|
|
tempItem.setWorkCenterNo(tempMap.get("WORK_CENTER_NO")); |
|
|
|
tempItem.setWorkCenterDesc(tempMap.get("WORKCENTERDESC")); |
|
|
|
tempItem.setCostSet(tempMap.get("COST_SET")); |
|
|
|
tempItem.setCostSetDesc(tempMap.get("COSTSETDESC")); |
|
|
|
tempItem.setWcCostCode(tempMap.get("WC_COST_CODE")); |
|
|
|
tempItem.setOverhead1Fac(tempMap.get("OVERHEAD1_FAC")); |
|
|
|
tempItem.setOverhead2Fac(tempMap.get("OVERHEAD2_FAC")); |
|
|
|
tempItem.setOverhead1Appl(tempMap.get("OVERHEAD1_APPL")); |
|
|
|
tempItem.setOverhead2Appl(tempMap.get("OVERHEAD2_APPL")); |
|
|
|
String startDate = tempMap.get("START_DATE"); |
|
|
|
if (!(null == startDate || "".equals(startDate))){ |
|
|
|
tempItem.setBeginDate(DateUtils.getStringToDate(startDate, "yyyy-MM-dd")); |
|
|
|
} |
|
|
|
String endDate = tempMap.get("END_DATE"); |
|
|
|
if (!(null == endDate || "".equals(endDate))) { |
|
|
|
tempItem.setEndDate(DateUtils.getStringToDate(endDate, "yyyy-MM-dd")); |
|
|
|
} |
|
|
|
//添加对象 |
|
|
|
technicalAttributes.add(tempItem); |
|
|
|
} |
|
|
|
return technicalAttributes; |
|
|
|
} |
|
|
|
} |
|
|
|
} |