|
@@ -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();
|
|
|
}
|