Commit 165dcdf86736e0c9108b4979d8557d986c690106
Merge remote-tracking branch 'origin/develop' into develop
Showing
4 changed files
with
57 additions
and
107 deletions
src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
... | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | +import com.huaheng.common.support.Convert; | |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | 10 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
... | ... | @@ -99,34 +100,24 @@ public class adjustDetailController extends BaseController { |
99 | 100 | } |
100 | 101 | |
101 | 102 | /** |
102 | - * 只调整数量 | |
103 | - * 修改 | |
104 | - */ | |
105 | - @GetMapping("/adjustEdit") | |
106 | - public String editAdjust(Integer id, ModelMap mmap) | |
107 | - { | |
108 | - AdjustDetail adjustDetailEdit = adjustDetailService.getById(id); | |
109 | - mmap.put("adjustDetailEdit", adjustDetailEdit); | |
110 | - return prefix + "/adjustEdit"; | |
111 | - } | |
112 | - | |
113 | - /** | |
114 | - * 修改保存调整数量 | |
103 | + * 调整数量 | |
115 | 104 | */ |
116 | 105 | //@RequiresPermissions("inventory:cyclecountAdjustDetail:addAdjust") |
117 | 106 | @Log(title = "库存-调整单", operating = "调整单调整库存差异,调整数量", action = BusinessType.UPDATE) |
118 | - @PostMapping("/editAdjustSave") | |
107 | + @PostMapping("/adjustEdit") | |
119 | 108 | @ResponseBody |
120 | - public AjaxResult editAdjustSave(AdjustDetail adjustDetail) | |
109 | + public AjaxResult editAdjustSave(String ids) | |
121 | 110 | { |
122 | - //未上传不允许进行明细差异调整 | |
123 | -// CyclecountAdjust cyclecountAdjust = cycleconutAdjustService.selectEntityById(cyclecountAdjustDetail.getCyclecountAdjustId()); | |
124 | -// if(cyclecountAdjust.getStatus() != 30 ){ | |
125 | -// return AjaxResult.error("单据未上传,没有调整单下发,不允许差异调整!!"); | |
126 | -// //throw new ServiceException("单据未上传,没有调整单下发,不允许差异调整!"); | |
127 | -// } | |
128 | - AjaxResult result = adjustDetailService.updateAdjustDetail(adjustDetail); | |
129 | - return result; | |
111 | + if(ids == null){ | |
112 | + throw new SecurityException("ID不能为空!"); | |
113 | + } | |
114 | + Integer[] integers = Convert.toIntArray(ids); | |
115 | + for (Integer id : integers) | |
116 | + { | |
117 | + AdjustDetail adjustDetailEdit = adjustDetailService.getById(id); | |
118 | + adjustDetailService.updateAdjustDetail(adjustDetailEdit); | |
119 | + } | |
120 | + return AjaxResult.success("调整下发成功!"); | |
130 | 121 | } |
131 | 122 | |
132 | 123 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -237,6 +237,7 @@ public class CycleCountDetailController extends BaseController { |
237 | 237 | @PostMapping("/createCyclecountWithGapQty") |
238 | 238 | @ResponseBody |
239 | 239 | public AjaxResult createCyclecountWithGapQty(String cycleCountHeadCode){ |
240 | + | |
240 | 241 | return cycleCountDetailService.createCyclecountWithGapQty(cycleCountHeadCode); |
241 | 242 | } |
242 | 243 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
... | ... | @@ -415,6 +415,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
415 | 415 | cycleCountDetail.setCompanyCode(cycleCountHeader.getCompanyCode()); |
416 | 416 | LambdaQueryWrapper<CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
417 | 417 | List<CycleCountDetail> cycleCountDetails = this.list(cycleCountDetailLambdaQueryWrapper);//明细 |
418 | + if(cycleCountDetails.size() == 0){ | |
419 | + throw new SecurityException("没有明细!"); | |
420 | + } | |
418 | 421 | //生成复盘盘点主单 |
419 | 422 | cycleCountHeader.setCode(cycleCountHeaderService.createCode()); |
420 | 423 | cycleCountHeader.setRound(cycleCountHeader.getRound() + 1);//盘点轮次+1 |
... | ... | @@ -438,6 +441,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
438 | 441 | } |
439 | 442 | |
440 | 443 | } |
444 | + if(cycleCountDetailList.size() == 0){ | |
445 | + throw new SecurityException("该单据没有符合复盘条件的明细!"); | |
446 | + } | |
441 | 447 | if(!this.saveBatch(cycleCountDetailList)){ |
442 | 448 | throw new ServiceException("复盘明细子单生成失败"); |
443 | 449 | } |
... | ... |
src/main/resources/templates/inventory/adjustDetail/adjustDetail.html
... | ... | @@ -118,9 +118,6 @@ |
118 | 118 | var created; |
119 | 119 | |
120 | 120 | $(function () { |
121 | - update(); | |
122 | - }); | |
123 | - function update() { | |
124 | 121 | let adjustCode=null; |
125 | 122 | let options = { |
126 | 123 | url:prefix + "/list", |
... | ... | @@ -129,9 +126,12 @@ |
129 | 126 | sortOrder: "desc", |
130 | 127 | search: false, |
131 | 128 | showRefresh: true, |
129 | + onRefresh: function(){ | |
130 | + update(); | |
131 | + }, | |
132 | 132 | columns: [ |
133 | 133 | { |
134 | - radio: true | |
134 | + checkbox: true | |
135 | 135 | }, |
136 | 136 | /*{ |
137 | 137 | title: '调整操作', |
... | ... | @@ -351,44 +351,24 @@ |
351 | 351 | $.table.init(options); |
352 | 352 | } |
353 | 353 | |
354 | - /*$.ajax({ | |
355 | - url: prefix_head + "/getHeader", | |
356 | - type: "post", | |
357 | - data: { | |
358 | - id: $('#cyclecountAdjustId').val() | |
359 | - }, | |
360 | - success: function (value) { | |
361 | - if (value.data) { | |
362 | - $('#code').val(value.data.code); | |
363 | - // $('#type').val(value.data.typeLabel); | |
364 | - $('#status').val(value.data.statusLabel); | |
365 | - $('#created').val(value.data.created); | |
366 | - var text_val = $('#created').val(); | |
367 | - $('#created').val(text_val.replace("T", " ")); | |
368 | - //$('#createdBy').val(value.data.createdBy); | |
369 | - $('#lastUpdated').val(value.data.lastUpdated); | |
370 | - var text_val_t = $('#lastUpdated').val(); | |
371 | - $('#lastUpdated').val(text_val_t.replace("T", " ")); | |
372 | - //$('#lastUpdatedBy').val(value.data.lastUpdatedBy); | |
373 | - } | |
374 | - } | |
375 | - })*/ | |
376 | - } | |
377 | - | |
378 | - /**盘点差异调整*/ | |
379 | - function addAdjust() { | |
380 | - var row = $('#bootstrap-table').bootstrapTable('getSelections'); | |
354 | + }); | |
381 | 355 | |
382 | - $.modal.confirm("注意:该操作将更改库存,当实盘数量为0且库位上只剩空容器时,请手动执行空托出库任务,容器上有货则无需其他操作!", | |
383 | - function () { | |
384 | - /*判断是否已经调整过*/ | |
385 | - if (row[0].status == 2) { | |
386 | - $.modal.msg('该条明细已调整,请勿重复调整!') | |
387 | - } else { | |
388 | - $.modal.open("差异调整单", prefix + "/adjustEdit?id=" + row[0].id) | |
389 | - } | |
390 | 356 | |
391 | - }); | |
357 | + /* | |
358 | + *盘点差异调整 | |
359 | + * */ | |
360 | + function addAdjust() { | |
361 | + var rows = $.common.isEmpty($.table._option.id) ? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.id); | |
362 | + if (rows.length == 0) { | |
363 | + $.modal.alertWarning("请至少选择一条记录"); | |
364 | + return; | |
365 | + } | |
366 | + $.modal.confirm("注意:该操作将更改库存,当实盘数量为0且库位上只剩空容器时,请手动执行空托出库任务,容器上有货则无需其他操作!" | |
367 | + , function() { | |
368 | + var url = prefix + "/adjustEdit"; | |
369 | + var data = { "ids": rows.join() }; | |
370 | + postInner(url, data); | |
371 | + }); | |
392 | 372 | } |
393 | 373 | |
394 | 374 | // |
... | ... | @@ -422,51 +402,23 @@ |
422 | 402 | // shadeClose: true, //点击遮罩关闭层 |
423 | 403 | }) |
424 | 404 | } |
425 | - | |
426 | - /* | |
427 | - * 差异复盘 | |
428 | - */ | |
429 | - function createCyclecountWithGapQty() { | |
430 | - $.modal.confirm("确认进行差异复盘么?该操作会将有差异的明细重新生成一个新的盘点单。", function () { | |
431 | - var url = prefix + "/createCyclecountWithGapQty"; | |
432 | - var data = {"headId": $('#headId').val()}; | |
433 | - postInner(url, data); | |
434 | - }); | |
435 | - } | |
436 | - | |
437 | - /* //调整差异库存 | |
438 | - function adjust() { | |
439 | - $.modal.confirm("注意:该操作将更改库存,当实盘数量为0且库位上只剩空容器时,请手动执行空托出库任务,容器上有货则无需其他操作!", | |
440 | - function() { | |
441 | - var url = prefix + "/adjust"; | |
442 | - var data = { "headId": $('#headId').val() }; | |
443 | - postInner(url,data); | |
444 | - }); | |
445 | - } | |
446 | - function postInner(url,data) { | |
447 | - $.modal.loading("正在处理中,请稍后..."); | |
448 | - $.ajax({ | |
449 | - url:url, | |
450 | - type:"post", | |
451 | - data:data, | |
452 | - success:function (result) { | |
453 | - if (result.code == web_status.SUCCESS) { | |
454 | - $.modal.msgSuccess(result.msg); | |
455 | - update(); | |
456 | - } else { | |
457 | - $.modal.alertError(result.msg); | |
458 | - } | |
459 | - $.modal.closeLoading(); | |
405 | + function postInner(url,data) { | |
406 | + $.modal.loading("正在处理中,请稍后..."); | |
407 | + $.ajax({ | |
408 | + url:url, | |
409 | + type:"post", | |
410 | + data:data, | |
411 | + success:function (result) { | |
412 | + if (result.code == web_status.SUCCESS) { | |
413 | + $.modal.msgSuccess(result.msg); | |
414 | + update(); | |
415 | + } else { | |
416 | + $.modal.alertError(result.msg); | |
460 | 417 | } |
461 | - }) | |
462 | - }*/ | |
463 | - | |
464 | - /* //下发单条盘点 | |
465 | - function outcheck(id) { | |
466 | - var url = prefix + "/createCyccoutTaskByDetailId"; | |
467 | - var data = { "detailId": id }; | |
468 | - postInner(url,data); | |
469 | - }*/ | |
418 | + $.modal.closeLoading(); | |
419 | + } | |
420 | + }) | |
421 | + } | |
470 | 422 | |
471 | 423 | |
472 | 424 | </script> |
... | ... |