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