Browse Source

Merge remote-tracking branch 'origin/master'

master
yunuo970428 1 week ago
parent
commit
ad4e274a54
  1. 1
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/index/AppIndexEnum.java
  2. 8
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/index/AppIndexService.java
  3. 26
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/fegin/wms/WmsInventoryCheckbillFeign.java
  4. 2
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/wms/inventorycheckbill/WmsInventoryCheckbillService.java
  5. 184
      yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryAllocatebillRest.java
  6. 13
      yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillDetailRest.java
  7. 13
      yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillReportRest.java
  8. 8
      yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillRest.java
  9. 2
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventory/WmsInventoryMapper.xml
  10. 26
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventory/WmsInventoryService.java
  11. 35
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillMapper.java
  12. 569
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillMapper.xml
  13. 23
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillService.java
  14. 20
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.java
  15. 306
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.xml

1
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/index/AppIndexEnum.java

@ -57,6 +57,7 @@ public class AppIndexEnum {
WXWB("c3a6be91-3e95-4520-b5a7-c805d8f187d7", "维修完毕"), WXWB("c3a6be91-3e95-4520-b5a7-c805d8f187d7", "维修完毕"),
SPSJ("781ce38b-b003-4efd-accf-fbee0ca33091", "商品上架"), SPSJ("781ce38b-b003-4efd-accf-fbee0ca33091", "商品上架"),
PJJS("37905444-5454-4b08-897d-6c2c089c317d", "配件接收"), PJJS("37905444-5454-4b08-897d-6c2c089c317d", "配件接收"),
SPPD("a16641b1-e34e-4c80-9163-7eed9893c3c5", "商品盘点"),
; ;
/** /**

8
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/index/AppIndexService.java

@ -19,6 +19,7 @@ import com.yxt.anrui.portal.biz.sysuser.SysUserService;
import com.yxt.anrui.portal.biz.sysuserrole.SysUserRoleService; import com.yxt.anrui.portal.biz.sysuserrole.SysUserRoleService;
import com.yxt.anrui.portal.fegin.as.AsBusrepairBillFeign; import com.yxt.anrui.portal.fegin.as.AsBusrepairBillFeign;
import com.yxt.anrui.portal.fegin.as.AsToDoNumQuery; import com.yxt.anrui.portal.fegin.as.AsToDoNumQuery;
import com.yxt.anrui.portal.fegin.wms.WmsInventoryCheckbillFeign;
import com.yxt.anrui.portal.fegin.wms.WmsShelfBillFeign; import com.yxt.anrui.portal.fegin.wms.WmsShelfBillFeign;
import com.yxt.anrui.portal.fegin.wms.WmsToDoNumQuery; import com.yxt.anrui.portal.fegin.wms.WmsToDoNumQuery;
import com.yxt.anrui.riskcenter.api.loanfileexamine.LoanFileexamineFeign; import com.yxt.anrui.riskcenter.api.loanfileexamine.LoanFileexamineFeign;
@ -81,6 +82,8 @@ public class AppIndexService {
@Resource @Resource
private WmsShelfBillFeign wmsShelfBillFeign; private WmsShelfBillFeign wmsShelfBillFeign;
@Resource @Resource
private WmsInventoryCheckbillFeign wmsInventoryCheckbillFeign;
@Resource
private AsBusrepairBillFeign asBusrepairBillFeign; private AsBusrepairBillFeign asBusrepairBillFeign;
public ResultBean<List<AppIndexNewVo>> getBusinessList(String userSid, String appSid, String orgPath) { public ResultBean<List<AppIndexNewVo>> getBusinessList(String userSid, String appSid, String orgPath) {
@ -250,6 +253,11 @@ public class AppIndexService {
String num = asBusrepairBillFeign.getToDoNum2(asToDoNumQuery).getData(); String num = asBusrepairBillFeign.getToDoNum2(asToDoNumQuery).getData();
appIndexNumVo.setNum(num); appIndexNumVo.setNum(num);
} }
//商品盘点
if (AppIndexEnum.AppMenu.SPPD.getRemarks().equals(menu.getTitle())) {
String num = wmsInventoryCheckbillFeign.getToDoNum(wmsToDoNumQuery).getData();
appIndexNumVo.setNum(num);
}
list.add(appIndexNumVo); list.add(appIndexNumVo);
} }
} }

26
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/fegin/wms/WmsInventoryCheckbillFeign.java

@ -0,0 +1,26 @@
package com.yxt.anrui.portal.fegin.wms;
import com.yxt.common.core.result.ResultBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @description: 商品盘点
* @author: fzz
* @date: 2024/3/7
**/
@FeignClient(
contextId = "yxt-wms-WmsInventoryCheckbill",
name = "yxt-wms",
path = "v1/wmsinventorycheckbill"
)
public interface WmsInventoryCheckbillFeign {
@ApiOperation("手机端-查询本分公司下代办数量:切换机构")
@GetMapping("/getToDoNum")
@ResponseBody
ResultBean<String> getToDoNum(@SpringQueryMap WmsToDoNumQuery wmsToDoNumQuery);
}

2
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/wms/inventorycheckbill/WmsInventoryCheckbillService.java

@ -94,6 +94,8 @@ public class WmsInventoryCheckbillService {
if (record.getLossCount() != null){ if (record.getLossCount() != null){
wmsInventoryCheckbillGoodsPageVo.setPanSun(record.getLossCount().toString()); wmsInventoryCheckbillGoodsPageVo.setPanSun(record.getLossCount().toString());
handleBean.setBadNum(record.getLossCount().toString()); handleBean.setBadNum(record.getLossCount().toString());
}else {
handleBean.setBadNum("0");
} }
List<WmsInventoryCheckbillDetailFile> fileList = record.getFileList(); List<WmsInventoryCheckbillDetailFile> fileList = record.getFileList();
List<String> files = new ArrayList<>(); List<String> files = new ArrayList<>();

184
yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryAllocatebillRest.java

@ -46,99 +46,99 @@ import java.util.List;
@RequestMapping("/apiadmin/inventory/wmsinventoryallocatebill") @RequestMapping("/apiadmin/inventory/wmsinventoryallocatebill")
public class WmsInventoryAllocatebillRest { public class WmsInventoryAllocatebillRest {
@Autowired @Autowired
private WmsInventoryAllocateBillService wmsInventoryAllocateBillService; private WmsInventoryAllocateBillService wmsInventoryAllocateBillService;
@ApiOperation("根据条件分页查询数据的列表") @ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage") @PostMapping("/listPage")
public ResultBean<PagerVo<WmsInventoryAllocateBillVoNew>> listPage(@RequestBody PagerQuery<WmsInventoryAllocateBillQueryNew> pq){ public ResultBean<PagerVo<WmsInventoryAllocateBillVoNew>> listPage(@RequestBody PagerQuery<WmsInventoryAllocateBillQueryNew> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryAllocateBillVoNew> pv = wmsInventoryAllocateBillService.listPageVo(pq); PagerVo<WmsInventoryAllocateBillVoNew> pv = wmsInventoryAllocateBillService.listPageVo(pq);
return rb.success().setData(pv); return rb.success().setData(pv);
} }
@ApiOperation("新增或修改") @ApiOperation("新增或修改")
@PostMapping("/save") @PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryAllocateBillDtoNew dto){ public ResultBean save(@RequestBody WmsInventoryAllocateBillDtoNew dto) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
wmsInventoryAllocateBillService.saveOrUpdateDto(dto); wmsInventoryAllocateBillService.saveOrUpdateDto(dto);
return rb.success(); return rb.success();
} }
@ApiOperation("根据sid批量删除") @ApiOperation("根据sid批量删除")
@DeleteMapping("/delBySids") @DeleteMapping("/delBySids")
public ResultBean delBySids(@RequestBody String[] sids){ public ResultBean delBySids(@RequestBody String[] sids) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
wmsInventoryAllocateBillService.delAll(sids); wmsInventoryAllocateBillService.delAll(sids);
return rb.success(); return rb.success();
} }
@ApiOperation("根据SID获取一条记录") @ApiOperation("根据SID获取一条记录")
@GetMapping("/fetchDetailsBySid/{sid}") @GetMapping("/fetchDetailsBySid/{sid}")
public ResultBean<WmsInventoryAllocateBillDetailsVoNew> fetchDetailsBySid(@PathVariable("sid") String sid){ public ResultBean<WmsInventoryAllocateBillDetailsVoNew> fetchDetailsBySid(@PathVariable("sid") String sid) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
WmsInventoryAllocateBillDetailsVoNew vo = wmsInventoryAllocateBillService.fetchDetailsVoBySid(sid); WmsInventoryAllocateBillDetailsVoNew vo = wmsInventoryAllocateBillService.fetchDetailsVoBySid(sid);
return rb.success().setData(vo); return rb.success().setData(vo);
} }
/*********************************************************流程************************************************************/ /*********************************************************流程************************************************************/
@ApiOperation("提交") @ApiOperation("提交")
@PostMapping("/submitApply") @PostMapping("/submitApply")
public ResultBean submitApply(@Valid @RequestBody SubmitFlowDto dto) { public ResultBean submitApply(@Valid @RequestBody SubmitFlowDto dto) {
return wmsInventoryAllocateBillService.submitApply(dto); return wmsInventoryAllocateBillService.submitApply(dto);
} }
@ApiOperation(value = "办理(同意)") @ApiOperation(value = "办理(同意)")
@PostMapping("/complete") @PostMapping("/complete")
public ResultBean complete(@Valid @RequestBody CompleteFlowDto query) { public ResultBean complete(@Valid @RequestBody CompleteFlowDto query) {
BusinessVariables bv = new BusinessVariables(); BusinessVariables bv = new BusinessVariables();
BeanUtil.copyProperties(query, bv); BeanUtil.copyProperties(query, bv);
bv.setModelId(""); bv.setModelId("");
return wmsInventoryAllocateBillService.complete(bv); return wmsInventoryAllocateBillService.complete(bv);
} }
@ApiOperation(value = "获取上一个环节") @ApiOperation(value = "获取上一个环节")
@GetMapping(value = "/getPreviousNodesForReject") @GetMapping(value = "/getPreviousNodesForReject")
ResultBean<List<FlowNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap FlowNodeQuery query) { ResultBean<List<FlowNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap FlowNodeQuery query) {
return wmsInventoryAllocateBillService.getPreviousNodesForReject(query); return wmsInventoryAllocateBillService.getPreviousNodesForReject(query);
} }
@ApiOperation(value = "获取下一个环节") @ApiOperation(value = "获取下一个环节")
@GetMapping(value = "/getNextNodesForSubmit") @GetMapping(value = "/getNextNodesForSubmit")
ResultBean<List<FlowNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap FlowNodeQuery query) { ResultBean<List<FlowNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap FlowNodeQuery query) {
return wmsInventoryAllocateBillService.getNextNodesForSubmit(query); return wmsInventoryAllocateBillService.getNextNodesForSubmit(query);
} }
@ApiOperation(value = "驳回任务") @ApiOperation(value = "驳回任务")
@PostMapping(value = "/reject") @PostMapping(value = "/reject")
public ResultBean taskReject(@Valid @RequestBody FlowTaskQuery query) { public ResultBean taskReject(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.taskReject(query); return wmsInventoryAllocateBillService.taskReject(query);
} }
@ApiOperation(value = "撤回流程") @ApiOperation(value = "撤回流程")
@PostMapping(value = "/revokeProcess") @PostMapping(value = "/revokeProcess")
public ResultBean revokeProcess(@Valid @RequestBody FlowTaskQuery query) { public ResultBean revokeProcess(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.revokeProcess(query); return wmsInventoryAllocateBillService.revokeProcess(query);
} }
@ApiOperation(value = "终止任务") @ApiOperation(value = "终止任务")
@PostMapping(value = "/breakProcess") @PostMapping(value = "/breakProcess")
public ResultBean breakProcess(@Valid @RequestBody FlowTaskQuery query) { public ResultBean breakProcess(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.breakProcess(query); return wmsInventoryAllocateBillService.breakProcess(query);
} }
@ApiOperation(value = "加签") @ApiOperation(value = "加签")
@PostMapping(value = "/delegate") @PostMapping(value = "/delegate")
@ResponseBody @ResponseBody
public ResultBean delegate(@RequestBody FlowDelegateQuery query) { public ResultBean delegate(@RequestBody FlowDelegateQuery query) {
return wmsInventoryAllocateBillService.delegate(query); return wmsInventoryAllocateBillService.delegate(query);
} }
@ApiOperation(value = "转办") @ApiOperation(value = "转办")
@PostMapping(value = "/assignTask") @PostMapping(value = "/assignTask")
@ResponseBody @ResponseBody
public ResultBean assignTask(@RequestBody FlowDelegateQuery query){ public ResultBean assignTask(@RequestBody FlowDelegateQuery query) {
return wmsInventoryAllocateBillService.assignTask(query); return wmsInventoryAllocateBillService.assignTask(query);
} }
} }

13
yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillDetailRest.java

@ -28,19 +28,6 @@ package com.yxt.wms.apiadmin.inventroy;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/**
* Project: yxt-wms(仓储) <br/>
* File: WmsInventoryCheckbillDetailFeignFallback.java <br/>
* Class: com.yxt.wms.biz.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRest <br/>
* Description: 库存盘点-明细. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2024-03-22 09:25:02 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Api(tags = "库存盘点-明细") @Api(tags = "库存盘点-明细")
@RestController @RestController
@RequestMapping("v1/wmsinventorycheckbilldetail") @RequestMapping("v1/wmsinventorycheckbilldetail")

13
yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillReportRest.java

@ -28,19 +28,6 @@ package com.yxt.wms.apiadmin.inventroy;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/**
* Project: yxt-wms(盘点报告) <br/>
* File: WmsInventoryCheckbillReportFeignFallback.java <br/>
* Class: com.yxt.wms.biz.wmsinventorycheckbillreport.WmsInventoryCheckbillReportRest <br/>
* Description: 盘点报告. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2024-07-19 09:52:51 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Api(tags = "盘点报告") @Api(tags = "盘点报告")
@RestController @RestController
@RequestMapping("v1/wmsinventorycheckbillreport") @RequestMapping("v1/wmsinventorycheckbillreport")

8
yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillRest.java

@ -34,6 +34,7 @@ import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.*; import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.*; import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportDetailsVo; import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportDetailsVo;
import com.yxt.wms.biz.inventory.wmsshelfbill.WmsToDoNumQuery;
import com.yxt.wms.feign.flowable.flow.BusinessVariables; import com.yxt.wms.feign.flowable.flow.BusinessVariables;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -159,6 +160,13 @@ public class WmsInventoryCheckbillRest {
return wmsInventoryCheckbillService.scan(sid, content, houseSid); return wmsInventoryCheckbillService.scan(sid, content, houseSid);
} }
@ApiOperation("手机端-查询本分公司下代办数量:切换机构")
@GetMapping("/getToDoNum")
@ResponseBody
ResultBean<String> getToDoNum(@SpringQueryMap WmsToDoNumQuery wmsToDoNumQuery) {
return wmsInventoryCheckbillService.getToDoNum(wmsToDoNumQuery);
}
/*********************************************************流程************************************************************/ /*********************************************************流程************************************************************/
@ApiOperation("提交") @ApiOperation("提交")

2
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventory/WmsInventoryMapper.xml

@ -297,6 +297,8 @@
ON wr.locationSid = wa.sid ON wr.locationSid = wa.sid
LEFT JOIN wms_warehouse_zone wz LEFT JOIN wms_warehouse_zone wz
ON wz.warehouseSid = wi.warehouseSid ON wz.warehouseSid = wi.warehouseSid
LEFT JOIN wms_warehouse_info wwi
ON wwi.sid = wi.warehouseSid
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>

26
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventory/WmsInventoryService.java

@ -136,7 +136,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
if (StringUtils.isNotBlank(query.getType())) { if (StringUtils.isNotBlank(query.getType())) {
qw.eq("i.warehouseTypeValue", query.getType()); qw.eq("i.warehouseTypeValue", query.getType());
} }
qw.notLike("a.goodsID","-O"); qw.notLike("a.goodsID", "-O");
IPage<WmsInventory> page = PagerUtil.queryToPage(pq); IPage<WmsInventory> page = PagerUtil.queryToPage(pq);
IPage<WmsInventoryVo> pagging = baseMapper.listPage(page, qw); IPage<WmsInventoryVo> pagging = baseMapper.listPage(page, qw);
PagerVo<WmsInventoryVo> p = PagerUtil.pageToVo(pagging, null); PagerVo<WmsInventoryVo> p = PagerUtil.pageToVo(pagging, null);
@ -213,7 +213,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
if (StringUtils.isNotBlank(query.getType())) { if (StringUtils.isNotBlank(query.getType())) {
qw.eq("i.warehouseTypeValue", query.getType()); qw.eq("i.warehouseTypeValue", query.getType());
} }
qw.notLike("a.goodsID","-O"); qw.notLike("a.goodsID", "-O");
List<WmsInventoryVoExcelVo> list = baseMapper.listExcel(qw); List<WmsInventoryVoExcelVo> list = baseMapper.listExcel(qw);
list.removeAll(Collections.singleton(null)); list.removeAll(Collections.singleton(null));
return list; return list;
@ -574,6 +574,8 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
WmsInventoryAlloSelectQuery query = pq.getParams(); WmsInventoryAlloSelectQuery query = pq.getParams();
QueryWrapper<WmsInventory> qw = new QueryWrapper<>(); QueryWrapper<WmsInventory> qw = new QueryWrapper<>();
qw.eq("wi.useOrgSid", query.getDeptSid()); qw.eq("wi.useOrgSid", query.getDeptSid());
qw.eq("wwi.warehouseTypeKey", "01");
qw.gt("wi.count", 0);
if (StringUtils.isNotBlank(query.getGoodsID())) { if (StringUtils.isNotBlank(query.getGoodsID())) {
qw.like("wi.goodsID", query.getGoodsID()); qw.like("wi.goodsID", query.getGoodsID());
} }
@ -947,8 +949,8 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
.or().like("a.warehouseRackCode", query.getName()) .or().like("a.warehouseRackCode", query.getName())
); );
} }
qw.notLike("a.goodsID","-O"); qw.notLike("a.goodsID", "-O");
qw.eq("a.warehouseTypeValue","配件库"); qw.eq("a.warehouseTypeValue", "配件库");
IPage<WmsInventory> page = PagerUtil.queryToPage(pq); IPage<WmsInventory> page = PagerUtil.queryToPage(pq);
IPage<FittingsInventoryVo> pagging = baseMapper.fittingsInventory(page, qw); IPage<FittingsInventoryVo> pagging = baseMapper.fittingsInventory(page, qw);
PagerVo<FittingsInventoryVo> p = PagerUtil.pageToVo(pagging, null); PagerVo<FittingsInventoryVo> p = PagerUtil.pageToVo(pagging, null);
@ -1007,8 +1009,8 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
.or().like("z.zoneName", query.getName()) .or().like("z.zoneName", query.getName())
); );
} }
qw.notLike("i.goodsID","-O"); qw.notLike("i.goodsID", "-O");
qw.eq("wi.warehouseTypeValue","配件库"); qw.eq("wi.warehouseTypeValue", "配件库");
List<StorageListVo> listVos = baseMapper.appStorage(qw); List<StorageListVo> listVos = baseMapper.appStorage(qw);
Map<String, List<StorageListVo>> stringListMap = listVos.stream().collect(Collectors.groupingBy(StorageListVo::getTitle)); Map<String, List<StorageListVo>> stringListMap = listVos.stream().collect(Collectors.groupingBy(StorageListVo::getTitle));
List<StorageVo> records = new ArrayList<>(); List<StorageVo> records = new ArrayList<>();
@ -1374,7 +1376,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
return p; return p;
} }
public List<FormCommon> oaInventoryList(String orgPath, String warehouseTypeValue,String name) { public List<FormCommon> oaInventoryList(String orgPath, String warehouseTypeValue, String name) {
List<FormCommon> list = new ArrayList<>(); List<FormCommon> list = new ArrayList<>();
String useOrgSid = ""; String useOrgSid = "";
if (StringUtils.isNotBlank(orgPath)) { if (StringUtils.isNotBlank(orgPath)) {
@ -1388,7 +1390,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
useOrgSid = sysOrganization.getSid(); useOrgSid = sysOrganization.getSid();
} }
} }
List<WmsInventory> inventories = baseMapper.selOaInventoryList(useOrgSid, warehouseTypeValue,name); List<WmsInventory> inventories = baseMapper.selOaInventoryList(useOrgSid, warehouseTypeValue, name);
if (!inventories.isEmpty()) { if (!inventories.isEmpty()) {
for (WmsInventory d : inventories) { for (WmsInventory d : inventories) {
FormCommon f = new FormCommon(); FormCommon f = new FormCommon();
@ -1402,7 +1404,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
} }
if (StringUtils.isNotBlank(d.getGoodsSkuCode())) { if (StringUtils.isNotBlank(d.getGoodsSkuCode())) {
extra.put("goodsSkuCode", d.getGoodsSkuCode()); extra.put("goodsSkuCode", d.getGoodsSkuCode());
} else { } else {
extra.put("goodsSkuCode", ""); extra.put("goodsSkuCode", "");
} }
if (null != d.getCount()) { if (null != d.getCount()) {
@ -1482,11 +1484,11 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
wmsInventorySaveDto.setWarehouseRackSid(houseInfoVo.getWarehouseRackSid()); wmsInventorySaveDto.setWarehouseRackSid(houseInfoVo.getWarehouseRackSid());
wmsInventorySaveDto.setWarehouseRackCode(houseInfoVo.getWarehouseRackCode()); wmsInventorySaveDto.setWarehouseRackCode(houseInfoVo.getWarehouseRackCode());
saveWmsInventory(wmsInventorySaveDto); saveWmsInventory(wmsInventorySaveDto);
if (new BigDecimal(wmsStoreChangeDto.getCount()).compareTo(new BigDecimal(wmsStoreChangeDto.getMaxCount())) == 0){ if (new BigDecimal(wmsStoreChangeDto.getCount()).compareTo(new BigDecimal(wmsStoreChangeDto.getMaxCount())) == 0) {
deleteBySid(sid); deleteBySid(sid);
}else { } else {
BigDecimal count = new BigDecimal(wmsStoreChangeDto.getMaxCount()).subtract(new BigDecimal(wmsStoreChangeDto.getCount())); BigDecimal count = new BigDecimal(wmsStoreChangeDto.getMaxCount()).subtract(new BigDecimal(wmsStoreChangeDto.getCount()));
baseMapper.updateCount(sid,count.toString()); baseMapper.updateCount(sid, count.toString());
} }
} }
return rb.success(); return rb.success();

35
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillMapper.java

@ -43,44 +43,33 @@ import org.apache.ibatis.annotations.Update;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* Project: yxt-wms(仓储) <br/>
* File: WmsInventoryCheckbillMapper.java <br/>
* Class: com.yxt.wms.biz.wmsinventorycheckbill.WmsInventoryCheckbillMapper <br/>
* Description: 库存盘点. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2024-03-22 09:25:02 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper @Mapper
public interface WmsInventoryCheckbillMapper extends BaseMapper<WmsInventoryCheckbill> { public interface WmsInventoryCheckbillMapper extends BaseMapper<WmsInventoryCheckbill> {
IPage<WmsInventoryCheckbillVo> selectPageVo(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) Wrapper<WmsInventoryCheckbill> qw); IPage<WmsInventoryCheckbillVo> selectPageVo(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) Wrapper<WmsInventoryCheckbill> qw);
IPage<WmsInventoryCheckbillDetailRackPageListVo> detailRackPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) Wrapper<WmsInventoryCheckbill> qw); IPage<WmsInventoryCheckbillDetailRackPageListVo> detailRackPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) Wrapper<WmsInventoryCheckbill> qw);
IPage<WmsInventoryCheckbillDetailGoodPageListVo> detailGoodPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) Wrapper<WmsInventoryCheckbill> qw); IPage<WmsInventoryCheckbillDetailGoodPageListVo> detailGoodPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) Wrapper<WmsInventoryCheckbill> qw);
IPage<WmsInventoryCheckbillDetailRackGoodPageListVo> detailRackGoodPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) QueryWrapper<WmsInventoryCheckbill> qw); IPage<WmsInventoryCheckbillDetailRackGoodPageListVo> detailRackGoodPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) QueryWrapper<WmsInventoryCheckbill> qw);
String selectNum(String billNo); String selectNum(String billNo);
int selectBySid(String join); int selectBySid(String join);
@Update("update wms_inventory_checkbill set state = 0,checkState = 2 where sid = #{sid}") @Update("update wms_inventory_checkbill set state = 0,checkState = 2 where sid = #{sid}")
void createReport(String sid); void createReport(String sid);
String checkState(@Param("deptSid") String deptSid,@Param("warehouseTypeKey") String warehouseTypeKey); String checkState(@Param("deptSid") String deptSid, @Param("warehouseTypeKey") String warehouseTypeKey);
int updateFlowFiled(Map<String, Object> beanToMap); int updateFlowFiled(Map<String, Object> beanToMap);
IPage<WmsInventoryCheckbillPageVo> appDetailRackPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) QueryWrapper<WmsInventoryCheckbill> qw); IPage<WmsInventoryCheckbillPageVo> appDetailRackPageList(IPage<WmsInventoryCheckbill> page, @Param(Constants.WRAPPER) QueryWrapper<WmsInventoryCheckbill> qw);
List<InventoryBillVo> selPyByDeptSid(@Param("deptSid") String deptSid,@Param("warehouseTypeKey") String warehouseTypeKey); List<InventoryBillVo> selPyByDeptSid(@Param("deptSid") String deptSid, @Param("warehouseTypeKey") String warehouseTypeKey);
List<InventoryBillVo> selPkByDeptSid(@Param("deptSid") String deptSid,@Param("warehouseTypeKey") String warehouseTypeKey); List<InventoryBillVo> selPkByDeptSid(@Param("deptSid") String deptSid, @Param("warehouseTypeKey") String warehouseTypeKey);
int getToDoNum(String userSid);
} }

569
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillMapper.xml

@ -1,285 +1,322 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillMapper"> <mapper namespace="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillMapper">
<!-- <where> ${ew.sqlSegment} </where>--> <!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} --> <!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo"> <select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo">
SELECT SELECT
wic.sid, wic.sid,
wic.state, wic.state,
wic.`remarks`, wic.remarks,
wic.`nodeState`, wic.nodeState,
wic.`deptName`, wic.deptName,
wic.`billNo`, wic.billNo,
wic.`createTime`, wic.createTime,
wic.`createByName`, wic.createByName,
wic.`superviseName`, wic.superviseName,
IF( IF(
wic.`checkState` = '1', wic.checkState = '1',
'盘点中', '盘点中',
'盘点完成' '盘点完成'
) AS checkState, ) AS checkState,
wic.`procDefId`, wic.procDefId,
wic.`procInstId`, wic.procInstId,
SUM(wicd.bookCount) AS bookCount, SUM(wicd.bookCount) AS bookCount,
SUM(wicd.bookCount * cost) AS bookAmount, SUM(wicd.bookCount * cost) AS bookAmount,
SUM(wicd.realCount) AS realCount, SUM(wicd.realCount) AS realCount,
SUM(wicd.realCount * cost) AS realAmount, SUM(wicd.realCount * cost) AS realAmount,
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount, SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount,
( (
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost) SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost)
) AS notAmount, ) AS notAmount,
SUM(wicd.profitCount) AS profitCount, SUM(wicd.profitCount) AS profitCount,
SUM(wicd.profitCount * cost) AS profitAmount, SUM(wicd.profitCount * cost) AS profitAmount,
SUM(wicd.loseCount) AS loseCount, SUM(wicd.loseCount) AS loseCount,
SUM(wicd.loseCount * cost) AS loseAmount, SUM(wicd.loseCount * cost) AS loseAmount,
SUM(wicd.lossCount) AS lossCount, SUM(wicd.lossCount) AS lossCount,
SUM(wicd.lossCount * cost) AS lossAmount SUM(wicd.lossCount * cost) AS lossAmount
FROM FROM
wms_inventory_checkbill wic wms_inventory_checkbill wic
LEFT JOIN wms_inventory_checkbill_detail wicd LEFT JOIN wms_inventory_checkbill_detail wicd
ON wic.sid = wicd.`billSid` ON wic.sid = wicd.billSid
LEFT JOIN anrui_portal.sys_organization AS s LEFT JOIN anrui_portal.sys_organization AS s
ON wic.deptSid = s.sid ON wic.deptSid = s.sid
<where> ${ew.sqlSegment} </where> <where>
</select> ${ew.sqlSegment}
</where>
</select>
<select id="detailRackPageList" <select id="detailRackPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo">
SELECT SELECT
billSid, billSid,
warehouseName, warehouseName,
warehouseArea, warehouseArea,
warehouseRackSid, warehouseRackSid,
warehouseRackName, warehouseRackName,
SUM(bookCount) AS bookCount, SUM(bookCount) AS bookCount,
SUM(bookCount * cost) AS bookAmount, SUM(bookCount * cost) AS bookAmount,
SUM(realCount) AS realCount, SUM(realCount) AS realCount,
SUM(realCount * cost) AS realAmount, SUM(realCount * cost) AS realAmount,
SUM(bookCount) - SUM(realCount) AS notCount, SUM(bookCount) - SUM(realCount) AS notCount,
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount, (SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount,
SUM(profitCount) AS profitCount, SUM(profitCount) AS profitCount,
SUM(profitCount * cost) AS profitAmount, SUM(profitCount * cost) AS profitAmount,
SUM(loseCount) AS loseCount, SUM(loseCount) AS loseCount,
SUM(loseCount * cost) AS loseAmount, SUM(loseCount * cost) AS loseAmount,
SUM(lossCount) AS lossCount, SUM(lossCount) AS lossCount,
SUM(lossCount * cost) AS lossAmount SUM(lossCount * cost) AS lossAmount
FROM FROM
wms_inventory_checkbill_detail wms_inventory_checkbill_detail
<where> ${ew.sqlSegment} </where> <where>
</select> ${ew.sqlSegment}
</where>
</select>
<select id="detailGoodPageList" <select id="detailGoodPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo">
SELECT SELECT
goodsID, goodsID,
goodsSkuTitle, goodsSkuTitle,
goodsSkuCode, goodsSkuCode,
warehouseName, warehouseName,
warehouseArea, warehouseArea,
warehouseRackName, warehouseRackName,
unit, unit,
cost, cost,
bookCount, bookCount,
bookCount * cost AS bookAmount, bookCount * cost AS bookAmount,
realCount, realCount,
realCount * cost AS realAmount, realCount * cost AS realAmount,
CASE CASE
state state
WHEN 2 WHEN 2
THEN '正常' THEN '正常'
WHEN 3 WHEN 3
THEN '盘盈' THEN '盘盈'
WHEN 4 WHEN 4
THEN '盘亏' THEN '盘亏'
END AS state, END AS state,
CASE CASE
state state
WHEN 2 WHEN 2
THEN 0 THEN 0
WHEN 3 WHEN 3
THEN profitCount THEN profitCount
WHEN 4 WHEN 4
THEN loseCount THEN loseCount
END AS profitAndLoseCount, END AS profitAndLoseCount,
CASE CASE
state state
WHEN 2 WHEN 2
THEN 0 THEN 0
WHEN 3 WHEN 3
THEN profitCount * cost THEN profitCount * cost
WHEN 4 WHEN 4
THEN loseCount * cost THEN loseCount * cost
END AS profitAndLoseAmount, END AS profitAndLoseAmount,
lossCount, lossCount,
lossCount * cost AS lossAmount, lossCount * cost AS lossAmount,
remarks remarks
FROM FROM
wms_inventory_checkbill_detail wms_inventory_checkbill_detail
<where> ${ew.sqlSegment} </where> <where>
</select> ${ew.sqlSegment}
</where>
</select>
<select id="detailRackGoodPageList" <select id="detailRackGoodPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo">
SELECT SELECT
sid, sid,
goodsID, goodsID,
goodsSkuTitle, goodsSkuTitle,
goodsSkuCode, goodsSkuCode,
warehouseName, warehouseName,
warehouseArea, warehouseArea,
warehouseRackName, warehouseRackName,
unit, unit,
cost, cost,
bookCount, bookCount,
bookCount * cost AS bookAmount, bookCount * cost AS bookAmount,
realCount, realCount,
realCount * cost AS realAmount, realCount * cost AS realAmount,
CASE CASE
state state
WHEN 2 WHEN 2
THEN '正常' THEN '正常'
WHEN 3 WHEN 3
THEN '盘盈' THEN '盘盈'
WHEN 4 WHEN 4
THEN '盘亏' THEN '盘亏'
END AS state, END AS state,
CASE CASE
state state
WHEN 2 WHEN 2
THEN 0 THEN 0
WHEN 3 WHEN 3
THEN profitCount THEN profitCount
WHEN 4 WHEN 4
THEN loseCount THEN loseCount
END AS profitAndLoseCount, END AS profitAndLoseCount,
CASE CASE
state state
WHEN 2 WHEN 2
THEN 0 THEN 0
WHEN 3 WHEN 3
THEN profitCount * cost THEN profitCount * cost
WHEN 4 WHEN 4
THEN loseCount * cost THEN loseCount * cost
END AS profitAndLoseAmount, END AS profitAndLoseAmount,
lossCount, lossCount,
lossCount * cost AS lossAmount, lossCount * cost AS lossAmount,
remarks remarks
FROM FROM
wms_inventory_checkbill_detail wms_inventory_checkbill_detail
<where> ${ew.sqlSegment} </where> <where>
</select> ${ew.sqlSegment}
</where>
</select>
<select id="selectNum" resultType="java.lang.String"> <select id="selectNum" resultType="java.lang.String">
select RIGHT (billNo, 4) select RIGHT (billNo, 4)
from wms_inventory_checkbill from wms_inventory_checkbill
where billNo LIKE concat(#{billNo}, '%') where billNo LIKE concat(#{billNo}, '%')
order by billNo desc order by billNo desc
limit 1 limit 1
</select> </select>
<select id="selectBySid" resultType="int"> <select id="selectBySid" resultType="int">
SELECT COUNT(*) SELECT COUNT(*)
FROM wms_inventory_checkbill FROM wms_inventory_checkbill
WHERE nodeState != '待提交' WHERE nodeState != '待提交'
and find_in_set(sid, #{list}) and find_in_set(sid, #{list})
</select> </select>
<select id="checkState" resultType="java.lang.String"> <select id="checkState" resultType="java.lang.String">
SELECT SELECT checkState
checkState FROM wms_inventory_checkbill
FROM WHERE deptSid = #{deptSid}
wms_inventory_checkbill AND warehouseTypeKey = #{warehouseTypeKey}
WHERE deptSid = #{deptSid} ORDER BY createTime DESC LIMIT 1
AND warehouseTypeKey = #{warehouseTypeKey} </select>
ORDER BY createTime DESC
LIMIT 1
</select>
<update id="updateFlowFiled"> <update id="updateFlowFiled">
UPDATE wms_inventory_checkbill UPDATE wms_inventory_checkbill
SET nodeState=#{nodeState}, nodeId=#{taskDefKey} SET nodeState=#{nodeState}, nodeId=#{taskDefKey}
<if test="nodeState == '已办结' or nodeState == '终止'"> <if test="nodeState == '已办结' or nodeState == '终止'">
, finishTime = NOW() , finishTime = NOW()
</if> </if>
<if test="procDefId != null and procDefId != ''"> <if test="procDefId != null and procDefId != ''">
, procDefId=#{procDefId} , procDefId=#{procDefId}
</if> </if>
<if test="procInsId != null and procInsId != ''"> <if test="procInsId != null and procInsId != ''">
, procInstId=#{procInsId} , procInstId=#{procInsId}
</if> </if>
<if test="taskId != null and taskId != ''"> <if test="taskId != null and taskId != ''">
, taskId=#{taskId} , taskId=#{taskId}
</if> </if>
WHERE sid=#{sid} WHERE sid=#{sid}
</update> </update>
<select id="appDetailRackPageList" <select id="appDetailRackPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo">
SELECT SELECT
c.sid, c.sid,
d.warehouseRackSid AS houseSid, d.warehouseRackSid AS houseSid,
CONCAT( CONCAT(
d.warehouseName, d.warehouseName,
'-', '-',
z.zoneName, z.zoneName,
'-', '-',
d.warehouseArea, d.warehouseArea,
'\n', '\n',
r.rackCode r.rackCode
) AS title, ) AS title,
SUM(bookCount) - SUM(realCount) AS surplusNumber, SUM(bookCount) - SUM(realCount) AS surplusNumber,
SUM(bookCount) AS totalNumber, SUM(bookCount) AS totalNumber,
SUM(loseCount) AS lossNumber, SUM(loseCount) AS lossNumber,
SUM(lossCount) AS damageNumber, SUM(lossCount) AS damageNumber,
SUM(profitCount) AS profitNumber, SUM(profitCount) AS profitNumber,
SUM(realCount) AS actualNumber SUM(realCount) AS actualNumber
FROM FROM
wms_inventory_checkbill_detail d wms_inventory_checkbill_detail d
LEFT JOIN wms_warehouse_rack r ON d.warehouseRackSid = r.sid LEFT JOIN wms_warehouse_rack r ON d.warehouseRackSid = r.sid
LEFT JOIN wms_warehouse_zone z on z.sid = r.zoneSid LEFT JOIN wms_warehouse_zone z on z.sid = r.zoneSid
LEFT JOIN wms_inventory_checkbill c LEFT JOIN wms_inventory_checkbill c
ON d.billSid = c.sid ON d.billSid = c.sid
<where> ${ew.sqlSegment} </where> <where>
${ew.sqlSegment}
</where>
</select> </select>
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> <select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo">
SELECT SELECT wc.sid AS billSid,
wc.sid AS billSid, wc.billNo
wc.billNo FROM wms_inventory_checkbill wc
FROM JOIN
wms_inventory_checkbill wc (SELECT SUM(wd.profitCount) AS total,
JOIN wd.billSid AS billSid
(SELECT FROM wms_inventory_checkbill_detail wd
SUM(wd.profitCount) AS total, GROUP BY wd.billSid) AS total_goods
wd.billSid AS billSid WHERE wc.deptSid = #{deptSid}
FROM AND wc.warehouseTypeKey = #{warehouseTypeKey}
wms_inventory_checkbill_detail wd AND total_goods.billSid = wc.sid
GROUP BY wd.billSid) AS total_goods AND total_goods.total > 0
WHERE wc.deptSid = #{deptSid} AND wc.checkState = 2
AND wc.warehouseTypeKey = #{warehouseTypeKey} </select>
AND total_goods.billSid = wc.sid
AND total_goods.total > 0
AND wc.checkState = 2
</select>
<select id="selPkByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo"> <select id="selPkByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo">
SELECT SELECT wc.sid AS billSid,
wc.sid AS billSid, wc.billNo
wc.billNo FROM wms_inventory_checkbill wc
FROM JOIN
wms_inventory_checkbill wc (SELECT SUM(wd.loseCount) AS total,
JOIN wd.billSid AS billSid
(SELECT FROM wms_inventory_checkbill_detail wd
SUM(wd.loseCount) AS total, GROUP BY wd.billSid) AS total_goods
wd.billSid AS billSid WHERE wc.deptSid = #{deptSid}
FROM AND wc.warehouseTypeKey = #{warehouseTypeKey}
wms_inventory_checkbill_detail wd AND total_goods.billSid = wc.sid
GROUP BY wd.billSid) AS total_goods AND total_goods.total > 0
WHERE wc.deptSid = #{deptSid} AND wc.checkState = 2
AND wc.warehouseTypeKey = #{warehouseTypeKey} </select>
AND total_goods.billSid = wc.sid
AND total_goods.total > 0 <select id="getToDoNum" resultType="java.lang.Integer">
AND wc.checkState = 2 SELECT
</select> COUNT(1)
FROM
(SELECT
c.sid,
d.warehouseRackSid AS houseSid,
CONCAT(
d.warehouseName,
'-',
z.zoneName,
'-',
d.warehouseArea,
'\n',
r.rackCode
) AS title,
SUM(bookCount) - SUM(realCount) AS surplusNumber,
SUM(bookCount) AS totalNumber,
SUM(loseCount) AS lossNumber,
SUM(lossCount) AS damageNumber,
SUM(profitCount) AS profitNumber,
SUM(realCount) AS actualNumber
FROM
wms_inventory_checkbill_detail d
LEFT JOIN wms_warehouse_rack r
ON d.warehouseRackSid = r.sid
LEFT JOIN wms_warehouse_zone z
ON z.sid = r.zoneSid
LEFT JOIN wms_inventory_checkbill c
ON d.billSid = c.sid
WHERE (
c.createBySid = #{userSid}
AND c.checkState = 1
AND c.warehouseTypeKey = 01
)
GROUP BY d.warehouseRackSid) TOTAL
</select>
</mapper> </mapper>

23
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillService.java

@ -50,6 +50,7 @@ import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.*;
import com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo; import com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo;
import com.yxt.wms.biz.inventory.wmsinventoryprofitin.WmsInventoryProfitin; import com.yxt.wms.biz.inventory.wmsinventoryprofitin.WmsInventoryProfitin;
import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecordService; import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecordService;
import com.yxt.wms.biz.inventory.wmsshelfbill.WmsToDoNumQuery;
import com.yxt.wms.feign.flowable.flow.BusinessVariables; import com.yxt.wms.feign.flowable.flow.BusinessVariables;
import com.yxt.wms.feign.flowable.flow.FlowableFeign; import com.yxt.wms.feign.flowable.flow.FlowableFeign;
import com.yxt.wms.feign.flowable.flow.ProcDefEnum; import com.yxt.wms.feign.flowable.flow.ProcDefEnum;
@ -85,19 +86,6 @@ import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* Project: yxt-wms(仓储) <br/>
* File: WmsInventoryCheckbillService.java <br/>
* Class: com.yxt.wms.biz.wmsinventorycheckbill.WmsInventoryCheckbillService <br/>
* Description: 库存盘点 业务逻辑. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2024-03-22 09:25:02 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service @Service
public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventoryCheckbillMapper, WmsInventoryCheckbill> { public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventoryCheckbillMapper, WmsInventoryCheckbill> {
@ -940,7 +928,7 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
for (WmsInventory wmsInventory : wmsInventories) { for (WmsInventory wmsInventory : wmsInventories) {
WmsWarehouseRack wmsWarehouseRack = wmsWarehouseRackService.fetchBySid(wmsInventory.getWarehouseRackSid()); WmsWarehouseRack wmsWarehouseRack = wmsWarehouseRackService.fetchBySid(wmsInventory.getWarehouseRackSid());
WmsWarehouseArea wmsWarehouseArea = wmsWarehouseAreaService.fetchBySid(wmsWarehouseRack.getLocationSid()); WmsWarehouseArea wmsWarehouseArea = wmsWarehouseAreaService.fetchBySid(wmsWarehouseRack.getLocationSid());
return rb.setMsg("商品不属于本库位,属于" + wmsWarehouseArea.getAreaName() + "库区" + wmsWarehouseRack.getRackName() + "库位。"); return rb.setMsg("商品不属于本库位,属于" + wmsWarehouseArea.getAreaName() + "库区" + wmsWarehouseRack.getRackCode() + "库位。");
} }
} else { } else {
String billNo = wmsInventoryRecordService.selByGoodsID(content); String billNo = wmsInventoryRecordService.selByGoodsID(content);
@ -971,4 +959,11 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
public List<InventoryBillVo> selPkByDeptSid(String deptSid,String warehouseTypeKey) { public List<InventoryBillVo> selPkByDeptSid(String deptSid,String warehouseTypeKey) {
return baseMapper.selPkByDeptSid(deptSid,warehouseTypeKey); return baseMapper.selPkByDeptSid(deptSid,warehouseTypeKey);
} }
public ResultBean<String> getToDoNum(WmsToDoNumQuery wmsToDoNumQuery) {
ResultBean rb = ResultBean.fireFail();
String userSid = wmsToDoNumQuery.getUserSid();
int count = baseMapper.getToDoNum(userSid);
return rb.success().setData(String.valueOf(count));
}
} }

20
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.java

@ -54,26 +54,26 @@ import java.util.List;
@Mapper @Mapper
public interface WmsInventoryCheckbillDetailMapper extends BaseMapper<WmsInventoryCheckbillDetail> { public interface WmsInventoryCheckbillDetailMapper extends BaseMapper<WmsInventoryCheckbillDetail> {
@Delete("delete from wms_inventory_checkbill_detail where billSid = #{dtoSid}") @Delete("delete from wms_inventory_checkbill_detail where billSid = #{dtoSid}")
void delByMainSid(String dtoSid); void delByMainSid(String dtoSid);
List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid); List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid);
WmsInventoryCheckbillReportSumVo reportSumTotal(String billSid); WmsInventoryCheckbillReportSumVo reportSumTotal(String billSid);
List<WmsInventoryCheckbillReportSumVo> reportSumWare(String billSid); List<WmsInventoryCheckbillReportSumVo> reportSumWare(String billSid);
List<WmsInventoryCheckbillReportSumVo> reportSumArea(String billSid); List<WmsInventoryCheckbillReportSumVo> reportSumArea(String billSid);
void saveInventoryInfoZC(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("num") String num); void saveInventoryInfoZC(@Param("dto") WmsInventoryCheckbillGoodsDto dto, @Param("num") String num);
void saveInventoryInfoPY(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("pyCount") BigDecimal pyCount); void saveInventoryInfoPY(@Param("dto") WmsInventoryCheckbillGoodsDto dto, @Param("pyCount") BigDecimal pyCount);
void saveInventoryInfoPK(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("pkCount") BigDecimal pkCount); void saveInventoryInfoPK(@Param("dto") WmsInventoryCheckbillGoodsDto dto, @Param("pkCount") BigDecimal pkCount);
HandleBean scan(@Param("sid") String sid,@Param("content") String content,@Param("houseSid") String houseSid); HandleBean scan(@Param("sid") String sid, @Param("content") String content, @Param("houseSid") String houseSid);
List<WmsInventoryProfitinDetailDto> sourceBillBySid(String sid); List<WmsInventoryProfitinDetailDto> sourceBillBySid(String sid);
List<WmsInventoryProfitoutDetailDto> sourceBillPkBySid(String sid); List<WmsInventoryProfitoutDetailDto> sourceBillPkBySid(String sid);
} }

306
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.xml

@ -1,162 +1,174 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailMapper"> <mapper namespace="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailMapper">
<!-- <where> ${ew.sqlSegment} </where>--> <!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} --> <!-- ${ew.customSqlSegment} -->
<select id="selByMainSid" <select id="selByMainSid"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo">
SELECT SELECT wicd.*,
wicd.*, wicd.goodsModel as carModel,
wicd.goodsModel as carModel, wicd.goodsSid as goodsSpuSid,
wicd.goodsSid as goodsSpuSid, wicd.goodsName as goodsSpuName,
wicd.goodsName as goodsSpuName, wicd.goodsCode as goodsSkuCode
wicd.goodsCode as goodsSkuCode FROM wms_inventory_checkbill_detail wicd
FROM LEFT JOIN wms_inventory wi
wms_inventory_checkbill_detail wicd ON wicd.inventorySid = wi.`sid`
LEFT JOIN wms_inventory wi WHERE billSid = #{billSid}
ON wicd.inventorySid = wi.`sid` </select>
WHERE billSid = #{billSid}
</select>
<select id="reportSumTotal" <select id="reportSumTotal"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT SELECT IFNULL(SUM(wicd.bookCount), 0) AS ypNum,
IFNULL(SUM(wicd.bookCount),0) AS ypNum, IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney,
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, IFNULL(SUM(wicd.realCount), 0) AS spNum,
IFNULL(SUM(wicd.realCount),0) AS spNum, IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney,
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, IFNULL(SUM(wicd.profitCount), 0) AS pyNum,
IFNULL(SUM(wicd.profitCount),0) AS pyNum, IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney,
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, IFNULL(SUM(wicd.loseCount), 0) AS pkNum,
IFNULL(SUM(wicd.loseCount),0) AS pkNum, IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney,
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, IFNULL(SUM(lossCount), 0) AS psNum,
IFNULL(SUM(lossCount),0) AS psNum, IFNULL(SUM(lossCount * cost), 0) AS psMoney
IFNULL(SUM(lossCount * cost),0) AS psMoney FROM wms_inventory_checkbill_detail AS wicd
FROM WHERE wicd.billSid = #{billSid}
wms_inventory_checkbill_detail AS wicd GROUP BY wicd.billSid
WHERE wicd.billSid = #{billSid} </select>
GROUP BY wicd.billSid
</select>
<select id="reportSumWare" <select id="reportSumWare"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT SELECT wicd.warehouseName,
wicd.warehouseName, IFNULL(SUM(wicd.bookCount), 0) AS ypNum,
IFNULL(SUM(wicd.bookCount),0) AS ypNum, IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney,
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, IFNULL(SUM(wicd.realCount), 0) AS spNum,
IFNULL(SUM(wicd.realCount),0) AS spNum, IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney,
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, IFNULL(SUM(wicd.profitCount), 0) AS pyNum,
IFNULL(SUM(wicd.profitCount),0) AS pyNum, IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney,
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, IFNULL(SUM(wicd.loseCount), 0) AS pkNum,
IFNULL(SUM(wicd.loseCount),0) AS pkNum, IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney,
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, IFNULL(SUM(lossCount), 0) AS psNum,
IFNULL(SUM(lossCount),0) AS psNum, IFNULL(SUM(lossCount * cost), 0) AS psMoney
IFNULL(SUM(lossCount * cost),0) AS psMoney FROM wms_inventory_checkbill_detail AS wicd
FROM WHERE wicd.billSid = #{billSid}
wms_inventory_checkbill_detail AS wicd GROUP BY wicd.warehouseSid
WHERE wicd.billSid = #{billSid} </select>
GROUP BY wicd.warehouseSid
</select>
<select id="reportSumArea" <select id="reportSumArea"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT SELECT CONCAT(
CONCAT( wicd.warehouseName,
wicd.warehouseName, '-',
'-', wz.zoneName,
wicd.warehouseArea '-',
) AS warehouseAreaeName, wicd.warehouseArea
IFNULL(SUM(wicd.bookCount),0) AS ypNum, ) AS warehouseAreaeName,
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, IFNULL(SUM(wicd.bookCount), 0) AS ypNum,
IFNULL(SUM(wicd.realCount),0) AS spNum, IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney,
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, IFNULL(SUM(wicd.realCount), 0) AS spNum,
IFNULL(SUM(wicd.profitCount),0) AS pyNum, IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney,
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, IFNULL(SUM(wicd.profitCount), 0) AS pyNum,
IFNULL(SUM(wicd.loseCount),0) AS pkNum, IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney,
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, IFNULL(SUM(wicd.loseCount), 0) AS pkNum,
IFNULL(SUM(lossCount),0) AS psNum, IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney,
IFNULL(SUM(lossCount * cost),0) AS psMoney IFNULL(SUM(lossCount), 0) AS psNum,
FROM IFNULL(SUM(lossCount * cost), 0) AS psMoney
wms_inventory_checkbill_detail AS wicd FROM wms_inventory_checkbill_detail AS wicd
WHERE wicd.billSid = #{billSid} LEFT JOIN wms_warehouse_zone AS wz
GROUP BY wicd.warehouseAreaSid ON wz.warehouseSid = wicd.warehouseSid
</select> WHERE wicd.billSid = #{billSid}
GROUP BY wicd.warehouseAreaSid
</select>
<update id="saveInventoryInfoZC"> <update id="saveInventoryInfoZC">
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = 0,remarks = #{dto.remarks},state = 2 where sid = #{dto.sid} update wms_inventory_checkbill_detail
</update> set lossCount = #{dto.badNum},
realCount = #{dto.num},
profitCount = 0,
loseCount = 0,
remarks = #{dto.remarks},
state = 2
where sid = #{dto.sid}
</update>
<update id="saveInventoryInfoPY"> <update id="saveInventoryInfoPY">
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = #{pyCount},loseCount = 0,remarks = #{dto.remarks},state = 3 where sid = #{dto.sid} update wms_inventory_checkbill_detail
</update> set lossCount = #{dto.badNum},
realCount = #{dto.num},
profitCount = #{pyCount},
loseCount = 0,
remarks = #{dto.remarks},
state = 3
where sid = #{dto.sid}
</update>
<update id="saveInventoryInfoPK"> <update id="saveInventoryInfoPK">
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = #{pkCount},remarks = #{dto.remarks},state = 4 where sid = #{dto.sid} update wms_inventory_checkbill_detail
</update> set lossCount = #{dto.badNum},
realCount = #{dto.num},
profitCount = 0,
loseCount = #{pkCount},
remarks = #{dto.remarks},
state = 4
where sid = #{dto.sid}
</update>
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean"> <select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean">
SELECT SELECT IF(lossCount IS NULL, 0, lossCount) AS badNum,
lossCount AS badNum, goodsID,
goodsID, goodsSkuTitle AS goodsName,
goodsSkuTitle AS goodsName, goodsSkuCode,
goodsSkuCode, bookCount AS lockNum,
bookCount AS lockNum, realCount AS num,
realCount AS num, remarks,
remarks, sid,
sid, unit
unit FROM wms_inventory_checkbill_detail
FROM WHERE billSid = #{sid}
wms_inventory_checkbill_detail AND goodsID = #{content}
WHERE billSid = #{sid} AND warehouseRackSid = #{houseSid}
AND goodsID = #{content} </select>
AND warehouseRackSid = #{houseSid}
</select>
<select id="sourceBillBySid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> <select id="sourceBillBySid"
SELECT resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto">
goodsSpuSid AS goodsSid, SELECT goodsSpuSid AS goodsSid,
goodsSpuName, goodsSpuName,
goodsSkuSid, goodsSkuSid,
goodsSkuTitle AS goodsName, goodsSkuTitle AS goodsName,
goodsSkuCode AS goodsCode, goodsSkuCode AS goodsCode,
goodsSkuOwnSpec AS goodsSpec, goodsSkuOwnSpec AS goodsSpec,
manufacturerSid, manufacturerSid,
manufacturerName, manufacturerName,
unit, unit,
profitCount AS pyNum, profitCount AS pyNum,
supplierSid, supplierSid,
supplierName, supplierName,
profitCount AS inStorageNum profitCount AS inStorageNum
FROM FROM wms_inventory_checkbill_detail
wms_inventory_checkbill_detail WHERE billSid = #{sid}
WHERE billSid = #{sid} AND profitCount > 0
AND profitCount > 0 </select>
</select>
<select id="sourceBillPkBySid" <select id="sourceBillPkBySid"
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto"> resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto">
SELECT SELECT d.goodsID,
d.goodsID, d.goodsSpuSid AS goodsSid,
d.goodsSpuSid AS goodsSid, d.goodsSpuName,
d.goodsSpuName, d.goodsSkuSid,
d.goodsSkuSid, d.goodsSkuTitle AS goodsName,
d.goodsSkuTitle AS goodsName, d.goodsSkuCode AS goodsCode,
d.goodsSkuCode AS goodsCode, d.goodsSkuOwnSpec AS goodsSpec,
d.goodsSkuOwnSpec AS goodsSpec, d.manufacturerSid,
d.manufacturerSid, d.manufacturerName,
d.manufacturerName, d.unit,
d.unit, d.loseCount AS pKNum,
d.loseCount AS pKNum, d.warehouseSid,
d.warehouseSid, d.warehouseName,
d.warehouseName, d.warehouseRackSid,
d.warehouseRackSid, d.warehouseRackName,
d.warehouseRackName, d.loseCount AS outStorageNum,
d.loseCount AS outStorageNum, w.cost AS inStoragePrice
w.cost AS inStoragePrice FROM wms_inventory_checkbill_detail d
FROM LEFT JOIN wms_inventory w
wms_inventory_checkbill_detail d ON d.goodsID = w.goodsID
LEFT JOIN wms_inventory w WHERE billSid = #{sid}
ON d.goodsID = w.goodsID AND loseCount > 0
WHERE billSid = #{sid} </select>
AND loseCount > 0
</select>
</mapper> </mapper>
Loading…
Cancel
Save