|
@@ -1,486 +0,0 @@
|
|
|
-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.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.BatchSubmitShemeBillEntryCollection;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.BatchSubmitShemeBillEntryFactory;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.BatchSubmitShemeBillEntryInfo;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.BatchSubmitShemeBillInfo;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.CalSubmitItemCollection;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.CalSubmitItemFactory;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.CalSubmitItemInfo;
|
|
|
-import com.kingdee.shr.compensation.app.integrate.IBatchSubmitShemeBillEntry;
|
|
|
-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.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.springframework.ui.ModelMap;
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * 提报单拓展
|
|
|
- * @author coyle
|
|
|
- * 20250520
|
|
|
- */
|
|
|
-public class TimepieceSchemeBillEditHandlerEx extends TimepieceSchemeBillEditHandler {
|
|
|
-
|
|
|
- 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);
|
|
|
- BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
|
|
|
- BatchSubmitShemeBillEntryCollection entry = info.getEntry();
|
|
|
- String billId = "";
|
|
|
- if(ObjectUtils.allNotNull(info.getId())) {
|
|
|
- billId = info.getId().toString();
|
|
|
- }
|
|
|
- //拉取mes点检率数据
|
|
|
- exeDataOnDay(billId,entry);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 设置点检率数据
|
|
|
- * @param billId
|
|
|
- * @param entrys
|
|
|
- * @throws SHRWebException
|
|
|
- */
|
|
|
- public void setMesData(Context ctx,String billId,BatchSubmitShemeBillEntryCollection entrys,HashMap<String, HashMap> mesData ) throws SHRWebException {
|
|
|
-// Map<String, Set<String>> personDateMap = new HashMap<>();
|
|
|
- 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;
|
|
|
- }
|
|
|
- for (String field : FEILDS.keySet()) { // 或者使用 ITEMNUMS
|
|
|
- String sVal = FEILDS.get(field);
|
|
|
- if (entry.containsKey(sVal)) {
|
|
|
- entry.put(sVal, valMap.get(sVal)); // 设置为 0 或其他默认值
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 从中间表获取mes数据
|
|
|
- */
|
|
|
- private HashMap<String,HashMap> getMesData(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 , onSite , teamApp , salarysEq ,"
|
|
|
- + " fbizDate "
|
|
|
- + " 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("fbizDate");
|
|
|
- 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("onSite"));
|
|
|
- valMap.put(FEILDS.get(TEAMAPP), rst.getString("teamApp"));
|
|
|
- valMap.put(FEILDS.get(SALARYSEQ), rst.getString("salarysEq"));
|
|
|
- checkMap.put(key, valMap);
|
|
|
- }
|
|
|
- }catch(BOSException e){
|
|
|
- e.printStackTrace();
|
|
|
- } catch (SQLException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- return checkMap;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 数据处理
|
|
|
- * 校验对应的某一天已存在数据/mes数据获取等
|
|
|
- * @param billId
|
|
|
- * @param entrys
|
|
|
- * @throws SHRWebException
|
|
|
- */
|
|
|
- public void exeDataOnDay(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(ctx, selectPerson, dateRange);
|
|
|
- setMesData(ctx, billId, 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);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 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);
|
|
|
- BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
|
|
|
- BatchSubmitShemeBillEntryCollection entry = info.getEntry();
|
|
|
- String billId = "";
|
|
|
- if(ObjectUtils.allNotNull(info.getId())) {
|
|
|
- billId = info.getId().toString();
|
|
|
- }
|
|
|
-// exeDataOnDay(billId,entry);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- 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);
|
|
|
- this.writeSuccessData(responseData);
|
|
|
- } catch (Exception var6) {
|
|
|
- ExceptionHandle.handleException(var6);
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
-}
|