wkyy 3 роки тому
батько
коміт
4c8611ebe1

+ 1 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/dao/WorkOverPersonDAO.java

@@ -26,4 +26,5 @@ public interface WorkOverPersonDAO {
     List<WorkOverPerson> findByPersonIdAndSEDate(Long personId, Date startDate,Date endDate);
     WorkOverPerson findOneByPersonIdAndOffsetMinute(Long personId, Date recordTime, int earlyMinutes, int delayMinutes);
     List<Map> findUnFinishByDate(Date startDate, Date endDate);
+    int deletePerson(String id);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/service/WorkOverPersonService.java

@@ -33,4 +33,6 @@ public interface WorkOverPersonService {
     List<Map> findUnFinishByDate(Date startDate, Date endDate);
 
     int updateFinishTime(String day);
+
+    int deletePerson(String id);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/service/WorkOverService.java

@@ -32,4 +32,6 @@ public interface WorkOverService {
 	Date findTopApprovalTimeByPersonId(Long personId,Date startDate, Date endDate);
 
     boolean punchIn(String deviceNo, Long personId, Date recordTime);
+
+
 }

+ 12 - 5
common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/BusinessOutServiceImpl.java

@@ -10,6 +10,7 @@ import com.jpsoft.shinestar.config.WxConfig;
 import com.jpsoft.shinestar.modules.base.entity.*;
 import com.jpsoft.shinestar.modules.base.service.*;
 import com.jpsoft.shinestar.modules.business.dto.UpdatePersonAttendanceDTO;
+import com.jpsoft.shinestar.modules.business.entity.RequestForLeaveInfo;
 import com.jpsoft.shinestar.modules.business.entity.WorkScheduleAttendance;
 import com.jpsoft.shinestar.modules.business.service.WorkScheduleAttendanceService;
 import com.jpsoft.shinestar.modules.business.service.impl.WorkScheduleAttendanceServiceImpl;
@@ -407,9 +408,14 @@ public class BusinessOutServiceImpl implements BusinessOutService {
     @Override
     public String submitBusiness(PersonPopedom personPopedom, String type, String destination, String startTime,String endTime,String days, String estimatedTime, String content,String formId,String ids,String draft) throws Exception {
 
-
         BusinessOut businessOut = new BusinessOut();
-        businessOut.setId(UUID.randomUUID().toString());
+        if(StringUtils.isNotEmpty(ids)){
+            businessOut=businessOutDAO.get(ids);
+
+        }else{
+            businessOut = new BusinessOut();
+            businessOut.setId(UUID.randomUUID().toString());
+        }
         businessOut.setPersonPopedomId(personPopedom.getId());
         businessOut.setType(type);
         businessOut.setStatus("-99");
@@ -464,16 +470,17 @@ public class BusinessOutServiceImpl implements BusinessOutService {
 
             businessOut.setProcinstId(procinstId);
 
-            update(businessOut);
-
             businessOut.setStatus("0");
 
+            update(businessOut);
+
             ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
 
             if (procinstActivity != null) {
                 List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
                 if (procinstActUserList.size() > 0) {
 
+                    BusinessOut finalBusinessOut = businessOut;
                     new Thread(() -> {
                         for (ProcinstActUser procinstActUser : procinstActUserList) {
                             PersonInfo personInfo = personInfoService.get(Long.parseLong(procinstActUser.getUserId()));
@@ -481,7 +488,7 @@ public class BusinessOutServiceImpl implements BusinessOutService {
                             //提交人
                             PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
                             String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-                            WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的出差信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + businessOut.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                            WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的出差信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalBusinessOut.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                         }
                     }).start();
                 }

+ 11 - 2
common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/CustomerDiningRecordServiceImpl.java

@@ -9,6 +9,7 @@ import com.jpsoft.shinestar.modules.base.dao.CompanySuperviseDAO;
 import com.jpsoft.shinestar.modules.base.dao.CustomerDiningRecordDAO;
 import com.jpsoft.shinestar.modules.base.entity.*;
 import com.jpsoft.shinestar.modules.base.service.*;
+import com.jpsoft.shinestar.modules.business.entity.CarryThingsOutFactory;
 import com.jpsoft.shinestar.modules.common.dto.Sort;
 import com.jpsoft.shinestar.modules.common.utils.JwtUtil2;
 import com.jpsoft.shinestar.modules.common.utils.WechatMessageUtil;
@@ -118,7 +119,14 @@ public class CustomerDiningRecordServiceImpl implements CustomerDiningRecordServ
 
 
         CustomerDiningRecord customerDiningRecord = new CustomerDiningRecord();
-        customerDiningRecord.setId(UUID.randomUUID().toString());
+        if(StringUtils.isNotEmpty(ids)){
+            customerDiningRecord=customerDiningRecordDAO.get(ids);
+
+        }else{
+            customerDiningRecord = new CustomerDiningRecord();
+            customerDiningRecord.setId(UUID.randomUUID().toString());
+        }
+
         customerDiningRecord.setPersonPopedomId(personPopedom.getId());
         customerDiningRecord.setCompanyId(personPopedom.getCompanyId());
         customerDiningRecord.setCustomerCompany(customerCompany);
@@ -158,8 +166,9 @@ public class CustomerDiningRecordServiceImpl implements CustomerDiningRecordServ
                                 //提交人
                                 PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
                                 String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
+                                CustomerDiningRecord finalCustomerDiningRecord = customerDiningRecord;
                                 new Thread(() -> {
-                                    WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的接待进餐信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + customerDiningRecord.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                                    WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的接待进餐信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalCustomerDiningRecord.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                                 }).start();
                             }
                         } catch (Exception ex) {

+ 6 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/WorkOverPersonServiceImpl.java

@@ -76,6 +76,12 @@ public class WorkOverPersonServiceImpl implements WorkOverPersonService {
         return workOverPersonDAO.delete(id);
     }
 
+    @Override
+    public int deletePerson(String id) {
+        // TODO Auto-generated method stub
+        return workOverPersonDAO.deletePerson(id);
+    }
+
     @Override
     public boolean exist(String id) {
         // TODO Auto-generated method stub

+ 15 - 3
common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/WorkOverServiceImpl.java

@@ -8,6 +8,7 @@ import cn.hutool.core.date.DateUtil;
 import com.jpsoft.shinestar.config.WxConfig;
 import com.jpsoft.shinestar.modules.base.entity.*;
 import com.jpsoft.shinestar.modules.base.service.*;
+import com.jpsoft.shinestar.modules.business.entity.SupplementWork;
 import com.jpsoft.shinestar.modules.common.utils.JwtUtil2;
 import com.jpsoft.shinestar.modules.common.utils.WechatMessageUtil;
 import com.jpsoft.shinestar.modules.workflow.entity.ProcinstActUser;
@@ -330,8 +331,15 @@ public class WorkOverServiceImpl implements WorkOverService {
 		if (StringUtils.isBlank(type)){
 			throw new Exception("加班类型错误");
 		}
+
 		WorkOver workOver = new WorkOver();
-		workOver.setId(UUID.randomUUID().toString());
+		if(StringUtils.isNotEmpty(ids)){
+			workOver=workOverDAO.get(ids);
+		}else{
+			workOver = new WorkOver();
+			workOver.setId(UUID.randomUUID().toString());
+		}
+
 		workOver.setPersonPopedomId(personPopedom.getId());
 		workOver.setStartTime(DateUtil.parse(startTime));
 		workOver.setEndTime(DateUtil.parse(endTime));
@@ -371,6 +379,8 @@ public class WorkOverServiceImpl implements WorkOverService {
 
 		List<PersonInfo> personInfoList = new ArrayList<>();
 
+		workOverPersonService.deletePerson(ids);
+
 		for (String personId : personIdList){
 			PersonInfo personInfo = personInfoService.get(Long.parseLong(personId));
 
@@ -451,6 +461,7 @@ public class WorkOverServiceImpl implements WorkOverService {
 					List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
 					if (procinstActUserList.size() > 0) {
 
+						WorkOver finalWorkOver = workOver;
 						new Thread(() -> {
 							for (ProcinstActUser procinstActUser : procinstActUserList) {
 								try {
@@ -459,7 +470,7 @@ public class WorkOverServiceImpl implements WorkOverService {
 									//提交人
 									PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
 									String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-									WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的加班信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + workOver.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+									WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的加班信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalWorkOver.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
 								} catch (Exception ex) {
 									ex.printStackTrace();
 								}
@@ -471,11 +482,12 @@ public class WorkOverServiceImpl implements WorkOverService {
 				}
 			} else {
 				if (personInfoList.size() > 0) {
+					WorkOver finalWorkOver1 = workOver;
 					new Thread(() -> {
 						for (PersonInfo personInfo : personInfoList) {
 							try {
 								String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-								WechatMessageUtil.sendExamine(personInfo.getOpenId(), "安排加班", personInfo.getName(), "1", "上级安排", "加班", "前往查看", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + workOver.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+								WechatMessageUtil.sendExamine(personInfo.getOpenId(), "安排加班", personInfo.getName(), "1", "上级安排", "加班", "前往查看", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + finalWorkOver1.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
 							} catch (Exception ex) {
 								ex.printStackTrace();
 							}

+ 18 - 9
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/AdjustShiftServiceImpl.java

@@ -4,10 +4,7 @@ import cn.hutool.core.date.DateUtil;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.PageHelper;
 import com.jpsoft.shinestar.config.WxConfig;
-import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
-import com.jpsoft.shinestar.modules.base.entity.PersonPopedom;
-import com.jpsoft.shinestar.modules.base.entity.WorkPersonScheduling;
-import com.jpsoft.shinestar.modules.base.entity.WorkShiftInfo;
+import com.jpsoft.shinestar.modules.base.entity.*;
 import com.jpsoft.shinestar.modules.base.service.PersonInfoService;
 import com.jpsoft.shinestar.modules.base.service.PersonPopedomService;
 import com.jpsoft.shinestar.modules.base.service.WorkPersonSchedulingService;
@@ -160,8 +157,17 @@ public class AdjustShiftServiceImpl implements AdjustShiftService {
             AdjustShift adjustShift = new AdjustShift();
             AdjustShiftPerson adjustShiftPerson = new AdjustShiftPerson();
 
+            if(StringUtils.isNotEmpty(ids)){
+                adjustShift=adjustShiftDAO.get(ids);
+                adjustShiftPerson=adjustShiftPersonService.findByAdjustShiftId(ids).get(0);
+                }else{
+                    adjustShift = new AdjustShift();
+                    adjustShiftPerson = new AdjustShiftPerson();
+                    adjustShift.setId(UUID.randomUUID().toString());
+                    adjustShiftPerson.setId(UUID.randomUUID().toString());
+            }
+
             //创建主业务表
-            adjustShift.setId(UUID.randomUUID().toString());
             adjustShift.setPersonPopedomId(personPopedom.getId());
             //  adjustShift.setSchedulingId(workPersonScheduling.getId());
             adjustShift.setAdjustDate(DateUtil.format(dateTime, "yyyy-MM-dd"));
@@ -190,7 +196,7 @@ public class AdjustShiftServiceImpl implements AdjustShiftService {
 
 
             //创建业务子表
-            adjustShiftPerson.setId(UUID.randomUUID().toString());
+
             adjustShiftPerson.setAdjustShiftId(adjustShift.getId());
             adjustShiftPerson.setSchedulingId(workPersonScheduling.getId());
             adjustShiftPerson.setPersonPopedomId(personPopedom.getId());
@@ -201,8 +207,10 @@ public class AdjustShiftServiceImpl implements AdjustShiftService {
 
             if(StringUtils.isNotEmpty(ids)){
                 update(adjustShift);
+                adjustShiftPersonService.update(adjustShiftPerson);
             }else {
                 insert(adjustShift);
+                adjustShiftPersonService.insert(adjustShiftPerson);
             }
 
 
@@ -214,9 +222,9 @@ public class AdjustShiftServiceImpl implements AdjustShiftService {
 
 
                 adjustShift.setProcinstId(procinstId);
-                update(adjustShift);
-                adjustShiftPersonService.insert(adjustShiftPerson);
                 adjustShift.setStatus("0");
+                update(adjustShift);
+                adjustShiftPersonService.update(adjustShiftPerson);
 
 
                 ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
@@ -233,8 +241,9 @@ public class AdjustShiftServiceImpl implements AdjustShiftService {
                                     //提交人
                                     PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
                                     String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
+                                    AdjustShift finalAdjustShift = adjustShift;
                                     new Thread(() -> {
-                                        WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的调班信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + adjustShift.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                                        WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的调班信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalAdjustShift.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                                     }).start();
                                 }
                             } catch (Exception ex) {

+ 12 - 3
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/CarryThingsOutFactoryServiceImpl.java

@@ -10,6 +10,7 @@ import cn.hutool.core.date.DateUtil;
 import com.jpsoft.shinestar.config.WxConfig;
 import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
 import com.jpsoft.shinestar.modules.base.entity.PersonPopedom;
+import com.jpsoft.shinestar.modules.base.entity.WorkOver;
 import com.jpsoft.shinestar.modules.base.service.PersonInfoService;
 import com.jpsoft.shinestar.modules.common.utils.JwtUtil2;
 import com.jpsoft.shinestar.modules.common.utils.WechatMessageUtil;
@@ -114,7 +115,14 @@ public class CarryThingsOutFactoryServiceImpl implements CarryThingsOutFactorySe
 
 
 		CarryThingsOutFactory carryThingsOutFactory = new CarryThingsOutFactory();
-		carryThingsOutFactory.setId(UUID.randomUUID().toString());
+		if(StringUtils.isNotEmpty(ids)){
+			carryThingsOutFactory=carryThingsOutFactoryDAO.get(ids);
+
+		}else{
+			carryThingsOutFactory = new CarryThingsOutFactory();
+			carryThingsOutFactory.setId(UUID.randomUUID().toString());
+		}
+
 		carryThingsOutFactory.setPersonPopedomId(personPopedom.getId());
 		carryThingsOutFactory.setLeaveFactoryTime(DateUtil.parse(date));
 		carryThingsOutFactory.setLeaveFactoryReason(content);
@@ -132,8 +140,8 @@ public class CarryThingsOutFactoryServiceImpl implements CarryThingsOutFactorySe
 			String procinstId = procinstService.addProcinst(carryThingsOutFactory.getId(), null, "携物出厂", formId, personPopedom, null);
 
 			carryThingsOutFactory.setProcinstId(procinstId);
-			update(carryThingsOutFactory);
 			carryThingsOutFactory.setAuditStatus("0");
+			update(carryThingsOutFactory);
 
 			ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
 
@@ -141,6 +149,7 @@ public class CarryThingsOutFactoryServiceImpl implements CarryThingsOutFactorySe
 				List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
 				if (procinstActUserList.size() > 0) {
 
+					CarryThingsOutFactory finalCarryThingsOutFactory = carryThingsOutFactory;
 					new Thread(() -> {
 						for (ProcinstActUser procinstActUser : procinstActUserList) {
 							PersonInfo personInfo = personInfoService.get(Long.parseLong(procinstActUser.getUserId()));
@@ -148,7 +157,7 @@ public class CarryThingsOutFactoryServiceImpl implements CarryThingsOutFactorySe
 							//提交人
 							PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
 							String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-							WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的携物出厂信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + carryThingsOutFactory.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+							WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的携物出厂信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalCarryThingsOutFactory.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
 						}
 					}).start();
 				}

+ 34 - 9
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/SupplementWorkServiceImpl.java

@@ -5,6 +5,7 @@ import javax.annotation.Resource;
 
 import cn.hutool.core.date.DateUtil;
 import com.jpsoft.shinestar.config.WxConfig;
+import com.jpsoft.shinestar.modules.base.entity.BusinessOut;
 import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
 import com.jpsoft.shinestar.modules.base.entity.PersonPopedom;
 import com.jpsoft.shinestar.modules.base.entity.WorkShiftInfo;
@@ -126,7 +127,17 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 		}
 
 		SupplementWork supplementWork = new SupplementWork();
-		supplementWork.setId(UUID.randomUUID().toString());
+		SupplementWorkPerson supplementWorkPerson = new SupplementWorkPerson();
+		if(StringUtils.isNotEmpty(ids)){
+			supplementWork=supplementWorkDAO.get(ids);
+			supplementWorkPerson = supplementWorkPersonService.findBySupplementWorkId(ids).get(0);
+		}else{
+			supplementWork = new SupplementWork();
+			supplementWorkPerson = new SupplementWorkPerson();
+			supplementWork.setId(UUID.randomUUID().toString());
+			supplementWorkPerson.setId(UUID.randomUUID().toString());
+		}
+
 		supplementWork.setPersonPopedomId(personPopedom.getId());
 		supplementWork.setWorkShiftId(workScheduleAttendance.getWorkShiftId());
 		supplementWork.setAttendanceDate(DateUtil.format(workScheduleAttendance.getRecordTime(),"yyyy-MM-dd HH:mm"));
@@ -144,8 +155,6 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 		}
 
 		//新增个人记录
-		SupplementWorkPerson supplementWorkPerson = new SupplementWorkPerson();
-		supplementWorkPerson.setId(UUID.randomUUID().toString());
 		supplementWorkPerson.setPersonPopedomId(personPopedom.getId());
 		supplementWorkPerson.setSupplementWorkId(supplementWork.getId());
 		supplementWorkPerson.setScheduleAttendanceId(id);
@@ -161,8 +170,8 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 			String procinstId = procinstService.addProcinst(supplementWork.getId(), null, "补卡", formId, personPopedom, null);
 
 			supplementWork.setProcinstId(procinstId);
-			update(supplementWork);
 			supplementWork.setStatus("0");
+			update(supplementWork);
 
 
 			ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
@@ -171,6 +180,7 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 				List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
 				if (procinstActUserList.size() > 0) {
 
+					SupplementWork finalSupplementWork = supplementWork;
 					new Thread(() -> {
 						for (ProcinstActUser procinstActUser : procinstActUserList) {
 							try {
@@ -179,7 +189,7 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 								//提交人
 								PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
 								String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-								WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的补卡信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + supplementWork.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+								WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的补卡信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalSupplementWork.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
 							} catch (Exception ex) {
 								ex.printStackTrace();
 							}
@@ -214,7 +224,14 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 
 
 		SupplementWork supplementWork = new SupplementWork();
-		supplementWork.setId(UUID.randomUUID().toString());
+		if(StringUtils.isNotEmpty(ids)){
+			supplementWork=supplementWorkDAO.get(ids);
+
+		}else{
+			supplementWork = new SupplementWork();
+			supplementWork.setId(UUID.randomUUID().toString());
+		}
+
 		supplementWork.setPersonPopedomId(personPopedom.getId());
 	//	supplementWork.setWorkShiftId(workShiftId);
 		supplementWork.setAttendanceDate(date);
@@ -234,8 +251,15 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 				n++;
 			}else {
 				PersonInfo personInfo = personInfoService.get(Long.parseLong(personId));
+
 				SupplementWorkPerson supplementWorkPerson = new SupplementWorkPerson();
-				supplementWorkPerson.setId(UUID.randomUUID().toString());
+				if(StringUtils.isNotEmpty(ids)){
+					supplementWorkPerson=supplementWorkPersonService.findBySupplementWorkId(ids).get(0);
+				}else{
+					supplementWorkPerson = new SupplementWorkPerson();
+					supplementWorkPerson.setId(UUID.randomUUID().toString());
+				}
+
 				supplementWorkPerson.setPersonPopedomId(personInfo.getPopedom());
 				supplementWorkPerson.setSupplementWorkId(supplementWork.getId());
 				supplementWorkPerson.setScheduleAttendanceId(workScheduleAttendance.getId());
@@ -262,8 +286,8 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 
 
 			supplementWork.setProcinstId(procinstId);
-			update(supplementWork);
 			supplementWork.setStatus("0");
+			update(supplementWork);
 
 			ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
 
@@ -271,6 +295,7 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 				List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
 				if (procinstActUserList.size() > 0) {
 
+					SupplementWork finalSupplementWork = supplementWork;
 					new Thread(() -> {
 						for (ProcinstActUser procinstActUser : procinstActUserList) {
 							try {
@@ -279,7 +304,7 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 								//提交人
 								PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
 								String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-								WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的补卡信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + supplementWork.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+								WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的补卡信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + finalSupplementWork.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
 							} catch (Exception ex) {
 								ex.printStackTrace();
 							}

+ 3 - 0
common/src/main/resources/mapper/base/WorkOverPerson.xml

@@ -54,6 +54,9 @@
     <delete id="delete" parameterType="string">
         delete from base_work_over_person where id_=#{id,jdbcType=VARCHAR}
     </delete>
+    <delete id="deletePerson" parameterType="string">
+        delete from base_work_over_person where work_over_id_=#{id,jdbcType=VARCHAR}
+    </delete>
     <update id="update" parameterType="com.jpsoft.shinestar.modules.base.entity.WorkOverPerson">
         update base_work_over_person
         <set>