Browse Source

[fix]

工程管理 物料信息
修改物料信息审批完成controller,修改更新方法调用;
新增物料信息更新审批信息service方法,修改提交审批service调用更新方法;
dev
王晓迪 2 months ago
parent
commit
0c7999d8dd
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 42
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

4
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -247,7 +247,7 @@ public class ErpMaterialController extends BaseController
erpMaterialVo.setUseStatus("1");
}
}
erpMaterialService.updateErpMaterial(erpMaterialVo);
erpMaterialService.updateErpMaterialAuditInfo(erpMaterialVo);
SysUser sysUser = ShiroUtils.getSysUser();
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId());
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName();
@ -264,7 +264,7 @@ public class ErpMaterialController extends BaseController
if (saveEntityBoolean) {
erpMaterialVo.setAuditStatus("0");
erpMaterialVo.setUseStatus("0");
erpMaterialService.updateErpMaterial(erpMaterialVo);
erpMaterialService.updateErpMaterialAuditInfo(erpMaterialVo);
}
return success("任务已完成");
}

42
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -319,7 +319,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
String fileIdStr = erpMaterial.getFileIdStr();
Long photoAttachId = erpMaterial.getPhotoAttachId();
String removeFileIdStr = erpMaterial.getRemoveFileIdStr();
erpMaterial.setUpdateTime(new Date());
erpMaterial.setUpdateTime(DateUtils.getNowDate());
if(StringUtils.isNotBlank(removeFileIdStr)){
List<String> removeFileIdList = Arrays.asList(removeFileIdStr.split(";"));
commonService.deleteByIds(removeFileIdList);
@ -329,7 +329,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
if (photoAttachId == null) {
SysAttach attach = new SysAttach();
attach.setCreateBy(loginName);
attach.setCreateTime(new Date());
attach.setCreateTime(DateUtils.getNowDate());
attach.setSourceType("erpMaterial");
attach.setSourceSubType("photo");
attach.setRelId(id);
@ -359,6 +359,42 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return updateResult;
}
/**
* 修改审核物料信息
*
* @param erpMaterial 物料信息
* @return 结果
*/
@Override
public int updateErpMaterialAuditInfo(ErpMaterial erpMaterial)
{
String loginName = ShiroUtils.getLoginName();
Long id = erpMaterial.getId();
String fileIdStr = erpMaterial.getFileIdStr();
Long photoAttachId = erpMaterial.getPhotoAttachId();
String removeFileIdStr = erpMaterial.getRemoveFileIdStr();
erpMaterial.setUpdateTime(DateUtils.getNowDate());
if(StringUtils.isNotBlank(removeFileIdStr)){
List<String> removeFileIdList = Arrays.asList(removeFileIdStr.split(";"));
commonService.deleteByIds(removeFileIdList);
}
if(StringUtils.isNotBlank(fileIdStr)) {
List<String> fileIdList = Arrays.asList(fileIdStr.split(";"));
if (photoAttachId == null) {
SysAttach attach = new SysAttach();
attach.setCreateBy(loginName);
attach.setCreateTime(DateUtils.getNowDate());
attach.setSourceType("erpMaterial");
attach.setSourceSubType("photo");
attach.setRelId(id);
attachService.insertSysAttach(attach);
photoAttachId = attach.getId();
}
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList);
}
int updateResult = erpMaterialMapper.updateErpMaterial(erpMaterial);
return updateResult;
}
/**
* 删除物料信息对象
*
@ -436,7 +472,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
if(erpMaterial.getId() == null){
insertErpMaterial(erpMaterial);
}else{
updateErpMaterial(erpMaterial);
updateErpMaterialAuditInfo(erpMaterial);
}
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息提交审批-"+DateUtils.dateTimeNow();

Loading…
Cancel
Save