From 9e12f2d8980173ac3661140cdcfdc7bf8246855a Mon Sep 17 00:00:00 2001 From: hy2250089 Date: Wed, 8 Jan 2020 14:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BF=AE=E6=94=B92=EF=BC=9A=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=99=8D=E5=BA=8F=E6=9F=A5=E8=AF=A2=E3=80=81?= =?UTF-8?q?=E7=BC=96=E5=86=99=E5=88=A0=E9=99=A4=E7=89=A9=E6=96=99=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/MaterialsOutgoingLogMapper.java | 2 +- .../manage/mapper/MaterialsInfoMapper.xml | 4 ++-- .../mapper/MaterialsOutgoingLogMapper.xml | 11 +++++---- .../manage/service/MaterialsInfoService.java | 3 ++- .../service/MaterialsOutgoingLogService.java | 2 +- .../impl/MaterialsInfoServiceImpl.java | 11 +++++---- .../impl/MaterialsOutgoingLogServiceImpl.java | 23 +++++++++++-------- .../manage/web/MaterialsInfoController.java | 8 +------ .../web/MaterialsOutgoingLogController.java | 4 ---- 9 files changed, 33 insertions(+), 35 deletions(-) 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正在用 * 出入库操作,添加一条出入库记录,同时更新对应的库存信息