|
@@ -22,6 +22,7 @@ import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
+import com.rongwei.rwcommon.vo.MailDo;
|
|
|
import com.rongwei.rwcommon.vo.generalsql.MasterSlaveUpdateVo;
|
|
|
import com.rongwei.rwcommonentity.commonservers.vo.SysSerialVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -229,6 +230,13 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
sb.append("单据号:"+inspectioncode+"已被改派,不能取消,请刷新数据查看<br>");
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ //获取邮件发送信息
|
|
|
+ NotifyDto mailInfo4Cancel = getMailInfo4Cancel(vo.get(i), inspectionItpDo, dispatchDo, user);
|
|
|
+ if(ObjectUtil.isNotNull(mailInfo4Cancel)) {
|
|
|
+ notifyDtoList.add(mailInfo4Cancel);
|
|
|
+ }
|
|
|
+
|
|
|
/* 10: QC 20: 监理 */
|
|
|
/* 10: 派单前监理取消 20: 派单后监理取消 30: 派单前QC取消 40: 派单后QC取消 */
|
|
|
String cancelSource = vo.get(i).getSource();
|
|
@@ -244,12 +252,6 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
dispatchDo.setDispatchstatus("30");
|
|
|
inspectionItpDo.setInspectionstatus("40");
|
|
|
|
|
|
- //获取邮件发送信息
|
|
|
- NotifyDto mailInfo4Cancel = getMailInfo4Cancel(vo.get(i), inspectionItpDo, dispatchDo, user);
|
|
|
- if(ObjectUtil.isNotNull(mailInfo4Cancel)) {
|
|
|
- notifyDtoList.add(mailInfo4Cancel);
|
|
|
- }
|
|
|
-
|
|
|
} else if ("20".equals(operType)) {
|
|
|
if("task".equals(vo.get(i).getPageType()) && !user.getId().equals(dispatchDo.getSupervisionuserid())){
|
|
|
sb.append("单据号:"+inspectioncode+"已被改派,不能拒收,请刷新数据查看<br>");
|
|
@@ -260,6 +262,11 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
dispatchDo.setRefusereason(vo.get(i).getReason());
|
|
|
dispatchDo.setLastrefusereason(vo.get(i).getReason());
|
|
|
inspectionItpDo.setInspectionstatus("30");
|
|
|
+
|
|
|
+ //完成时间,取首次提交时间
|
|
|
+ if(ObjectUtil.isNull(inspectionItpDo.getInspectioncomplatetime())) {
|
|
|
+ inspectionItpDo.setInspectioncomplatetime(new Date());
|
|
|
+ }
|
|
|
} else if (Arrays.asList("30", "40").contains(operType)) {
|
|
|
//监理检验员只能操作自己的数据
|
|
|
// if(!user.getId().equals(dispatchDo.getSupervisionuserid())){
|
|
@@ -299,6 +306,12 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
sb.append("单据号:"+inspectioncode+"已被接收,请刷新数据查看<br>");
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ //完成时间,取首次提交时间
|
|
|
+ if(Arrays.asList("50", "60").contains(operType) &&
|
|
|
+ ObjectUtil.isNull(inspectionItpDo.getInspectioncomplatetime())) {
|
|
|
+ inspectionItpDo.setInspectioncomplatetime(new Date());
|
|
|
+ }
|
|
|
}
|
|
|
/* 检验员拒收和接收时会传回检验开始/结束时间和文件 */
|
|
|
if (Arrays.asList("20", "50", "60").contains(operType)) {
|
|
@@ -349,15 +362,18 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
|
|
|
log.info("邮件发送", JSONUtil.toJsonStr(notifyDtoList));
|
|
|
//邮件发送
|
|
|
-// if(ObjectUtil.isNotEmpty(notifyDtoList)) {
|
|
|
-// for(NotifyDto notifyDto : notifyDtoList) {
|
|
|
-// MailDo mainDo = new MailDo();
|
|
|
-// mainDo.setSubject(notifyDto.getSubject());
|
|
|
-// mainDo.setContent(notifyDto.getContent());
|
|
|
-// mainDo.setReceiveEmail(notifyDto.getReceiverIds().stream().toArray(String[]::new));
|
|
|
-// notifyFeginService.sendTextMail(mainDo);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if(ObjectUtil.isNotEmpty(notifyDtoList)) {
|
|
|
+ for(NotifyDto notifyDto : notifyDtoList) {
|
|
|
+ MailDo mainDo = new MailDo();
|
|
|
+ mainDo.setSubject(notifyDto.getSubject());
|
|
|
+ mainDo.setContent(notifyDto.getContent());
|
|
|
+ mainDo.setOperationtype("10");
|
|
|
+ mainDo.setCcEmail(new String[]{});
|
|
|
+ mainDo.setNeedTransReceive(true);
|
|
|
+ mainDo.setReceiveEmail(notifyDto.getReceiverIds().stream().toArray(String[]::new));
|
|
|
+ notifyFeginService.sendHtmlMail(mainDo);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
return R.ok();
|
|
|
}
|
|
@@ -404,7 +420,7 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
dao.updateInspectionCount(map);
|
|
|
|
|
|
//更新
|
|
|
- dispatchService.reInspection(dispatchDo.getId());
|
|
|
+ dispatchService.reInspection(dispatchDo.getId(), dispatchDo.getRefusereason());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -445,10 +461,16 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
msg.append(inspectionItpDo.getInspectioncode());
|
|
|
msg.append("】已被【");
|
|
|
msg.append(user.getName());
|
|
|
- msg.append("】取消报验,联系方式:【");
|
|
|
- msg.append(user.getPhone());
|
|
|
- msg.append("】,取消原因");
|
|
|
- msg.append(dispatchDo.getRefusereason());
|
|
|
+ msg.append("】取消报验");
|
|
|
+
|
|
|
+ //手机号
|
|
|
+ if(ObjectUtil.isNotEmpty(user.getMobile())) {
|
|
|
+ msg.append(",联系方式:【");
|
|
|
+ msg.append(user.getMobile());
|
|
|
+ msg.append("】");
|
|
|
+ }
|
|
|
+ msg.append(",取消原因:【");
|
|
|
+ msg.append(vo.getReason());
|
|
|
msg.append("】,请知悉,谢谢。");
|
|
|
|
|
|
notifyDto.setContent(msg.toString());
|