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", "维修完毕"),
SPSJ("781ce38b-b003-4efd-accf-fbee0ca33091", "商品上架"),
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.fegin.as.AsBusrepairBillFeign;
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.WmsToDoNumQuery;
import com.yxt.anrui.riskcenter.api.loanfileexamine.LoanFileexamineFeign;
@ -81,6 +82,8 @@ public class AppIndexService {
@Resource
private WmsShelfBillFeign wmsShelfBillFeign;
@Resource
private WmsInventoryCheckbillFeign wmsInventoryCheckbillFeign;
@Resource
private AsBusrepairBillFeign asBusrepairBillFeign;
public ResultBean<List<AppIndexNewVo>> getBusinessList(String userSid, String appSid, String orgPath) {
@ -250,6 +253,11 @@ public class AppIndexService {
String num = asBusrepairBillFeign.getToDoNum2(asToDoNumQuery).getData();
appIndexNumVo.setNum(num);
}
//商品盘点
if (AppIndexEnum.AppMenu.SPPD.getRemarks().equals(menu.getTitle())) {
String num = wmsInventoryCheckbillFeign.getToDoNum(wmsToDoNumQuery).getData();
appIndexNumVo.setNum(num);
}
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){
wmsInventoryCheckbillGoodsPageVo.setPanSun(record.getLossCount().toString());
handleBean.setBadNum(record.getLossCount().toString());
}else {
handleBean.setBadNum("0");
}
List<WmsInventoryCheckbillDetailFile> fileList = record.getFileList();
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")
public class WmsInventoryAllocatebillRest {
@Autowired
private WmsInventoryAllocateBillService wmsInventoryAllocateBillService;
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")
public ResultBean<PagerVo<WmsInventoryAllocateBillVoNew>> listPage(@RequestBody PagerQuery<WmsInventoryAllocateBillQueryNew> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryAllocateBillVoNew> pv = wmsInventoryAllocateBillService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("新增或修改")
@PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryAllocateBillDtoNew dto){
ResultBean rb = ResultBean.fireFail();
wmsInventoryAllocateBillService.saveOrUpdateDto(dto);
return rb.success();
}
@ApiOperation("根据sid批量删除")
@Autowired
private WmsInventoryAllocateBillService wmsInventoryAllocateBillService;
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")
public ResultBean<PagerVo<WmsInventoryAllocateBillVoNew>> listPage(@RequestBody PagerQuery<WmsInventoryAllocateBillQueryNew> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryAllocateBillVoNew> pv = wmsInventoryAllocateBillService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("新增或修改")
@PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryAllocateBillDtoNew dto) {
ResultBean rb = ResultBean.fireFail();
wmsInventoryAllocateBillService.saveOrUpdateDto(dto);
return rb.success();
}
@ApiOperation("根据sid批量删除")
@DeleteMapping("/delBySids")
public ResultBean delBySids(@RequestBody String[] sids){
ResultBean rb = ResultBean.fireFail();
wmsInventoryAllocateBillService.delAll(sids);
return rb.success();
}
public ResultBean delBySids(@RequestBody String[] sids) {
ResultBean rb = ResultBean.fireFail();
wmsInventoryAllocateBillService.delAll(sids);
return rb.success();
}
@ApiOperation("根据SID获取一条记录")
@ApiOperation("根据SID获取一条记录")
@GetMapping("/fetchDetailsBySid/{sid}")
public ResultBean<WmsInventoryAllocateBillDetailsVoNew> fetchDetailsBySid(@PathVariable("sid") String sid){
ResultBean rb = ResultBean.fireFail();
WmsInventoryAllocateBillDetailsVoNew vo = wmsInventoryAllocateBillService.fetchDetailsVoBySid(sid);
return rb.success().setData(vo);
}
/*********************************************************流程************************************************************/
@ApiOperation("提交")
@PostMapping("/submitApply")
public ResultBean submitApply(@Valid @RequestBody SubmitFlowDto dto) {
return wmsInventoryAllocateBillService.submitApply(dto);
}
@ApiOperation(value = "办理(同意)")
@PostMapping("/complete")
public ResultBean complete(@Valid @RequestBody CompleteFlowDto query) {
BusinessVariables bv = new BusinessVariables();
BeanUtil.copyProperties(query, bv);
bv.setModelId("");
return wmsInventoryAllocateBillService.complete(bv);
}
@ApiOperation(value = "获取上一个环节")
@GetMapping(value = "/getPreviousNodesForReject")
ResultBean<List<FlowNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap FlowNodeQuery query) {
return wmsInventoryAllocateBillService.getPreviousNodesForReject(query);
}
@ApiOperation(value = "获取下一个环节")
@GetMapping(value = "/getNextNodesForSubmit")
ResultBean<List<FlowNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap FlowNodeQuery query) {
return wmsInventoryAllocateBillService.getNextNodesForSubmit(query);
}
@ApiOperation(value = "驳回任务")
@PostMapping(value = "/reject")
public ResultBean taskReject(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.taskReject(query);
}
@ApiOperation(value = "撤回流程")
@PostMapping(value = "/revokeProcess")
public ResultBean revokeProcess(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.revokeProcess(query);
}
@ApiOperation(value = "终止任务")
@PostMapping(value = "/breakProcess")
public ResultBean breakProcess(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.breakProcess(query);
}
@ApiOperation(value = "加签")
@PostMapping(value = "/delegate")
@ResponseBody
public ResultBean delegate(@RequestBody FlowDelegateQuery query) {
return wmsInventoryAllocateBillService.delegate(query);
}
@ApiOperation(value = "转办")
@PostMapping(value = "/assignTask")
@ResponseBody
public ResultBean assignTask(@RequestBody FlowDelegateQuery query){
return wmsInventoryAllocateBillService.assignTask(query);
}
public ResultBean<WmsInventoryAllocateBillDetailsVoNew> fetchDetailsBySid(@PathVariable("sid") String sid) {
ResultBean rb = ResultBean.fireFail();
WmsInventoryAllocateBillDetailsVoNew vo = wmsInventoryAllocateBillService.fetchDetailsVoBySid(sid);
return rb.success().setData(vo);
}
/*********************************************************流程************************************************************/
@ApiOperation("提交")
@PostMapping("/submitApply")
public ResultBean submitApply(@Valid @RequestBody SubmitFlowDto dto) {
return wmsInventoryAllocateBillService.submitApply(dto);
}
@ApiOperation(value = "办理(同意)")
@PostMapping("/complete")
public ResultBean complete(@Valid @RequestBody CompleteFlowDto query) {
BusinessVariables bv = new BusinessVariables();
BeanUtil.copyProperties(query, bv);
bv.setModelId("");
return wmsInventoryAllocateBillService.complete(bv);
}
@ApiOperation(value = "获取上一个环节")
@GetMapping(value = "/getPreviousNodesForReject")
ResultBean<List<FlowNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap FlowNodeQuery query) {
return wmsInventoryAllocateBillService.getPreviousNodesForReject(query);
}
@ApiOperation(value = "获取下一个环节")
@GetMapping(value = "/getNextNodesForSubmit")
ResultBean<List<FlowNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap FlowNodeQuery query) {
return wmsInventoryAllocateBillService.getNextNodesForSubmit(query);
}
@ApiOperation(value = "驳回任务")
@PostMapping(value = "/reject")
public ResultBean taskReject(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.taskReject(query);
}
@ApiOperation(value = "撤回流程")
@PostMapping(value = "/revokeProcess")
public ResultBean revokeProcess(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.revokeProcess(query);
}
@ApiOperation(value = "终止任务")
@PostMapping(value = "/breakProcess")
public ResultBean breakProcess(@Valid @RequestBody FlowTaskQuery query) {
return wmsInventoryAllocateBillService.breakProcess(query);
}
@ApiOperation(value = "加签")
@PostMapping(value = "/delegate")
@ResponseBody
public ResultBean delegate(@RequestBody FlowDelegateQuery query) {
return wmsInventoryAllocateBillService.delegate(query);
}
@ApiOperation(value = "转办")
@PostMapping(value = "/assignTask")
@ResponseBody
public ResultBean assignTask(@RequestBody FlowDelegateQuery 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 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 = "库存盘点-明细")
@RestController
@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 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 = "盘点报告")
@RestController
@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.app.*;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -159,6 +160,13 @@ public class WmsInventoryCheckbillRest {
return wmsInventoryCheckbillService.scan(sid, content, houseSid);
}
@ApiOperation("手机端-查询本分公司下代办数量:切换机构")
@GetMapping("/getToDoNum")
@ResponseBody
ResultBean<String> getToDoNum(@SpringQueryMap WmsToDoNumQuery wmsToDoNumQuery) {
return wmsInventoryCheckbillService.getToDoNum(wmsToDoNumQuery);
}
/*********************************************************流程************************************************************/
@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
LEFT JOIN wms_warehouse_zone wz
ON wz.warehouseSid = wi.warehouseSid
LEFT JOIN wms_warehouse_info wwi
ON wwi.sid = wi.warehouseSid
<where>
${ew.sqlSegment}
</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())) {
qw.eq("i.warehouseTypeValue", query.getType());
}
qw.notLike("a.goodsID","-O");
qw.notLike("a.goodsID", "-O");
IPage<WmsInventory> page = PagerUtil.queryToPage(pq);
IPage<WmsInventoryVo> pagging = baseMapper.listPage(page, qw);
PagerVo<WmsInventoryVo> p = PagerUtil.pageToVo(pagging, null);
@ -213,7 +213,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
if (StringUtils.isNotBlank(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.removeAll(Collections.singleton(null));
return list;
@ -574,6 +574,8 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
WmsInventoryAlloSelectQuery query = pq.getParams();
QueryWrapper<WmsInventory> qw = new QueryWrapper<>();
qw.eq("wi.useOrgSid", query.getDeptSid());
qw.eq("wwi.warehouseTypeKey", "01");
qw.gt("wi.count", 0);
if (StringUtils.isNotBlank(query.getGoodsID())) {
qw.like("wi.goodsID", query.getGoodsID());
}
@ -947,8 +949,8 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
.or().like("a.warehouseRackCode", query.getName())
);
}
qw.notLike("a.goodsID","-O");
qw.eq("a.warehouseTypeValue","配件库");
qw.notLike("a.goodsID", "-O");
qw.eq("a.warehouseTypeValue", "配件库");
IPage<WmsInventory> page = PagerUtil.queryToPage(pq);
IPage<FittingsInventoryVo> pagging = baseMapper.fittingsInventory(page, qw);
PagerVo<FittingsInventoryVo> p = PagerUtil.pageToVo(pagging, null);
@ -1007,8 +1009,8 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
.or().like("z.zoneName", query.getName())
);
}
qw.notLike("i.goodsID","-O");
qw.eq("wi.warehouseTypeValue","配件库");
qw.notLike("i.goodsID", "-O");
qw.eq("wi.warehouseTypeValue", "配件库");
List<StorageListVo> listVos = baseMapper.appStorage(qw);
Map<String, List<StorageListVo>> stringListMap = listVos.stream().collect(Collectors.groupingBy(StorageListVo::getTitle));
List<StorageVo> records = new ArrayList<>();
@ -1374,7 +1376,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
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<>();
String useOrgSid = "";
if (StringUtils.isNotBlank(orgPath)) {
@ -1388,7 +1390,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
useOrgSid = sysOrganization.getSid();
}
}
List<WmsInventory> inventories = baseMapper.selOaInventoryList(useOrgSid, warehouseTypeValue,name);
List<WmsInventory> inventories = baseMapper.selOaInventoryList(useOrgSid, warehouseTypeValue, name);
if (!inventories.isEmpty()) {
for (WmsInventory d : inventories) {
FormCommon f = new FormCommon();
@ -1402,7 +1404,7 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
}
if (StringUtils.isNotBlank(d.getGoodsSkuCode())) {
extra.put("goodsSkuCode", d.getGoodsSkuCode());
} else {
} else {
extra.put("goodsSkuCode", "");
}
if (null != d.getCount()) {
@ -1482,11 +1484,11 @@ public class WmsInventoryService extends MybatisBaseService<WmsInventoryMapper,
wmsInventorySaveDto.setWarehouseRackSid(houseInfoVo.getWarehouseRackSid());
wmsInventorySaveDto.setWarehouseRackCode(houseInfoVo.getWarehouseRackCode());
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);
}else {
} else {
BigDecimal count = new BigDecimal(wmsStoreChangeDto.getMaxCount()).subtract(new BigDecimal(wmsStoreChangeDto.getCount()));
baseMapper.updateCount(sid,count.toString());
baseMapper.updateCount(sid, count.toString());
}
}
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.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
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);
int selectBySid(String join);
int selectBySid(String join);
@Update("update wms_inventory_checkbill set state = 0,checkState = 2 where sid = #{sid}")
void createReport(String sid);
@Update("update wms_inventory_checkbill set state = 0,checkState = 2 where sid = #{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);
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" ?>
<!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">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo">
SELECT
wic.sid,
wic.state,
wic.`remarks`,
wic.`nodeState`,
wic.`deptName`,
wic.`billNo`,
wic.`createTime`,
wic.`createByName`,
wic.`superviseName`,
IF(
wic.`checkState` = '1',
'盘点中',
'盘点完成'
) AS checkState,
wic.`procDefId`,
wic.`procInstId`,
SUM(wicd.bookCount) AS bookCount,
SUM(wicd.bookCount * cost) AS bookAmount,
SUM(wicd.realCount) AS realCount,
SUM(wicd.realCount * cost) AS realAmount,
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount,
(
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost)
) AS notAmount,
SUM(wicd.profitCount) AS profitCount,
SUM(wicd.profitCount * cost) AS profitAmount,
SUM(wicd.loseCount) AS loseCount,
SUM(wicd.loseCount * cost) AS loseAmount,
SUM(wicd.lossCount) AS lossCount,
SUM(wicd.lossCount * cost) AS lossAmount
FROM
wms_inventory_checkbill wic
LEFT JOIN wms_inventory_checkbill_detail wicd
ON wic.sid = wicd.`billSid`
LEFT JOIN anrui_portal.sys_organization AS s
ON wic.deptSid = s.sid
<where> ${ew.sqlSegment} </where>
</select>
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbill.WmsInventoryCheckbillVo">
SELECT
wic.sid,
wic.state,
wic.remarks,
wic.nodeState,
wic.deptName,
wic.billNo,
wic.createTime,
wic.createByName,
wic.superviseName,
IF(
wic.checkState = '1',
'盘点中',
'盘点完成'
) AS checkState,
wic.procDefId,
wic.procInstId,
SUM(wicd.bookCount) AS bookCount,
SUM(wicd.bookCount * cost) AS bookAmount,
SUM(wicd.realCount) AS realCount,
SUM(wicd.realCount * cost) AS realAmount,
SUM(wicd.bookCount) - SUM(wicd.realCount) AS notCount,
(
SUM(wicd.bookCount * cost) - SUM(wicd.realCount * cost)
) AS notAmount,
SUM(wicd.profitCount) AS profitCount,
SUM(wicd.profitCount * cost) AS profitAmount,
SUM(wicd.loseCount) AS loseCount,
SUM(wicd.loseCount * cost) AS loseAmount,
SUM(wicd.lossCount) AS lossCount,
SUM(wicd.lossCount * cost) AS lossAmount
FROM
wms_inventory_checkbill wic
LEFT JOIN wms_inventory_checkbill_detail wicd
ON wic.sid = wicd.billSid
LEFT JOIN anrui_portal.sys_organization AS s
ON wic.deptSid = s.sid
<where>
${ew.sqlSegment}
</where>
</select>
<select id="detailRackPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo">
SELECT
billSid,
warehouseName,
warehouseArea,
warehouseRackSid,
warehouseRackName,
SUM(bookCount) AS bookCount,
SUM(bookCount * cost) AS bookAmount,
SUM(realCount) AS realCount,
SUM(realCount * cost) AS realAmount,
SUM(bookCount) - SUM(realCount) AS notCount,
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount,
SUM(profitCount) AS profitCount,
SUM(profitCount * cost) AS profitAmount,
SUM(loseCount) AS loseCount,
SUM(loseCount * cost) AS loseAmount,
SUM(lossCount) AS lossCount,
SUM(lossCount * cost) AS lossAmount
FROM
wms_inventory_checkbill_detail
<where> ${ew.sqlSegment} </where>
</select>
<select id="detailRackPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackPageListVo">
SELECT
billSid,
warehouseName,
warehouseArea,
warehouseRackSid,
warehouseRackName,
SUM(bookCount) AS bookCount,
SUM(bookCount * cost) AS bookAmount,
SUM(realCount) AS realCount,
SUM(realCount * cost) AS realAmount,
SUM(bookCount) - SUM(realCount) AS notCount,
(SUM(bookCount * cost) - SUM(realCount * cost)) AS notAmount,
SUM(profitCount) AS profitCount,
SUM(profitCount * cost) AS profitAmount,
SUM(loseCount) AS loseCount,
SUM(loseCount * cost) AS loseAmount,
SUM(lossCount) AS lossCount,
SUM(lossCount * cost) AS lossAmount
FROM
wms_inventory_checkbill_detail
<where>
${ew.sqlSegment}
</where>
</select>
<select id="detailGoodPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo">
SELECT
goodsID,
goodsSkuTitle,
goodsSkuCode,
warehouseName,
warehouseArea,
warehouseRackName,
unit,
cost,
bookCount,
bookCount * cost AS bookAmount,
realCount,
realCount * cost AS realAmount,
CASE
state
WHEN 2
THEN '正常'
WHEN 3
THEN '盘盈'
WHEN 4
THEN '盘亏'
END AS state,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount
WHEN 4
THEN loseCount
END AS profitAndLoseCount,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount * cost
WHEN 4
THEN loseCount * cost
END AS profitAndLoseAmount,
lossCount,
lossCount * cost AS lossAmount,
remarks
FROM
wms_inventory_checkbill_detail
<where> ${ew.sqlSegment} </where>
</select>
<select id="detailGoodPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailGoodPageListVo">
SELECT
goodsID,
goodsSkuTitle,
goodsSkuCode,
warehouseName,
warehouseArea,
warehouseRackName,
unit,
cost,
bookCount,
bookCount * cost AS bookAmount,
realCount,
realCount * cost AS realAmount,
CASE
state
WHEN 2
THEN '正常'
WHEN 3
THEN '盘盈'
WHEN 4
THEN '盘亏'
END AS state,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount
WHEN 4
THEN loseCount
END AS profitAndLoseCount,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount * cost
WHEN 4
THEN loseCount * cost
END AS profitAndLoseAmount,
lossCount,
lossCount * cost AS lossAmount,
remarks
FROM
wms_inventory_checkbill_detail
<where>
${ew.sqlSegment}
</where>
</select>
<select id="detailRackGoodPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo">
SELECT
sid,
goodsID,
goodsSkuTitle,
goodsSkuCode,
warehouseName,
warehouseArea,
warehouseRackName,
unit,
cost,
bookCount,
bookCount * cost AS bookAmount,
realCount,
realCount * cost AS realAmount,
CASE
state
WHEN 2
THEN '正常'
WHEN 3
THEN '盘盈'
WHEN 4
THEN '盘亏'
END AS state,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount
WHEN 4
THEN loseCount
END AS profitAndLoseCount,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount * cost
WHEN 4
THEN loseCount * cost
END AS profitAndLoseAmount,
lossCount,
lossCount * cost AS lossAmount,
remarks
FROM
wms_inventory_checkbill_detail
<where> ${ew.sqlSegment} </where>
</select>
<select id="detailRackGoodPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailRackGoodPageListVo">
SELECT
sid,
goodsID,
goodsSkuTitle,
goodsSkuCode,
warehouseName,
warehouseArea,
warehouseRackName,
unit,
cost,
bookCount,
bookCount * cost AS bookAmount,
realCount,
realCount * cost AS realAmount,
CASE
state
WHEN 2
THEN '正常'
WHEN 3
THEN '盘盈'
WHEN 4
THEN '盘亏'
END AS state,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount
WHEN 4
THEN loseCount
END AS profitAndLoseCount,
CASE
state
WHEN 2
THEN 0
WHEN 3
THEN profitCount * cost
WHEN 4
THEN loseCount * cost
END AS profitAndLoseAmount,
lossCount,
lossCount * cost AS lossAmount,
remarks
FROM
wms_inventory_checkbill_detail
<where>
${ew.sqlSegment}
</where>
</select>
<select id="selectNum" resultType="java.lang.String">
select RIGHT (billNo, 4)
from wms_inventory_checkbill
where billNo LIKE concat(#{billNo}, '%')
order by billNo desc
limit 1
<select id="selectNum" resultType="java.lang.String">
select RIGHT (billNo, 4)
from wms_inventory_checkbill
where billNo LIKE concat(#{billNo}, '%')
order by billNo desc
limit 1
</select>
<select id="selectBySid" resultType="int">
SELECT COUNT(*)
FROM wms_inventory_checkbill
WHERE nodeState != '待提交'
<select id="selectBySid" resultType="int">
SELECT COUNT(*)
FROM wms_inventory_checkbill
WHERE nodeState != '待提交'
and find_in_set(sid, #{list})
</select>
</select>
<select id="checkState" resultType="java.lang.String">
SELECT
checkState
FROM
wms_inventory_checkbill
WHERE deptSid = #{deptSid}
AND warehouseTypeKey = #{warehouseTypeKey}
ORDER BY createTime DESC
LIMIT 1
</select>
<select id="checkState" resultType="java.lang.String">
SELECT checkState
FROM wms_inventory_checkbill
WHERE deptSid = #{deptSid}
AND warehouseTypeKey = #{warehouseTypeKey}
ORDER BY createTime DESC LIMIT 1
</select>
<update id="updateFlowFiled">
UPDATE wms_inventory_checkbill
SET nodeState=#{nodeState}, nodeId=#{taskDefKey}
<if test="nodeState == '已办结' or nodeState == '终止'">
, finishTime = NOW()
</if>
<if test="procDefId != null and procDefId != ''">
, procDefId=#{procDefId}
</if>
<if test="procInsId != null and procInsId != ''">
, procInstId=#{procInsId}
</if>
<if test="taskId != null and taskId != ''">
, taskId=#{taskId}
</if>
WHERE sid=#{sid}
<update id="updateFlowFiled">
UPDATE wms_inventory_checkbill
SET nodeState=#{nodeState}, nodeId=#{taskDefKey}
<if test="nodeState == '已办结' or nodeState == '终止'">
, finishTime = NOW()
</if>
<if test="procDefId != null and procDefId != ''">
, procDefId=#{procDefId}
</if>
<if test="procInsId != null and procInsId != ''">
, procInstId=#{procInsId}
</if>
<if test="taskId != null and taskId != ''">
, taskId=#{taskId}
</if>
WHERE sid=#{sid}
</update>
<select id="appDetailRackPageList"
<select id="appDetailRackPageList"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo">
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> ${ew.sqlSegment} </where>
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>
${ew.sqlSegment}
</where>
</select>
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo">
SELECT
wc.sid AS billSid,
wc.billNo
FROM
wms_inventory_checkbill wc
JOIN
(SELECT
SUM(wd.profitCount) AS total,
wd.billSid AS billSid
FROM
wms_inventory_checkbill_detail wd
GROUP BY wd.billSid) AS total_goods
WHERE wc.deptSid = #{deptSid}
AND wc.warehouseTypeKey = #{warehouseTypeKey}
AND total_goods.billSid = wc.sid
AND total_goods.total > 0
AND wc.checkState = 2
</select>
<select id="selPyByDeptSid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitin.InventoryBillVo">
SELECT wc.sid AS billSid,
wc.billNo
FROM wms_inventory_checkbill wc
JOIN
(SELECT SUM(wd.profitCount) AS total,
wd.billSid AS billSid
FROM wms_inventory_checkbill_detail wd
GROUP BY wd.billSid) AS total_goods
WHERE wc.deptSid = #{deptSid}
AND wc.warehouseTypeKey = #{warehouseTypeKey}
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
wc.sid AS billSid,
wc.billNo
FROM
wms_inventory_checkbill wc
JOIN
(SELECT
SUM(wd.loseCount) AS total,
wd.billSid AS billSid
FROM
wms_inventory_checkbill_detail wd
GROUP BY wd.billSid) AS total_goods
WHERE wc.deptSid = #{deptSid}
AND wc.warehouseTypeKey = #{warehouseTypeKey}
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 wc.sid AS billSid,
wc.billNo
FROM wms_inventory_checkbill wc
JOIN
(SELECT SUM(wd.loseCount) AS total,
wd.billSid AS billSid
FROM wms_inventory_checkbill_detail wd
GROUP BY wd.billSid) AS total_goods
WHERE wc.deptSid = #{deptSid}
AND wc.warehouseTypeKey = #{warehouseTypeKey}
AND total_goods.billSid = wc.sid
AND total_goods.total > 0
AND wc.checkState = 2
</select>
<select id="getToDoNum" resultType="java.lang.Integer">
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>

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.WmsInventoryProfitin;
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.FlowableFeign;
import com.yxt.wms.feign.flowable.flow.ProcDefEnum;
@ -85,19 +86,6 @@ import java.util.*;
import java.util.concurrent.*;
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
public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventoryCheckbillMapper, WmsInventoryCheckbill> {
@ -940,7 +928,7 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
for (WmsInventory wmsInventory : wmsInventories) {
WmsWarehouseRack wmsWarehouseRack = wmsWarehouseRackService.fetchBySid(wmsInventory.getWarehouseRackSid());
WmsWarehouseArea wmsWarehouseArea = wmsWarehouseAreaService.fetchBySid(wmsWarehouseRack.getLocationSid());
return rb.setMsg("商品不属于本库位,属于" + wmsWarehouseArea.getAreaName() + "库区" + wmsWarehouseRack.getRackName() + "库位。");
return rb.setMsg("商品不属于本库位,属于" + wmsWarehouseArea.getAreaName() + "库区" + wmsWarehouseRack.getRackCode() + "库位。");
}
} else {
String billNo = wmsInventoryRecordService.selByGoodsID(content);
@ -971,4 +959,11 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
public List<InventoryBillVo> selPkByDeptSid(String deptSid,String 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
public interface WmsInventoryCheckbillDetailMapper extends BaseMapper<WmsInventoryCheckbillDetail> {
@Delete("delete from wms_inventory_checkbill_detail where billSid = #{dtoSid}")
void delByMainSid(String dtoSid);
@Delete("delete from wms_inventory_checkbill_detail where billSid = #{dtoSid}")
void delByMainSid(String dtoSid);
List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid);
List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(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<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" ?>
<!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">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selByMainSid"
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selByMainSid"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo">
SELECT
wicd.*,
wicd.goodsModel as carModel,
wicd.goodsSid as goodsSpuSid,
wicd.goodsName as goodsSpuName,
wicd.goodsCode as goodsSkuCode
FROM
wms_inventory_checkbill_detail wicd
LEFT JOIN wms_inventory wi
ON wicd.inventorySid = wi.`sid`
WHERE billSid = #{billSid}
</select>
SELECT wicd.*,
wicd.goodsModel as carModel,
wicd.goodsSid as goodsSpuSid,
wicd.goodsName as goodsSpuName,
wicd.goodsCode as goodsSkuCode
FROM wms_inventory_checkbill_detail wicd
LEFT JOIN wms_inventory wi
ON wicd.inventorySid = wi.`sid`
WHERE billSid = #{billSid}
</select>
<select id="reportSumTotal"
<select id="reportSumTotal"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT
IFNULL(SUM(wicd.bookCount),0) AS ypNum,
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney,
IFNULL(SUM(wicd.realCount),0) AS spNum,
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney,
IFNULL(SUM(wicd.profitCount),0) AS pyNum,
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney,
IFNULL(SUM(wicd.loseCount),0) AS pkNum,
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney,
IFNULL(SUM(lossCount),0) AS psNum,
IFNULL(SUM(lossCount * cost),0) AS psMoney
FROM
wms_inventory_checkbill_detail AS wicd
WHERE wicd.billSid = #{billSid}
GROUP BY wicd.billSid
</select>
SELECT IFNULL(SUM(wicd.bookCount), 0) AS ypNum,
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney,
IFNULL(SUM(wicd.realCount), 0) AS spNum,
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney,
IFNULL(SUM(wicd.profitCount), 0) AS pyNum,
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney,
IFNULL(SUM(wicd.loseCount), 0) AS pkNum,
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney,
IFNULL(SUM(lossCount), 0) AS psNum,
IFNULL(SUM(lossCount * cost), 0) AS psMoney
FROM wms_inventory_checkbill_detail AS wicd
WHERE wicd.billSid = #{billSid}
GROUP BY wicd.billSid
</select>
<select id="reportSumWare"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT
wicd.warehouseName,
IFNULL(SUM(wicd.bookCount),0) AS ypNum,
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney,
IFNULL(SUM(wicd.realCount),0) AS spNum,
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney,
IFNULL(SUM(wicd.profitCount),0) AS pyNum,
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney,
IFNULL(SUM(wicd.loseCount),0) AS pkNum,
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney,
IFNULL(SUM(lossCount),0) AS psNum,
IFNULL(SUM(lossCount * cost),0) AS psMoney
FROM
wms_inventory_checkbill_detail AS wicd
WHERE wicd.billSid = #{billSid}
GROUP BY wicd.warehouseSid
</select>
<select id="reportSumWare"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT wicd.warehouseName,
IFNULL(SUM(wicd.bookCount), 0) AS ypNum,
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney,
IFNULL(SUM(wicd.realCount), 0) AS spNum,
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney,
IFNULL(SUM(wicd.profitCount), 0) AS pyNum,
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney,
IFNULL(SUM(wicd.loseCount), 0) AS pkNum,
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney,
IFNULL(SUM(lossCount), 0) AS psNum,
IFNULL(SUM(lossCount * cost), 0) AS psMoney
FROM wms_inventory_checkbill_detail AS wicd
WHERE wicd.billSid = #{billSid}
GROUP BY wicd.warehouseSid
</select>
<select id="reportSumArea"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT
CONCAT(
wicd.warehouseName,
'-',
wicd.warehouseArea
) AS warehouseAreaeName,
IFNULL(SUM(wicd.bookCount),0) AS ypNum,
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney,
IFNULL(SUM(wicd.realCount),0) AS spNum,
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney,
IFNULL(SUM(wicd.profitCount),0) AS pyNum,
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney,
IFNULL(SUM(wicd.loseCount),0) AS pkNum,
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney,
IFNULL(SUM(lossCount),0) AS psNum,
IFNULL(SUM(lossCount * cost),0) AS psMoney
FROM
wms_inventory_checkbill_detail AS wicd
WHERE wicd.billSid = #{billSid}
GROUP BY wicd.warehouseAreaSid
</select>
<select id="reportSumArea"
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo">
SELECT CONCAT(
wicd.warehouseName,
'-',
wz.zoneName,
'-',
wicd.warehouseArea
) AS warehouseAreaeName,
IFNULL(SUM(wicd.bookCount), 0) AS ypNum,
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney,
IFNULL(SUM(wicd.realCount), 0) AS spNum,
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney,
IFNULL(SUM(wicd.profitCount), 0) AS pyNum,
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney,
IFNULL(SUM(wicd.loseCount), 0) AS pkNum,
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney,
IFNULL(SUM(lossCount), 0) AS psNum,
IFNULL(SUM(lossCount * cost), 0) AS psMoney
FROM wms_inventory_checkbill_detail AS wicd
LEFT JOIN wms_warehouse_zone AS wz
ON wz.warehouseSid = wicd.warehouseSid
WHERE wicd.billSid = #{billSid}
GROUP BY wicd.warehouseAreaSid
</select>
<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>
<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>
<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>
<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>
<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>
<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>
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean">
SELECT
lossCount AS badNum,
goodsID,
goodsSkuTitle AS goodsName,
goodsSkuCode,
bookCount AS lockNum,
realCount AS num,
remarks,
sid,
unit
FROM
wms_inventory_checkbill_detail
WHERE billSid = #{sid}
AND goodsID = #{content}
AND warehouseRackSid = #{houseSid}
</select>
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean">
SELECT IF(lossCount IS NULL, 0, lossCount) AS badNum,
goodsID,
goodsSkuTitle AS goodsName,
goodsSkuCode,
bookCount AS lockNum,
realCount AS num,
remarks,
sid,
unit
FROM wms_inventory_checkbill_detail
WHERE billSid = #{sid}
AND goodsID = #{content}
AND warehouseRackSid = #{houseSid}
</select>
<select id="sourceBillBySid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto">
SELECT
goodsSpuSid AS goodsSid,
goodsSpuName,
goodsSkuSid,
goodsSkuTitle AS goodsName,
goodsSkuCode AS goodsCode,
goodsSkuOwnSpec AS goodsSpec,
manufacturerSid,
manufacturerName,
unit,
profitCount AS pyNum,
supplierSid,
supplierName,
profitCount AS inStorageNum
FROM
wms_inventory_checkbill_detail
WHERE billSid = #{sid}
AND profitCount > 0
</select>
<select id="sourceBillBySid"
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto">
SELECT goodsSpuSid AS goodsSid,
goodsSpuName,
goodsSkuSid,
goodsSkuTitle AS goodsName,
goodsSkuCode AS goodsCode,
goodsSkuOwnSpec AS goodsSpec,
manufacturerSid,
manufacturerName,
unit,
profitCount AS pyNum,
supplierSid,
supplierName,
profitCount AS inStorageNum
FROM wms_inventory_checkbill_detail
WHERE billSid = #{sid}
AND profitCount > 0
</select>
<select id="sourceBillPkBySid"
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto">
SELECT
d.goodsID,
d.goodsSpuSid AS goodsSid,
d.goodsSpuName,
d.goodsSkuSid,
d.goodsSkuTitle AS goodsName,
d.goodsSkuCode AS goodsCode,
d.goodsSkuOwnSpec AS goodsSpec,
d.manufacturerSid,
d.manufacturerName,
d.unit,
d.loseCount AS pKNum,
d.warehouseSid,
d.warehouseName,
d.warehouseRackSid,
d.warehouseRackName,
d.loseCount AS outStorageNum,
w.cost AS inStoragePrice
FROM
wms_inventory_checkbill_detail d
LEFT JOIN wms_inventory w
ON d.goodsID = w.goodsID
WHERE billSid = #{sid}
AND loseCount > 0
</select>
<select id="sourceBillPkBySid"
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto">
SELECT d.goodsID,
d.goodsSpuSid AS goodsSid,
d.goodsSpuName,
d.goodsSkuSid,
d.goodsSkuTitle AS goodsName,
d.goodsSkuCode AS goodsCode,
d.goodsSkuOwnSpec AS goodsSpec,
d.manufacturerSid,
d.manufacturerName,
d.unit,
d.loseCount AS pKNum,
d.warehouseSid,
d.warehouseName,
d.warehouseRackSid,
d.warehouseRackName,
d.loseCount AS outStorageNum,
w.cost AS inStoragePrice
FROM wms_inventory_checkbill_detail d
LEFT JOIN wms_inventory w
ON d.goodsID = w.goodsID
WHERE billSid = #{sid}
AND loseCount > 0
</select>
</mapper>
Loading…
Cancel
Save