|
@ -1,6 +1,8 @@ |
|
|
package com.ruoyi.erp.service.impl; |
|
|
package com.ruoyi.erp.service.impl; |
|
|
|
|
|
|
|
|
import com.github.pagehelper.Page; |
|
|
import com.github.pagehelper.Page; |
|
|
|
|
|
import com.ruoyi.common.constant.BusinessKeysConstants; |
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysFieldDifferent; |
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
import com.ruoyi.common.core.page.PageDomain; |
|
|
import com.ruoyi.common.core.page.PageDomain; |
|
|
import com.ruoyi.common.core.page.TableSupport; |
|
|
import com.ruoyi.common.core.page.TableSupport; |
|
@ -8,6 +10,7 @@ import com.ruoyi.common.core.text.Convert; |
|
|
import com.ruoyi.common.exception.BusinessException; |
|
|
import com.ruoyi.common.exception.BusinessException; |
|
|
import com.ruoyi.common.service.ICommonService; |
|
|
import com.ruoyi.common.service.ICommonService; |
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
|
|
import com.ruoyi.common.utils.FieldCompareUtil; |
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
import com.ruoyi.erp.domain.ErpMaterial; |
|
|
import com.ruoyi.erp.domain.ErpMaterial; |
|
@ -34,6 +37,7 @@ import com.ruoyi.warehouse.domain.WarehouseInventoryInquiry; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; |
|
|
|
|
|
import lombok.SneakyThrows; |
|
|
import org.activiti.engine.TaskService; |
|
|
import org.activiti.engine.TaskService; |
|
|
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; |
|
|
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; |
|
|
import org.activiti.engine.runtime.ProcessInstance; |
|
|
import org.activiti.engine.runtime.ProcessInstance; |
|
@ -126,6 +130,9 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
@Autowired |
|
|
@Autowired |
|
|
private BaseEmpRequisiteOrderChildMapper requisiteOrderChildMapper; |
|
|
private BaseEmpRequisiteOrderChildMapper requisiteOrderChildMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ISysDiffLogService diffLogService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final static String RMB = "1"; //RMB
|
|
|
private final static String RMB = "1"; //RMB
|
|
|
|
|
|
|
|
@ -260,6 +267,14 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
erpMaterial.setCreateTime(new Date()); |
|
|
erpMaterial.setCreateTime(new Date()); |
|
|
int result = erpMaterialMapper.insertErpMaterial(erpMaterial); |
|
|
int result = erpMaterialMapper.insertErpMaterial(erpMaterial); |
|
|
Long id = erpMaterial.getId(); |
|
|
Long id = erpMaterial.getId(); |
|
|
|
|
|
//新增修改记录数据
|
|
|
|
|
|
SysDiffLog sysDiffLog = new SysDiffLog(); |
|
|
|
|
|
sysDiffLog.setBusinessId(id); |
|
|
|
|
|
sysDiffLog.setBusinessKey(BusinessKeysConstants.ERP_MATERIAL); |
|
|
|
|
|
int insertSysDiffLog = diffLogService.insertSysDiffLog(sysDiffLog); |
|
|
|
|
|
if (insertSysDiffLog <= 0){ |
|
|
|
|
|
throw new BusinessException("新增物料信息数据修改记录失败"); |
|
|
|
|
|
} |
|
|
String fileIdStr = erpMaterial.getFileIdStr(); |
|
|
String fileIdStr = erpMaterial.getFileIdStr(); |
|
|
if(StringUtils.isNotBlank(fileIdStr)){ |
|
|
if(StringUtils.isNotBlank(fileIdStr)){ |
|
|
// 保存附件关联
|
|
|
// 保存附件关联
|
|
@ -311,6 +326,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
* @param erpMaterial 物料信息 |
|
|
* @param erpMaterial 物料信息 |
|
|
* @return 结果 |
|
|
* @return 结果 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@SneakyThrows |
|
|
@Override |
|
|
@Override |
|
|
public int updateErpMaterial(ErpMaterial erpMaterial) |
|
|
public int updateErpMaterial(ErpMaterial erpMaterial) |
|
|
{ |
|
|
{ |
|
@ -338,6 +354,16 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
} |
|
|
} |
|
|
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList); |
|
|
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ErpMaterial oldErpMaterial = erpMaterialMapper.selectErpMaterialById(id); |
|
|
|
|
|
//修改数据日记修改记录表
|
|
|
|
|
|
List<SysFieldDifferent> compare = FieldCompareUtil.compare(ErpMaterial.class, erpMaterial, oldErpMaterial); |
|
|
|
|
|
if (!CollectionUtils.isEmpty(compare)){ |
|
|
|
|
|
int updateSysDiffLog = diffLogService.updateSysDiffLogByBusiness(id, BusinessKeysConstants.ERP_MATERIAL, compare); |
|
|
|
|
|
if (updateSysDiffLog <= 0){ |
|
|
|
|
|
throw new BusinessException("修改物料信息数据修改记录失败"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
int updateResult = erpMaterialMapper.updateErpMaterial(erpMaterial); |
|
|
int updateResult = erpMaterialMapper.updateErpMaterial(erpMaterial); |
|
|
if(erpMaterial.getProcessMethod().equals("2")){ |
|
|
if(erpMaterial.getProcessMethod().equals("2")){ |
|
|
List<OutsourceProcess> processes = erpMaterial.getProcessList(); |
|
|
List<OutsourceProcess> processes = erpMaterial.getProcessList(); |
|
@ -365,6 +391,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
* @param erpMaterial 物料信息 |
|
|
* @param erpMaterial 物料信息 |
|
|
* @return 结果 |
|
|
* @return 结果 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@SneakyThrows |
|
|
@Override |
|
|
@Override |
|
|
public int updateErpMaterialAuditInfo(ErpMaterial erpMaterial) |
|
|
public int updateErpMaterialAuditInfo(ErpMaterial erpMaterial) |
|
|
{ |
|
|
{ |
|
@ -392,6 +419,17 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
} |
|
|
} |
|
|
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList); |
|
|
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ErpMaterial oldErpMaterial = erpMaterialMapper.selectErpMaterialById(id); |
|
|
|
|
|
//修改数据日记修改记录表
|
|
|
|
|
|
List<SysFieldDifferent> compare = FieldCompareUtil.compare(ErpMaterial.class, erpMaterial, oldErpMaterial); |
|
|
|
|
|
if (!CollectionUtils.isEmpty(compare)){ |
|
|
|
|
|
int updateSysDiffLog = diffLogService.updateSysDiffLogByBusiness(id, BusinessKeysConstants.ERP_MATERIAL, compare); |
|
|
|
|
|
if (updateSysDiffLog <= 0){ |
|
|
|
|
|
throw new BusinessException("修改物料信息数据修改记录失败"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int updateResult = erpMaterialMapper.updateErpMaterial(erpMaterial); |
|
|
int updateResult = erpMaterialMapper.updateErpMaterial(erpMaterial); |
|
|
return updateResult; |
|
|
return updateResult; |
|
|
} |
|
|
} |
|
|