Commit 207704233ae7f5ec557b6fc03d3add5937d3adb4

Authored by 易文鹏
1 parent af7d165b

feat:修复盘点入库回传仓库字段和用户编码对不上问题

src/main/java/com/huaheng/api/mes/controller/MesReceiptController.java
... ... @@ -693,7 +693,7 @@ public class MesReceiptController extends BaseController {
693 693  
694 694  
695 695 /**
696   - * post调用E_Rd_In(MOM)其他入库成功接口
  696 + * post调用E_Rd_In(MOM)其他入库成功接口(盘点入库回传)
697 697 */
698 698 //@ApiLogger(apiName = "post调用E_Rd_In(MOM)其他入库接口", from="ROBOT")
699 699 @PostMapping("/postOther_E_Rd_In")
... ... @@ -709,7 +709,7 @@ public class MesReceiptController extends BaseController {
709 709 receiptHeader1.setLastUpdatedBy(receiptHeader.getLastUpdatedBy());
710 710 receiptHeader1.setWarehouse(receiptHeader.getWarehouse());
711 711 receiptHeader1.setDepCode(QuantityConstant.DEFAULT_DEPT);
712   - receiptHeader1.setStock(QuantityConstant.DEFAULT_STOCK);
  712 + receiptHeader1.setStock(receiptHeader.getWarehouse());
713 713  
714 714 List<OtherReceiptDetail> list = new ArrayList<>();
715 715 for (ReceiptDetail receiptDetail : receiptDetails) {
... ... @@ -725,14 +725,28 @@ public class MesReceiptController extends BaseController {
725 725 detail.setMaterialCode(receiptDetail.getMaterialCode());
726 726 detail.setTaskQty(receiptDetail.getTaskQty());
727 727 detail.setQty(receiptDetail.getQty());
728   - detail.setWarehouseCode(receiptDetail.getWarehouseCode());
  728 + detail.setWarehouseCode(receiptHeader.getWarehouse());
729 729 detail.setNotice(receiptDetail.getNoticeNo());
730 730 detail.setISUrgent(receiptDetail.getIsUrgent());
731 731 detail.setReceiptBarcode(receiptDetail.getReceiptBarcode());
732 732 detail.setWarehouse(receiptHeader.getWarehouse());
733 733 detail.setWarehouseName(receiptHeader.getWarehouseName());
734   - detail.setLastUpdatedBy(receiptDetail.getLastUpdatedBy());
735   - detail.setLastUpdatedByName(receiptDetail.getLastUpdatedByName());
  734 + String lastUpdatedBy = receiptDetail.getLastUpdatedBy();
  735 + if (StringUtils.isEmpty(lastUpdatedBy)) {
  736 + detail.setLastUpdatedBy("");
  737 + detail.setLastUpdatedByName("");
  738 + } else {
  739 + User user = userService.selectUserByEmail(lastUpdatedBy);
  740 + String loginName;
  741 + if (user == null) {
  742 + loginName = "";
  743 + } else {
  744 + loginName = user.getLoginName();
  745 + }
  746 + detail.setLastUpdatedBy(loginName);
  747 + detail.setLastUpdatedByName(lastUpdatedBy);
  748 + }
  749 +
736 750 detail.setProductionWorker(receiptHeader.getProductionWorker());
737 751 detail.setProductionWorkerName(receiptHeader.getProductionWorkerName());
738 752 list.add(detail);
... ...
src/main/resources/templates/config/warehouse/warehouse.html
... ... @@ -3,234 +3,239 @@
3 3 <meta charset="utf-8">
4 4 <head th:include="include :: header"></head>
5 5 <body class="gray-bg">
6   - <div class="container-div">
7   - <div class="row">
8   - <div class="col-sm-12 select-info">
9   - <form id="warehouse-form">
10   - <div class="select-list">
11   - <ul>
12   - <li>
13   - 仓库编码:<input type="text" name="code"/>
14   - </li>
15   - <li>
16   - 名称:<input type="text" name="name"/>
17   - </li>
18   - <li>
19   - <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
20   - <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('warehouse-form')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
21   - <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
22   - </li>
23   - </ul>
24   - </div>
25   - </form>
26   - </div>
27   - <div class="btn-group hidden-xs" id="toolbar" role="group">
28   - <a class="btn btn-outline btn-success btn-rounded" onclick="copy()" shiro:hasPermission="config:warehouse:copy">
29   - <i class="fa fa-files-o"></i>复制仓库</a>
30   - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:warehouse:add">
31   - <i class="fa fa-plus"></i> 新增
32   - </a>
33   - <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:warehouse:remove">
34   - <i class="fa fa-trash-o"></i> 删除
35   - </a>-->
36   - </div>
  6 +<div class="container-div">
  7 + <div class="row">
  8 + <div class="col-sm-12 select-info">
  9 + <form id="warehouse-form">
  10 + <div class="select-list">
  11 + <ul>
  12 + <li>
  13 + 仓库编码:<input type="text" name="code"/>
  14 + </li>
  15 + <li>
  16 + 名称:<input type="text" name="name"/>
  17 + </li>
  18 + <li>
  19 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
  20 + class="fa fa-search"></i>&nbsp;搜索</a>
  21 + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('warehouse-form')"><i
  22 + class="fa fa-refresh"></i>&nbsp;重置</a>
  23 + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
  24 + </li>
  25 + </ul>
  26 + </div>
  27 + </form>
  28 + </div>
  29 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  30 + <a class="btn btn-outline btn-success btn-rounded" onclick="copy()"
  31 + shiro:hasPermission="config:warehouse:copy">
  32 + <i class="fa fa-files-o"></i>复制仓库</a>
  33 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
  34 + shiro:hasPermission="config:warehouse:add">
  35 + <i class="fa fa-plus"></i> 新增
  36 + </a>
  37 + <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:warehouse:remove">
  38 + <i class="fa fa-trash-o"></i> 删除
  39 + </a>-->
  40 + </div>
37 41  
38   - <div class="col-sm-12 select-info">
39   - <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
40   - </div>
41   - </div>
  42 + <div class="col-sm-12 select-info">
  43 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  44 + </div>
42 45 </div>
43   - <div th:include="include :: footer"></div>
44   - <script th:inline="javascript">
45   - var editFlag = [[${@permission.hasPermi('config:warehouse:edit')}]];
46   - var removeFlag = [[${@permission.hasPermi('config:warehouse:remove')}]];
47   - var prefix = ctx + "config/warehouse";
48   - var datas = [[${@dict.getType('sys_normal_disable')}]];
49   - $(function() {
50   - var options = {
51   - url: prefix + "/list",
52   - createUrl: prefix + "/add",
53   - updateUrl: prefix + "/edit/{code}",
54   - removeUrl: prefix + "/remove",
55   - modalName: "仓库",
56   - search: false,
57   - columns: [{
58   - checkbox: true
59   - },
60   - // {
61   - // field : 'code',
62   - // title : '仓库编码'
63   - // },
64   - {
65   - field : 'userDef1',
66   - title : '仓库编码',
67   - visible:true
68   - },
69   - {
70   - field : 'name',
71   - title : '名称'
72   - },
73   - {
74   - field : 'orgCode',
75   - title : '公司编码',
76   - visible:false
77   - },
78   - {
79   - field : 'address1',
80   - title : '地址'
81   - },
82   - {
83   - field : 'address2',
84   - title : '地址2' ,
85   - visible:false
86   - },
87   - {
88   - field : 'city',
89   - title : '城市'
90   - },
91   - {
92   - field : 'state',
93   - title : '省份' ,
94   - visible:true
95   - },
96   - {
97   - field : 'district',
98   - title : '区/县' ,
99   - visible:true
100   - },
101   - {
102   - field : 'country',
103   - title : '国家' ,
104   - visible:false
105   - },
106   - {
107   - field : 'postalCode',
108   - title : '邮编' ,
109   - visible:true
110   - },
111   - {
112   - field : 'attentionTo',
113   - title : '联系人'
114   - },
115   - {
116   - field : 'phoneNum',
117   - title : '联系电话'
118   - },
119   - {
120   - field : 'faxNum',
121   - title : '传真号' ,
122   - visible:false
123   - },
124   - {
125   - field : 'email',
126   - title : '邮件地址' ,
127   - visible:true
128   - },
129   - {
130   - field : 'hostCode',
131   - title : '上位系统',
132   - visible:false
133   - },
134   - {
135   - field : 'created',
136   - title : '创建时间'
137   - },
138   - {
139   - field : 'createdBy',
140   - title : '创建用户'
141   - },
142   - {
143   - field : 'lastUpdated',
144   - title : '更新时间'
145   - },
146   - {
147   - field : 'lastUpdatedBy',
148   - title : '更新用户'
149   - },
150   - {
151   - field : 'enable',
152   - title : '是否有效' ,
  46 +</div>
  47 +<div th:include="include :: footer"></div>
  48 +<script th:inline="javascript">
  49 + var editFlag = [[${@permission.hasPermi('config:warehouse:edit')}]];
  50 + var removeFlag = [[${@permission.hasPermi('config:warehouse:remove')}]];
  51 + var prefix = ctx + "config/warehouse";
  52 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  53 + $(function () {
  54 + var options = {
  55 + url: prefix + "/list",
  56 + createUrl: prefix + "/add",
  57 + updateUrl: prefix + "/edit/{code}",
  58 + removeUrl: prefix + "/remove",
  59 + modalName: "仓库",
  60 + search: false,
  61 + columns: [{
  62 + checkbox: true
  63 + },
  64 + // {
  65 + // field : 'code',
  66 + // title : '仓库编码'
  67 + // },
  68 + {
  69 + field: 'userDef1',
  70 + title: '仓库编码',
  71 + visible: false
  72 + },
  73 + {
  74 + field: 'name',
  75 + title: '名称'
  76 + },
  77 + {
  78 + field: 'orgCode',
  79 + title: '公司编码',
  80 + visible: false
  81 + },
  82 + {
  83 + field: 'address1',
  84 + title: '地址'
  85 + },
  86 + {
  87 + field: 'address2',
  88 + title: '地址2',
  89 + visible: false
  90 + },
  91 + {
  92 + field: 'city',
  93 + title: '城市'
  94 + },
  95 + {
  96 + field: 'state',
  97 + title: '省份',
  98 + visible: true
  99 + },
  100 + {
  101 + field: 'district',
  102 + title: '区/县',
  103 + visible: true
  104 + },
  105 + {
  106 + field: 'country',
  107 + title: '国家',
  108 + visible: false
  109 + },
  110 + {
  111 + field: 'postalCode',
  112 + title: '邮编',
  113 + visible: true
  114 + },
  115 + {
  116 + field: 'attentionTo',
  117 + title: '联系人'
  118 + },
  119 + {
  120 + field: 'phoneNum',
  121 + title: '联系电话'
  122 + },
  123 + {
  124 + field: 'faxNum',
  125 + title: '传真号',
  126 + visible: false
  127 + },
  128 + {
  129 + field: 'email',
  130 + title: '邮件地址',
  131 + visible: true
  132 + },
  133 + {
  134 + field: 'hostCode',
  135 + title: '上位系统',
  136 + visible: false
  137 + },
  138 + {
  139 + field: 'created',
  140 + title: '创建时间'
  141 + },
  142 + {
  143 + field: 'createdBy',
  144 + title: '创建用户'
  145 + },
  146 + {
  147 + field: 'lastUpdated',
  148 + title: '更新时间'
  149 + },
  150 + {
  151 + field: 'lastUpdatedBy',
  152 + title: '更新用户'
  153 + },
  154 + {
  155 + field: 'enable',
  156 + title: '是否有效',
153 157 align: 'center',
154   - formatter: function(value, row, index) {
  158 + formatter: function (value, row, index) {
155 159 return $.table.selectDictLabel(datas, value);
156 160 }
157   - },
158   - // {
159   - // field : 'deleted',
160   - // title : '是否删除'
161   - // },
  161 + },
  162 + // {
  163 + // field : 'deleted',
  164 + // title : '是否删除'
  165 + // },
162 166  
163   - {
164   - field : 'userDef2',
165   - title : '自定义字段2' ,
166   - visible:false
167   - },
168   - {
169   - field : 'userDef3',
170   - title : '自定义字段3',
171   - visible:false
172   - },
173   - {
174   - field : 'userDef4',
175   - title : '自定义字段4',
176   - visible:false
177   - },
178   - {
179   - field : 'userDef5',
180   - title : '自定义字段5',
181   - visible:false
182   - },
183   - {
184   - field : 'userDef6',
185   - title : '自定义字段7',
186   - visible:false
187   - },
188   - {
189   - field : 'userDef7',
190   - title : '自定义字段7',
191   - visible:false
192   - },
193   - {
194   - field : 'userDef8',
195   - title : '自定义字段8',
196   - visible:false
197   - },
198   - {
199   - field : 'version',
200   - title : '数据版本',
201   - visible:false
202   - },
203   - {
204   - title: '操作',
205   - align: 'center',
206   - formatter: function(value, row, index) {
207   - var actions = [];
208   - actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick= edit(\''+row.code+'\')><i class="fa fa-edit"></i>编辑</a> ');
209   - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick=removes(\''+row.code+'\')><i class="fa fa-trash-o"></i>删除</a>');
210   - return actions.join('');
211   - }
212   - }]
213   - };
214   - $.table.init(options);
215   - });
  167 + {
  168 + field: 'userDef2',
  169 + title: '自定义字段2',
  170 + visible: false
  171 + },
  172 + {
  173 + field: 'userDef3',
  174 + title: '自定义字段3',
  175 + visible: false
  176 + },
  177 + {
  178 + field: 'userDef4',
  179 + title: '自定义字段4',
  180 + visible: false
  181 + },
  182 + {
  183 + field: 'userDef5',
  184 + title: '自定义字段5',
  185 + visible: false
  186 + },
  187 + {
  188 + field: 'userDef6',
  189 + title: '自定义字段7',
  190 + visible: false
  191 + },
  192 + {
  193 + field: 'userDef7',
  194 + title: '自定义字段7',
  195 + visible: false
  196 + },
  197 + {
  198 + field: 'userDef8',
  199 + title: '自定义字段8',
  200 + visible: false
  201 + },
  202 + {
  203 + field: 'version',
  204 + title: '数据版本',
  205 + visible: false
  206 + },
  207 + {
  208 + title: '操作',
  209 + align: 'center',
  210 + formatter: function (value, row, index) {
  211 + var actions = [];
  212 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick= edit(\'' + row.code + '\')><i class="fa fa-edit"></i>编辑</a> ');
  213 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick=removes(\'' + row.code + '\')><i class="fa fa-trash-o"></i>删除</a>');
  214 + return actions.join('');
  215 + }
  216 + }]
  217 + };
  218 + $.table.init(options);
  219 + });
216 220  
217   - function edit(code) {
218   - var url = prefix + "/edit/"+code;
219   - $.modal.open("修改" + table.options.modalName, url);
220   - }
  221 + function edit(code) {
  222 + var url = prefix + "/edit/" + code;
  223 + $.modal.open("修改" + table.options.modalName, url);
  224 + }
  225 +
  226 + // 删除信息
  227 + function removes(code) {
  228 + $.modal.confirm("确定删除该条" + table.options.modalName + "信息吗?", function () {
  229 + var url = $.common.isEmpty(code) ? table.options.removeUrl : table.options.removeUrl.replace("{code}", code);
  230 + var data = {"codes": code};
  231 + $.operate.submit(url, "post", "json", data);
  232 + });
  233 + }
221 234  
222   - // 删除信息
223   - function removes(code) {
224   - $.modal.confirm("确定删除该条" + table.options.modalName + "信息吗?", function() {
225   - var url = $.common.isEmpty(code) ? table.options.removeUrl : table.options.removeUrl.replace("{code}", code);
226   - var data = { "codes": code };
227   - $.operate.submit(url, "post", "json", data);
228   - });
229   - }
230   - function copy() {
231   - var url = prefix+"/copy";
232   - $.modal.open("复制仓库" + table.options.modalName, url);
233   - }
234   - </script>
  235 + function copy() {
  236 + var url = prefix + "/copy";
  237 + $.modal.open("复制仓库" + table.options.modalName, url);
  238 + }
  239 +</script>
235 240 </body>
236 241 </html>
... ...