use of com.eservice.api.model.contact_form.ContactForm in project sinsim by WilsonHu.
the class ContactFormController method startSign.
/**
* 联系单发起审核
*
* @param lxdId
* @return
*/
@PostMapping("/startSign")
@Transactional(rollbackFor = Exception.class)
public Result startSign(@RequestParam Integer lxdId) {
if (lxdId == null) {
ResultGenerator.genFailResult("联系单ID为空!");
} else {
ContactSign contactSign = contactSignService.getContactSignByLxdId((lxdId));
if (contactSign == null) {
return ResultGenerator.genFailResult("根据联系单ID号获取 签核信息失败!");
} else {
List<SignContentItem> contactSignContentList = JSON.parseArray(contactSign.getSignContent(), SignContentItem.class);
String currentStep = "";
for (SignContentItem item : contactSignContentList) {
// 签核在初始化,则把当前步骤设为发起部门
if (item.getResult() == Constant.SIGN_INITIAL && item.getShenHeEnabled()) {
currentStep = roleService.findById(item.getRoleId()).getRoleName();
break;
}
}
contactSign.setCurrentStep(currentStep);
logger.info("开始 联系单签核 currentStep " + currentStep);
// 更新审核数据currentstep
contactSignService.update(contactSign);
// 更新联系单状态为 STR_LXD_CHECKING
ContactForm contactForm = contactFormService.findById(lxdId);
if (contactForm == null) {
return ResultGenerator.genFailResult("联系单号ID无效");
} else {
contactForm.setStatus(Constant.STR_LXD_CHECKING);
contactForm.setUpdateDate(new Date());
logger.info("联系单签核 setStatus " + Constant.STR_LXD_CHECKING);
contactFormService.update(contactForm);
commonService.pushLxdMsgToAftersale(contactSign, contactForm, false, Constant.STR_MSG_PUSH_IS_START_TO_SIGN);
}
}
}
return ResultGenerator.genSuccessResult();
}
Aggregations