Browse Source

创建人

zhangxin 7 months ago
parent
commit
ad80792364

+ 3 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java

@@ -164,7 +164,7 @@ public class WcsTaskController extends BaseController {
 
     @PostMapping("/toCharge")
     public AjaxResult toCharge(@RequestBody ToChargeForm toChargeForm) {
-
+        LoginUser loginUser = getLoginUser();
         WcsTask wcsTask = new WcsTask();
         wcsTask.setTaskNo(System.currentTimeMillis() + "");
         wcsTask.setBusinessType(Constant.TASK_BUSINESS_TYPE.TASK_POWER.getValue());
@@ -176,6 +176,8 @@ public class WcsTaskController extends BaseController {
         wcsTask.setPriority(1l);
         wcsTask.setTaskType(Constant.TASK_BUSINESS_TYPE.TASK_POWER.getValue());
         wcsTask.setAgvNo(toChargeForm.getAgvNo().toString());//车号
+        wcsTask.setCreateUser(loginUser.getUsername());
+        wcsTask.setCreateDate(new Date());
         wcsTask.setRemark("充电任务");
         wcsTaskService.insertWcsTask(wcsTask);
         return AjaxResult.success("下发充电任务成功");

+ 16 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/wms/asn/WmsDocAsnHeaderController.java

@@ -1,30 +1,30 @@
 package com.ruoyi.web.controller.warewms.wms.asn;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.servlet.http.HttpServletResponse;
-
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
 import com.ruoyi.ams.asn.domain.WmsDocAsnExportTime;
+import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
 import com.ruoyi.ams.asn.service.IWmsDocAsnDetailsService;
+import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
 import com.ruoyi.ams.xuankuang.domain.form.TicketTaskCancellation;
 import com.ruoyi.ams.xuankuang.domain.vo.WcsResponseVo;
 import com.ruoyi.ams.xuankuang.service.WmsToWcsApiService;
 import com.ruoyi.base.service.IBaseIdsequenceService;
-import com.ruoyi.common.core.domain.model.LoginUser;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
-import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 入库单Controller
@@ -96,6 +96,9 @@ public class WmsDocAsnHeaderController extends BaseController {
     @Log(title = "入库单", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody WmsDocAsnHeader wmsDocAsnHeader) {
+        LoginUser loginUser = getLoginUser();
+        wmsDocAsnHeader.setCreateBy(loginUser.getUsername());
+        wmsDocAsnHeader.setCreateTime(new Date());
         return wmsDocAsnHeaderService.insertWmsDocAsnHeader(wmsDocAsnHeader);
     }
 

+ 8 - 4
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/StirringTankClientService.java

@@ -59,10 +59,14 @@ public class StirringTankClientService {
                     .setReadLiquidLevel(READ_THE_STIRRING_TANK_05).setAutomatic(Boolean.TRUE)
                     .setRate(20).setUnableBitIndex(4).setAbleBitIndex(4).setStartBitIndex(4)
                     .setRunBitIndex(4).setErrorBitIndex(4).setEndBitIndex(4).setConfirmBitIndex(4));//硫酸铵
-            put("CH3CH2OCS2Na", new SkuAgitatedTankAttrDTO().setReadDosageCommand(READ_THE_STIRRING_TANK_12)
-                    .setReadLiquidLevel(READ_THE_STIRRING_TANK_06).setAutomatic(Boolean.TRUE)
-                    .setRate(25).setUnableBitIndex(5).setAbleBitIndex(5).setStartBitIndex(5)
-                    .setRunBitIndex(5).setErrorBitIndex(5).setEndBitIndex(5).setConfirmBitIndex(5));//乙黄药
+//            put("CH3CH2OCS2Na", new SkuAgitatedTankAttrDTO().setReadDosageCommand(READ_THE_STIRRING_TANK_12)
+//                    .setReadLiquidLevel(READ_THE_STIRRING_TANK_06).setAutomatic(Boolean.TRUE)
+//                    .setRate(25).setUnableBitIndex(5).setAbleBitIndex(5).setStartBitIndex(5)
+//                    .setRunBitIndex(5).setErrorBitIndex(5).setEndBitIndex(5).setConfirmBitIndex(5));//乙黄药
+            put("CH3CH2OCS2Na", new SkuAgitatedTankAttrDTO().setReadDosageCommand(READ_THE_STIRRING_TANK_08)
+                    .setReadLiquidLevel(READ_THE_STIRRING_TANK_02).setAutomatic(Boolean.TRUE)
+                    .setRate(25).setUnableBitIndex(1).setAbleBitIndex(1).setStartBitIndex(1)
+                    .setRunBitIndex(1).setErrorBitIndex(1).setEndBitIndex(1).setConfirmBitIndex(1));//乙黄药 暂用丁黄药搅拌槽
         }
     };
 

+ 22 - 3
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/WcsTaskSubService.java

@@ -25,6 +25,7 @@ import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -84,7 +85,13 @@ public class WcsTaskSubService {
         wcsTask.setAreaTo(baseLocationInfoTo.getZoneId().toString());
         wcsTask.setLocationTo(baseLocationInfoTo.getId().toString());
         wcsTask.setCreateDate(new Date());
-        wcsTask.setCreateUser("Wcs");
+        String username = null;
+        try {
+            username = SecurityUtils.getLoginUser().getUsername();
+        } catch (Exception e) {
+            username = "WCS";
+        }
+        wcsTask.setCreateUser(username);
         wcsTask.setShopId(Constant.WAREHOUSE_ID.toString());
         wcsTask.setPriority(10L);
         wcsTask.setExt1(asnNo);
@@ -123,7 +130,13 @@ public class WcsTaskSubService {
         wcsTask.setAreaTo(baseLocationInfoTo.getZoneId().toString());
         wcsTask.setLocationTo(baseLocationInfoTo.getId().toString());
         wcsTask.setCreateDate(new Date());
-        wcsTask.setCreateUser("Wcs");
+        String username = null;
+        try {
+            username = SecurityUtils.getLoginUser().getUsername();
+        } catch (Exception e) {
+            username = "WCS";
+        }
+        wcsTask.setCreateUser(username);
         wcsTask.setShopId(Constant.WAREHOUSE_ID.toString());
         wcsTask.setPriority(10L);
         wcsTask.setExt1(asnNo);
@@ -166,7 +179,13 @@ public class WcsTaskSubService {
         wcsTask.setTaskType(Constant.TASK_TYPE.FORWARD.getValue());
         wcsTask.setBusinessType("01");
         wcsTask.setCreateDate(new Date());
-        wcsTask.setCreateUser("Wcs");
+        String username = null;
+        try {
+            username = SecurityUtils.getLoginUser().getUsername();
+        } catch (Exception e) {
+            username = "WCS";
+        }
+        wcsTask.setCreateUser(username);
         wcsTask.setShopId(Constant.WAREHOUSE_ID.toString());
         wcsTask.setPriority(10L);
         wcsTask.setExt1(asnNo);

+ 1 - 0
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/WcsToWmsApiService.java

@@ -351,6 +351,7 @@ public class WcsToWmsApiService {
         wmsDocAsnHeader.setAsnType(Constant.ASN_TYP.HK.getValue());
         wmsDocAsnHeader.setCreateTime(new Date());
         wmsDocAsnHeader.setAsnStatus(Constant.ASN_STS.STS10.getValue());
+
         wmsDocAsnHeader.setCreateBy("Wms");
         wmsDocAsnHeaderMapper.insertWmsDocAsnHeader(wmsDocAsnHeader);
 

+ 1 - 1
warewms-ams/src/main/resources/mapper/ams/WcsTaskMapper.xml

@@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectWcsTaskListVO" parameterType="WcsTask" resultMap="WcsTaskResult">
         select t.task_no, t.business_type,bf.location_no location_from,fz.zone_name area_from,bt.location_no location_to,tz.zone_name area_to,
-        t.state,t.create_date,t.task_type, t.start_time, t.end_time,t.remark, t.ext1, t.ext2, t.ext3
+        t.state,t.create_user,t.create_date,t.task_type, t.start_time, t.end_time,t.remark, t.ext1, t.ext2, t.ext3
         from wcs_task t
         left join base_location_info bf on t.location_from = bf.id
         left join base_location_info bt on t.location_to = bt.id