123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- package com.kingdee.shr.compensation.web.handler.timepiece.bill;
- import com.kingdee.bos.BOSException;
- import com.kingdee.bos.Context;
- import com.kingdee.bos.metadata.entity.EntityViewInfo;
- import com.kingdee.bos.metadata.entity.FilterInfo;
- import com.kingdee.bos.metadata.entity.FilterItemInfo;
- import com.kingdee.bos.metadata.entity.SelectorItemCollection;
- import com.kingdee.bos.metadata.entity.SelectorItemInfo;
- import com.kingdee.bos.metadata.query.util.CompareType;
- import com.kingdee.eas.common.EASBizException;
- import com.kingdee.eas.custom.calcdailypay.IInspectionRate;
- import com.kingdee.eas.custom.calcdailypay.InspectionRateCollection;
- import com.kingdee.eas.custom.calcdailypay.InspectionRateFactory;
- import com.kingdee.eas.custom.calcdailypay.InspectionRateInfo;
- import com.kingdee.eas.framework.CoreBaseCollection;
- import com.kingdee.eas.framework.CoreBaseInfo;
- import com.kingdee.eas.util.ToolUtils;
- import com.kingdee.eas.util.app.DbUtil;
- import com.kingdee.jdbc.rowset.IRowSet;
- import com.kingdee.shr.base.syssetting.context.SHRContext;
- import com.kingdee.shr.base.syssetting.exception.SHRWebException;
- import com.kingdee.shr.compensation.app.integrate.*;
- import com.kingdee.shr.compensation.exception.ExceptionHandle;
- import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
- import java.math.BigDecimal;
- import java.sql.SQLException;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.commons.lang3.ObjectUtils;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.ui.ModelMap;
- /**
- * 提报单拓展
- * @author coyle
- * 20250520
- */
- public class TimepieceSchemeBillEditHandlerEx extends TimepieceSchemeBillEditHandler {
- private static Logger logger = LoggerFactory.getLogger(TimepieceSchemeBillEditHandlerEx.class);
- private static SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd");
- //完成率
- private static String COMRATE = "MQ005";
- //岗位类型
- private static String JOBTYPE = "MQ004";
- //技能等级 SKILLLEVEL
- private static String SKILLLEVEL = "MQ003";
- //是否现场作业 On site
- private static String ONSITE = "MQ007";
- //班组任职 Team app
- private static String TEAMAPP = "MQ007";
- //工资序列 Salary seq
- private static String SALARYSEQ = "MQ007";
- private static String[] ITEMNUMS = {COMRATE,JOBTYPE,SKILLLEVEL,ONSITE,TEAMAPP,SALARYSEQ};
- private static Map<String,String> FEILDS = new HashMap();
- public TimepieceSchemeBillEditHandlerEx() throws BOSException {
- Context ctx = SHRContext.getInstance().getContext();
- CalSubmitItemCollection subColl = CalSubmitItemFactory.getLocalInstance(ctx)
- .getCalSubmitItemCollection("SELECT ID,FieldSn,number where number in (" + ToolUtils.aryToStr(ITEMNUMS) + ")");
- if (subColl != null && subColl.size() > 0) {
- for (int i =0 ;i<subColl.size();i++) {
- CalSubmitItemInfo itemInfo = subColl.get(i);
- if (itemInfo != null) {
- String columnName = "S" + itemInfo.getFieldSn();
- FEILDS.put(itemInfo.getNumber() , columnName);
- }
- }
- }
- }
- protected void beforeSave(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
- throws SHRWebException {
- super.beforeSave(request, response, model);
- Context ctx = SHRContext.getInstance().getContext();
- BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
- BatchSubmitShemeBillEntryCollection entry = info.getEntry();
- String billId = "";
- if(ObjectUtils.allNotNull(info.getId())) {
- billId = info.getId().toString();
- }
- //拉取mes点检率数据
- exeDataOnDay( request,billId,entry);
- //先重置点检率标识
- reductionInspectionRate( ctx, info);
- //更新点检率数据
- updateInspectionRate(request, ctx, info);
- }
- /**
- * 从中间表获取mes数据
- */
- private HashMap<String,HashMap> getMesData(HttpServletRequest request,Context ctx ,HashSet<String> selectPerson,DateRange dateRange) {
- HashMap<String,HashMap> checkMap = new HashMap();
- Set<String> checkbillIds = new HashSet();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- try {
- String sql = " select fid ,CFComrate, cfpersonId, cfpositiontype , cfskillLevel , cfonSite , cfteamApp , cfsalarysEq ,"
- + " cfbizDate "
- + " from CT_CAL_InspectionRate where cfpersonid in "
- + "( "
- + ToolUtils.aryToStr(selectPerson,true)
- + " ) "
- + " and cfbizDate >= '"
- + dateFormat.format(dateRange.getMinDate())
- + "' and cfbizDate <= '"
- + dateFormat.format(dateRange.getMaxDate())
- +"'" ;
- IRowSet rst = DbUtil.executeQuery(ctx, sql);
- while( rst.next() ) {
- //点检率id存入
- String checkbillId = rst.getString("fid");
- checkbillIds.add(checkbillId);
- String pId = rst.getString("cfPersonId");
- Date bizDate = rst.getDate("cfbizDate");
- String eDate = SDF.format(bizDate);
- String key = pId+"_"+eDate;
- HashMap<String,String> valMap = new HashMap();
- BigDecimal comrate = rst.getBigDecimal("CFComrate");
- valMap.put(FEILDS.get(COMRATE), comrate.toString());
- //
- valMap.put(FEILDS.get(JOBTYPE), rst.getString("cfpositiontype"));
- valMap.put(FEILDS.get(SKILLLEVEL), rst.getString("cfskillLevel"));
- valMap.put(FEILDS.get(ONSITE), rst.getString("cfonSite"));
- valMap.put(FEILDS.get(TEAMAPP), rst.getString("cfteamApp"));
- valMap.put(FEILDS.get(SALARYSEQ), rst.getString("cfsalarysEq"));
- checkMap.put(key, valMap);
- }
- request.setAttribute("checkbillIds", checkbillIds);
- }catch(BOSException e){
- e.printStackTrace();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- return checkMap;
- }
- /**
- * 数据处理
- * 校验对应的某一天已存在数据/mes数据获取等
- * @param billId
- * @param entrys
- * @throws SHRWebException
- */
- public void exeDataOnDay(HttpServletRequest request,String billId,BatchSubmitShemeBillEntryCollection entrys) throws SHRWebException {
- Context ctx = SHRContext.getInstance().getContext();
- Map<String, Set<String>> personDateMap = new HashMap<>();
- //
- HashSet<String> selectPerson = new HashSet();
- HashSet<String> selectDate = new HashSet();
- for (int i = 0; i < entrys.size(); i++) {
- BatchSubmitShemeBillEntryInfo entry = entrys.get(i);
- String personId = entry.getPerson().getId().toString();
- selectPerson.add(personId);
- Date effectDate = entry.getEffectDate();
- // 增加对 effectDate 为 null 的检查
- if (effectDate == null) {
- throw new IllegalArgumentException("分录中发生日期不能为空,请检查");
- }
- String formattedEffectDate = SDF.format(effectDate);
- selectDate.add(formattedEffectDate);
- // 使用 computeIfAbsent 减少冗余代码,并增加重复检查
- personDateMap.computeIfAbsent(personId, k -> new HashSet<>());
- if (!personDateMap.get(personId).add(formattedEffectDate)) {
- // 如果 add 方法返回 false,说明该日期已经存在,抛出异常
- throw new IllegalArgumentException("分录中" + entry.getPerson().getName() + ",有当日重复提报的数据,请检查");
- }
- }
- if (personDateMap.isEmpty()) {
- return;
- }
- // 找出最大日期与最小日期
- DateRange dateRange = findMinMaxDate(selectDate);
- //校验重复
- verifiOneData(ctx, billId, selectPerson, dateRange, personDateMap);
- //校验完后进行mes数据填充;
- //获取mes数据
- HashMap<String, HashMap> mesData = getMesData(request,ctx, selectPerson, dateRange);
- setMesData( request, entrys, mesData);
- }
- /**
- * 校验当天是否有重复数据
- * @param ctx
- * @param billId
- * @param selectPerson
- * @param dateRange
- * @param personDateMap
- * @throws SHRWebException
- */
- public void verifiOneData(Context ctx ,String billId,HashSet<String> selectPerson,DateRange dateRange,Map<String, Set<String>> personDateMap) throws SHRWebException {
- HashMap<String,String> dataMap = new HashMap();
- try {
- IBatchSubmitShemeBillEntry entryIns = BatchSubmitShemeBillEntryFactory.getLocalInstance(ctx);
- FilterInfo filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("person", selectPerson, CompareType.INCLUDE));
- filter.getFilterItems().add(new FilterItemInfo("bill.id", billId , CompareType.NOTEQUALS ));
- filter.getFilterItems().add(new FilterItemInfo("effectDate", dateRange.getMaxDate() , CompareType.LESS_EQUALS));
- filter.getFilterItems().add(new FilterItemInfo("effectDate", dateRange.getMinDate() , CompareType.GREATER_EQUALS ));
- EntityViewInfo viewInfo = new EntityViewInfo();
- SelectorItemCollection selector = viewInfo.getSelector();
- selector.add(new SelectorItemInfo("person.id"));
- selector.add(new SelectorItemInfo("person.name"));
- selector.add(new SelectorItemInfo("bill.number"));
- selector.add(new SelectorItemInfo("effectDate"));
- viewInfo.setFilter(filter);
- BatchSubmitShemeBillEntryCollection entryCol = entryIns.getBatchSubmitShemeBillEntryCollection(viewInfo);
- for(int i = 0;i<entryCol.size();i++) {
- BatchSubmitShemeBillEntryInfo entryInfo = entryCol.get(i);
- Date effectDate = entryInfo.getEffectDate();
- String personId = entryInfo.getPerson().getId().toString();
- Set<String> pAndDate = personDateMap.get(personId);
- if(pAndDate.contains(SDF.format(effectDate))) {
- String personName = entryInfo.getPerson().getName().toString();
- BatchSubmitShemeBillInfo billInfo = entryInfo.getBill();
- String billNo = billInfo.getNumber();
- dataMap.put(personName, billNo);
- }
- }
- } catch (BOSException e) {
- e.printStackTrace();
- }
- //如果dataMap不为空则循环dataMap的数据组成字符串并抛出异常,"存在哪些人,单据编码为:****"
- if(!dataMap.isEmpty()) {
- String errorMsg = "存在以下当日重复提报人员,姓名与单据编码为:";
- for(String personName : dataMap.keySet()) {
- String billNo = dataMap.get(personName);
- errorMsg += personName + ":" + billNo + " ";
- }
- throw new SHRWebException(errorMsg);
- }
- }
- /**
- * 设置点检率数据
- * @param request
- * @param entrys
- */
- public void setMesData(HttpServletRequest request, BatchSubmitShemeBillEntryCollection entrys,
- HashMap<String, HashMap> mesData) {
- int assignedRows = 0; // 新增:统计实际赋值的行数
- for (int i = 0; i < entrys.size(); i++) {
- BatchSubmitShemeBillEntryInfo entry = entrys.get(i);
- String pId = entry.getPerson().getId().toString();
- Date effectDate = entry.getEffectDate();
- String eDate = SDF.format(effectDate);
- String key = pId + "_" + eDate;
- HashMap valMap = mesData.get(key);
- if (ObjectUtils.isEmpty(valMap)) {
- continue;
- }
- boolean isRowAssigned = false; // 标记当前行是否被赋值
- for (String field : FEILDS.keySet()) {
- String sVal = FEILDS.get(field);
- if (entry.containsKey(sVal)) {
- entry.put(sVal, valMap.get(sVal));
- isRowAssigned = true; // 当前行至少有一个字段被赋值
- }
- }
- if (isRowAssigned) {
- assignedRows++; // 只有实际赋值的行才计数
- }
- }
- // 将统计结果存入 request
- request.setAttribute("assignedRowsCount", assignedRows);
- }
- /**
- * handler校验,先不启用
- * @param request
- * @param response
- * @param modelMap
- * @throws SHRWebException
- */
- public void hasDataOnDayAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
- throws SHRWebException {
- Context ctx = SHRContext.getInstance().getContext();
- // 获取人员 //格式为[pseron1:2025-04-03,person2:2025-04-03],需要转为map
- String proposers = request.getParameter("proposers");
- if (proposers == null || proposers.isEmpty()) {
- return;
- }
- String[] personArr = proposers.split(",");
- HashSet<String> selectPerson = new HashSet();
- HashSet<String> selectData = new HashSet();
- Map<String, Set<String>> personDateMap = new HashMap<>();
- for (int i = 0; i< personArr.length;i++) {
- String personIds = personArr[i];
- String[] parts = personIds.split(":");
- if (parts.length == 2) {
- String personId = parts[0].trim();
- String date = parts[1].trim();
- selectPerson.add(personId);
- selectData.add(date);
- personDateMap.computeIfAbsent(personId, k -> new HashSet<>()).add(date);
- }
- }
- if (personDateMap.isEmpty()) {
- return;
- }
- HashMap<String,String> dataMap = new HashMap();
- // 找出最大日期与最小日期
- DateRange dateRange = findMinMaxDate(selectData);
- IBatchSubmitShemeBillEntry entryIns;
- try {
- entryIns = BatchSubmitShemeBillEntryFactory.getLocalInstance(ctx);
- FilterInfo filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("proposer", selectPerson, CompareType.INCLUDE));
- filter.getFilterItems().add(new FilterItemInfo("effectDate", dateRange.getMaxDate() , CompareType.LESS_EQUALS));
- filter.getFilterItems().add(new FilterItemInfo("effectDate", dateRange.getMinDate() , CompareType.GREATER_EQUALS ));
- EntityViewInfo viewInfo = new EntityViewInfo();
- viewInfo.setFilter(filter);
- BatchSubmitShemeBillEntryCollection entryCol = entryIns.getBatchSubmitShemeBillEntryCollection(viewInfo);
- for(int i = 0;i<entryCol.size();i++) {
- BatchSubmitShemeBillEntryInfo entryInfo = entryCol.get(i);
- Date effectDate = entryInfo.getEffectDate();
- String personId = entryInfo.getPerson().getId().toString();
- Set<String> pAndDate = personDateMap.get(personId);
- if(pAndDate.contains(SDF.format(effectDate))) {
- String personName = entryInfo.getPerson().getName().toString();
- BatchSubmitShemeBillInfo billInfo = entryInfo.getBill();
- String billNo = billInfo.getNumber();
- dataMap.put(personName, billNo);
- }
- }
- } catch (BOSException e) {
- e.printStackTrace();
- }
- Map resultMap = new HashMap();
- JSONUtils.SUCCESS( resultMap );
- }
- private DateRange findMinMaxDate(HashSet<String> subDate) {
- if (subDate == null || subDate.isEmpty()) {
- return null;
- }
- List<Date> dates = new ArrayList<>();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- for (String dateString : subDate) {
- try {
- dates.add(dateFormat.parse(dateString.trim()));
- } catch (ParseException e) {
- // 处理日期格式不正确的情况
- e.printStackTrace();
- return null; // 如果有日期格式不正确,直接返回 null
- }
- }
- if (dates.isEmpty()) {
- return null;
- }
- Date minDate = Collections.min(dates);
- Date maxDate = Collections.max(dates);
- return new DateRange(minDate, maxDate);
- }
- // 定义一个辅助类来存储日期范围
- private static class DateRange {
- private final Date minDate;
- private final Date maxDate;
- public DateRange(Date minDate, Date maxDate) {
- this.minDate = minDate;
- this.maxDate = maxDate;
- }
- public Date getMinDate() {
- return minDate;
- }
- public Date getMaxDate() {
- return maxDate;
- }
- }
- protected void afterSave(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
- throws SHRWebException {
- super.afterSave(request, response, model);
- Context ctx = SHRContext.getInstance().getContext();
- BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
- BatchSubmitShemeBillEntryCollection entry = info.getEntry();
-
- }
- /**
- * 更新点检率
- * @param request
- * @param ctx
- * @param info
- */
- private static void updateInspectionRate(HttpServletRequest request, Context ctx, BatchSubmitShemeBillInfo info) {
- //更新点检率数据
- Set<String> checkbillIds = (Set<String> ) request.getAttribute("checkbillIds");
- FilterInfo filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("id", checkbillIds, CompareType.INCLUDE));
- EntityViewInfo viewInfo = new EntityViewInfo( ) ;
- viewInfo.setFilter(filter);
- SelectorItemCollection selector = viewInfo.getSelector();
- selector.add(new SelectorItemInfo("detailNum"));
- selector.add(new SelectorItemInfo("isSubDetail"));
- try {
- IInspectionRate spIns = InspectionRateFactory.getLocalInstance(ctx);
- InspectionRateCollection inspectionRateCollection = spIns.getInspectionRateCollection(viewInfo);
- CoreBaseCollection cCol = new CoreBaseCollection();
- for(int i = 0;i<inspectionRateCollection.size();i++){
- InspectionRateInfo inspectionRateInfo = inspectionRateCollection.get(i);
- inspectionRateInfo.setDetailNum(info.getNumber());
- inspectionRateInfo.setIsSubDetail(true);
- cCol.add(inspectionRateInfo);
- }
- spIns.updateBatchData(cCol);
- } catch (BOSException e) {
- throw new RuntimeException(e);
- } catch (EASBizException e) {
- throw new RuntimeException(e);
- }
- }
- // public void getDataOnDay(String billId,BatchSubmitShemeBillEntryCollection entrys) throws SHRWebException {
- // Context ctx = SHRContext.getInstance().getContext();
- // Map<String, Set<String>> personDateMap = new HashMap<>();
- // //
- // HashSet<String> selectPerson = new HashSet();
- // HashSet<String> selectDate = new HashSet();
- // for (int i = 0; i < entrys.size(); i++) {
- // BatchSubmitShemeBillEntryInfo entry = entrys.get(i);
- // String personId = entry.getPerson().getId().toString();
- // selectPerson.add(personId);
- // Date effectDate = entry.getEffectDate();
- //
- // String formattedEffectDate = SDF.format(effectDate);
- // selectDate.add(formattedEffectDate);
- // // 使用 computeIfAbsent 减少冗余代码,并增加重复检查
- // personDateMap.computeIfAbsent(personId, k -> new HashSet<>());
- // if (!personDateMap.get(personId).add(formattedEffectDate)) {
- // // 如果 add 方法返回 false,说明该日期已经存在,抛出异常
- // throw new IllegalArgumentException("分录中" + entry.getPerson().getName() + ",有当日重复提报的数据,请检查");
- // }
- // }
- //
- // if (personDateMap.isEmpty()) {
- // return;
- // }
- // // 找出最大日期与最小日期
- // DateRange dateRange = findMinMaxDate(selectDate);
- // //校验重复
- // verifiOneData(ctx, billId, selectPerson, dateRange, personDateMap);
- // //获取mes数据
- // HashMap<String, HashMap> mesData = getMesData(ctx, selectPerson, dateRange);
- // setMesData(ctx, billId, entrys, mesData);
- // }
- public String saveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
- throws SHRWebException {
- try {
- BatchSubmitShemeBillInfo model = (BatchSubmitShemeBillInfo) request.getAttribute("dynamic_model");
- this.doFieldPermFilterSave(request, model);
- this.doSave(request, response, model);
- this.afterSave(request, response, model);
- this.saveAttachment(request, response, model);
- Object responseData = this.generateResponseDataAfterSave(request, response, model);
- Map resultMap = new HashMap();
- resultMap.put("responseData", responseData);
- resultMap.put("assignedRowsCount", request.getAttribute("assignedRowsCount"));
- this.writeSuccessData(resultMap);
- } catch (Exception var6) {
- ExceptionHandle.handleException(var6);
- }
- return null;
- }
- /**
- * 重置点检率标识
- * 将点检率中是否提报标记还原为false;
- * @param ctx
- * @param info
- */
- private static void reductionInspectionRate(Context ctx, BatchSubmitShemeBillInfo info) {
- //更新点检率数据
- String subNum = info.getNumber();
- if(StringUtils.isEmpty(subNum)){
- return;
- }
- FilterInfo filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("detailNum", subNum, CompareType.EQUALS));
- EntityViewInfo viewInfo = new EntityViewInfo( ) ;
- viewInfo.setFilter(filter);
- SelectorItemCollection selector = viewInfo.getSelector();
- selector.add(new SelectorItemInfo("detailNum"));
- selector.add(new SelectorItemInfo("isSubDetail"));
- try {
- IInspectionRate spIns = InspectionRateFactory.getLocalInstance(ctx);
- InspectionRateCollection inspectionRateCollection = spIns.getInspectionRateCollection(viewInfo);
- CoreBaseCollection cCol = new CoreBaseCollection();
- for(int i = 0;i<inspectionRateCollection.size();i++){
- InspectionRateInfo inspectionRateInfo = inspectionRateCollection.get(i);
- inspectionRateInfo.setDetailNum("");
- inspectionRateInfo.setIsSubDetail(false);
- cCol.add(inspectionRateInfo);
- }
- spIns.updateBatchData(cCol);
- } catch (BOSException e) {
- throw new RuntimeException(e);
- } catch (EASBizException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * 删除单据
- */
- @Override
- public String deleteAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
- String returnStr = super.deleteAction(request, response, modelMap);
- reductionAllInsRate(request);
- return returnStr ;
- }
- /**
- * 重置所有点检率
- * @param request
- * @throws SHRWebException
- */
- private void reductionAllInsRate (HttpServletRequest request) throws SHRWebException {
- String billId = getBillId(request);
- String[] ids = billId.split(",");
- //ids转为list集合
- List<String> idList = Arrays.asList(ids);
- Context ctx = SHRContext.getInstance().getContext();
- FilterInfo filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("id", ToolUtils.aryToStr(idList,false), CompareType.INCLUDE));
- EntityViewInfo viewInfo = new EntityViewInfo( ) ;
- viewInfo.setFilter(filter);
- SelectorItemCollection selector = viewInfo.getSelector();
- selector.add(new SelectorItemInfo("number"));
- try {
- IBatchSubmitShemeBill subIns = BatchSubmitShemeBillFactory.getLocalInstance(ctx);
- BatchSubmitShemeBillCollection subCol = subIns.getBatchSubmitShemeBillCollection(viewInfo);
- for(int i = 0;i<subCol.size();i++){
- BatchSubmitShemeBillInfo subInfo = subCol.get(i);
- reductionInspectionRate(ctx, subInfo);
- }
- } catch (BOSException e) {
- throw new RuntimeException(e);
- }
- }
- }
|