diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MaterialsOutgoingLogMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MaterialsOutgoingLogMapper.java index c7a64cb..48bf572 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MaterialsOutgoingLogMapper.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MaterialsOutgoingLogMapper.java @@ -12,6 +12,6 @@ import java.util.List; public interface MaterialsOutgoingLogMapper extends Mapper { List findListByOneMaterial(MaterialsOutgoingLogParams params); - void deleteByOutgoingIds(List ids); + void deleteByOutgoingIds(HashMap outgoingParam); } \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsInfoMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsInfoMapper.xml index c562421..546e98f 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsInfoMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsInfoMapper.xml @@ -78,7 +78,7 @@ AND com.company_id = #{companyId} - order by materials.create_time DESC + ORDER BY materials.create_time DESC \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsOutgoingLogMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsOutgoingLogMapper.xml index 3ff18fa..a73bfa1 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsOutgoingLogMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MaterialsOutgoingLogMapper.xml @@ -50,11 +50,12 @@ ORDER BY outgoing.create_time DESC - - DELETE FROM mt_alone_materials_outgoing_log WHERE id IN - - #{ids} - + + DELETE FROM mt_alone_materials_outgoing_log + where 1>2 OR company_id=#{companyId} AND id IN + + #{id} + \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsInfoService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsInfoService.java index 144a465..02bd1bc 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsInfoService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsInfoService.java @@ -1,5 +1,6 @@ package com.deer.wms.produce.manage.service; +import com.deer.wms.intercept.common.data.CurrentUser; import com.deer.wms.produce.manage.model.MaterialsInfo; import com.deer.wms.produce.manage.model.MaterialsInfoDto; import com.deer.wms.produce.manage.model.MaterialsInfoParams; @@ -20,5 +21,5 @@ public interface MaterialsInfoService extends Service { List findMaterialsByKeyWords(MaterialsInfoParams params); - void deleteRelevantById(Integer materialsId); + void deleteRelevantById(Integer materialsId, CurrentUser currentUser); } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsOutgoingLogService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsOutgoingLogService.java index a369cba..047031e 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsOutgoingLogService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MaterialsOutgoingLogService.java @@ -21,5 +21,5 @@ public interface MaterialsOutgoingLogService extends Service ids); + void deleteByOutgoingIds(HashMap outgoingParam); } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java index 0e095d7..43e8509 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.deer.wms.produce.manage.service.impl; +import com.deer.wms.intercept.common.data.CurrentUser; import com.deer.wms.produce.manage.dao.MaterialsInfoMapper; import com.deer.wms.produce.manage.model.*; import com.deer.wms.produce.manage.service.MaterialsInfoService; @@ -52,7 +53,7 @@ public class MaterialsInfoServiceImpl extends AbstractService materialsOutgoingLogList = materialsOutgoingLogService.findListByOneMaterial(params); - System.out.println("=========="+materialsOutgoingLogList.size()); + if((null!=materialsOutgoingLogList) && (materialsOutgoingLogList.size()!=0)){ List ids = new ArrayList(); for (MaterialsOutgoingLogVo materialsOutgoingLogVo : materialsOutgoingLogList){ ids.add(materialsOutgoingLogVo.getId()); } - System.out.println("----------"+ids.size()); if((null!=ids) && (ids.size()!=0)) { - materialsOutgoingLogService.deleteByOutgoingIds(ids); + HashMap outgoingParam = new HashMap(); + outgoingParam.put("companyId", 1); + outgoingParam.put("ids", ids); + materialsOutgoingLogService.deleteByOutgoingIds(outgoingParam); } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsOutgoingLogServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsOutgoingLogServiceImpl.java index be73b51..a59dfa3 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsOutgoingLogServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsOutgoingLogServiceImpl.java @@ -39,18 +39,22 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService ids) { - materialsOutgoingLogMapper.deleteByOutgoingIds(ids); + public void deleteByOutgoingIds(HashMap outgoingParam) { + materialsOutgoingLogMapper.deleteByOutgoingIds(outgoingParam); } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java index 8f2dc94..3b3740e 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java @@ -42,12 +42,6 @@ public class MaterialsInfoController { @Autowired private MaterialsInfoService materialsInfoService; - @Autowired - private MaterialsStockInfoService materialsStockInfoService; - - @Autowired - private MaterialsOutgoingLogService materialsOutgoingLogService; - /** * hy正在用 * 新增物料信息 @@ -94,7 +88,7 @@ public class MaterialsInfoController { // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); //} - materialsInfoService.deleteRelevantById(materialsId); + materialsInfoService.deleteRelevantById(materialsId, currentUser); return ResultGenerator.genSuccessResult(); } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsOutgoingLogController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsOutgoingLogController.java index d75d2fd..29e1425 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsOutgoingLogController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsOutgoingLogController.java @@ -35,10 +35,6 @@ public class MaterialsOutgoingLogController { @Autowired private MaterialsOutgoingLogService materialsOutgoingLogService; - @Autowired - private MaterialsStockInfoService materialsStockInfoService; - - /** * hy正在用 * 出入库操作,添加一条出入库记录,同时更新对应的库存信息