Browse Source

修改生成出入库记录

master
fanzongzhe0036 1 week ago
parent
commit
44f84da5fd
  1. 12
      yxt-as/src/main/java/com/yxt/anrui/as/api/asbusrepairinventorybill/BusrepairInfo.java
  2. 6
      yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillMapper.java
  3. 13
      yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillMapper.xml
  4. 5
      yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillRest.java
  5. 10
      yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillService.java
  6. 19
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsoldinventory/WmsOldInventoryService.java
  7. 2
      yxt-wms-biz/src/main/java/com/yxt/wms/feign/as/AsBusrepairInventorybillFeign.java
  8. 12
      yxt-wms-biz/src/main/java/com/yxt/wms/feign/as/BusrepairInfo.java

12
yxt-as/src/main/java/com/yxt/anrui/as/api/asbusrepairinventorybill/BusrepairInfo.java

@ -0,0 +1,12 @@
package com.yxt.anrui.as.api.asbusrepairinventorybill;
import lombok.Data;
@Data
public class BusrepairInfo {
private String sourceBillSid;
private String billNo;
private String preBillNo;
private String preBillSid;
}

6
yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillMapper.java

@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.anrui.as.api.asbusrepairbill.AsBusrepairBill; import com.yxt.anrui.as.api.asbusrepairbill.AsBusrepairBill;
import com.yxt.anrui.as.api.asbusrepairinventorybill.AsBusrepairBillVo; import com.yxt.anrui.as.api.asbusrepairinventorybill.*;
import com.yxt.anrui.as.api.asbusrepairinventorybill.AsBusrepairInventorybill;
import com.yxt.anrui.as.api.asbusrepairinventorybill.AsBusrepairInventorybillVo;
import com.yxt.anrui.as.api.asbusrepairinventorybill.AsBusrepairinventoryExportVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -39,4 +36,5 @@ public interface AsBusrepairInventorybillMapper extends BaseMapper<AsBusrepairIn
List<AsBusrepairinventoryExportVo> exportExcel(@Param(Constants.WRAPPER)QueryWrapper<AsBusrepairInventorybill> qw); List<AsBusrepairinventoryExportVo> exportExcel(@Param(Constants.WRAPPER)QueryWrapper<AsBusrepairInventorybill> qw);
IPage<AsBusrepairBillVo> listPage(IPage<AsBusrepairBill> page, @Param(Constants.WRAPPER) QueryWrapper<AsBusrepairBill> qw); IPage<AsBusrepairBillVo> listPage(IPage<AsBusrepairBill> page, @Param(Constants.WRAPPER) QueryWrapper<AsBusrepairBill> qw);
BusrepairInfo getInventoryInfo(String sid);
} }

13
yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillMapper.xml

@ -101,4 +101,17 @@
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
</select> </select>
<select id="getInventoryInfo" resultType="com.yxt.anrui.as.api.asbusrepairinventorybill.BusrepairInfo">
SELECT
d.sid preBillSid,
i.sourceBillSid,
i.billNo as preBillNo,
b.billNo
FROM
as_busrepair_inventorybill_detail AS d
LEFT JOIN as_busrepair_inventorybill as i ON d.billSid = i.sid
LEFT JOIN as_busrepair_bill as b ON i.sourceBillSid = b.sid
WHERE d.sid = #{sid}
</select>
</mapper> </mapper>

5
yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillRest.java

@ -112,5 +112,8 @@ public class AsBusrepairInventorybillRest {
ExportExcelUtils.export(fileNameURL, list, AsBusrepairinventoryExportVo.class, response); ExportExcelUtils.export(fileNameURL, list, AsBusrepairinventoryExportVo.class, response);
} }
@GetMapping("/getInventoryInfo")
ResultBean<BusrepairInfo> getInventoryInfo(@RequestParam("sid") String sid) {
return asBusrepairInventorybillService.getInventoryInfo(sid);
}
} }

10
yxt-as/src/main/java/com/yxt/anrui/as/biz/asbusrepairinventorybill/AsBusrepairInventorybillService.java

@ -445,6 +445,8 @@ public class AsBusrepairInventorybillService extends MybatisBaseService<AsBusrep
recordDto.setBillType("0"); recordDto.setBillType("0");
recordDto.setBusTypeKey("11"); recordDto.setBusTypeKey("11");
recordDto.setBusTypeValue("销售出库"); recordDto.setBusTypeValue("销售出库");
recordDto.setPreBillNo(entity.getBillNo());
recordDto.setPreBillSid(detail.getSid());
BeanUtil.copyProperties(inventory, recordDto, "sid", "createBySid"); BeanUtil.copyProperties(inventory, recordDto, "sid", "createBySid");
recordDto.setCount(sDto.getCount()); recordDto.setCount(sDto.getCount());
recordDto.setCurrentCount(subtractCount.toString()); recordDto.setCurrentCount(subtractCount.toString());
@ -475,6 +477,8 @@ public class AsBusrepairInventorybillService extends MybatisBaseService<AsBusrep
recordDto.setBillType("1"); recordDto.setBillType("1");
recordDto.setBusTypeKey("02"); recordDto.setBusTypeKey("02");
recordDto.setBusTypeValue("退货入库"); recordDto.setBusTypeValue("退货入库");
recordDto.setPreBillNo(entity.getBillNo());
recordDto.setPreBillSid(detail.getSid());
BeanUtil.copyProperties(inventory, recordDto, "sid", "createBySid"); BeanUtil.copyProperties(inventory, recordDto, "sid", "createBySid");
recordDto.setCount(sDto.getCount()); recordDto.setCount(sDto.getCount());
recordDto.setCurrentCount(add.toString()); recordDto.setCurrentCount(add.toString());
@ -855,4 +859,10 @@ public class AsBusrepairInventorybillService extends MybatisBaseService<AsBusrep
asBusrepairBillNodeService.insert(billNode); asBusrepairBillNodeService.insert(billNode);
return rb.success(); return rb.success();
} }
public ResultBean<BusrepairInfo> getInventoryInfo(String sid) {
ResultBean rb = ResultBean.fireFail();
BusrepairInfo busrepairInfo = baseMapper.getInventoryInfo(sid);
return rb.success();
}
} }

19
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsoldinventory/WmsOldInventoryService.java

@ -19,6 +19,8 @@ import com.yxt.wms.biz.inventory.wmsinventory.WmsInventoryService;
import com.yxt.wms.biz.inventory.wmsinventory.WmsUpdateCountQuery; import com.yxt.wms.biz.inventory.wmsinventory.WmsUpdateCountQuery;
import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecord; import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecord;
import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecordService; import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecordService;
import com.yxt.wms.feign.as.AsBusrepairInventorybillFeign;
import com.yxt.wms.feign.as.BusrepairInfo;
import com.yxt.wms.feign.as.asbusrepairbill.AsBusrepairBill; import com.yxt.wms.feign.as.asbusrepairbill.AsBusrepairBill;
import com.yxt.wms.feign.as.asbusrepairbill.AsBusrepairBillFeign; import com.yxt.wms.feign.as.asbusrepairbill.AsBusrepairBillFeign;
import com.yxt.wms.feign.as.asbusrepairinventorybilldetail.AsBusrepairInventorybillDetail; import com.yxt.wms.feign.as.asbusrepairinventorybilldetail.AsBusrepairInventorybillDetail;
@ -46,6 +48,8 @@ import java.util.List;
@Service @Service
public class WmsOldInventoryService extends MybatisBaseService<WmsOldInventoryMapper, WmsOldInventory> { public class WmsOldInventoryService extends MybatisBaseService<WmsOldInventoryMapper, WmsOldInventory> {
@Autowired
private AsBusrepairInventorybillFeign asBusrepairInventorybillFeign;
@Autowired @Autowired
private WmsInventoryService wmsInventoryService; private WmsInventoryService wmsInventoryService;
@Autowired @Autowired
@ -157,6 +161,7 @@ public class WmsOldInventoryService extends MybatisBaseService<WmsOldInventoryMa
dto.setUseOrgSid(useOrgSid); dto.setUseOrgSid(useOrgSid);
kcSid = wmsInventoryService.saveWmsInventory(dto).getData(); kcSid = wmsInventoryService.saveWmsInventory(dto).getData();
} }
String sid = wmsBusrepairInventorybillDetailOld.getSid();
//生成出入库记录 //生成出入库记录
WmsInventoryRecord wmsInventoryRecord = new WmsInventoryRecord(); WmsInventoryRecord wmsInventoryRecord = new WmsInventoryRecord();
wmsInventoryRecord.setCreateBySid(wmsOldGroundConfirm.getCreateBySid()); wmsInventoryRecord.setCreateBySid(wmsOldGroundConfirm.getCreateBySid());
@ -165,6 +170,13 @@ public class WmsOldInventoryService extends MybatisBaseService<WmsOldInventoryMa
wmsInventoryRecord.setBillType("1"); wmsInventoryRecord.setBillType("1");
wmsInventoryRecord.setBusTypeKey("09"); wmsInventoryRecord.setBusTypeKey("09");
wmsInventoryRecord.setBusTypeValue("其他入库"); wmsInventoryRecord.setBusTypeValue("其他入库");
BusrepairInfo busrepairInfo = asBusrepairInventorybillFeign.getInventoryInfo(sid).getData();
if (null != busrepairInfo) {
wmsInventoryRecord.setSourceBillSid(busrepairInfo.getSourceBillSid());
wmsInventoryRecord.setBillNo(busrepairInfo.getBillNo());
wmsInventoryRecord.setPreBillNo(busrepairInfo.getPreBillNo());
wmsInventoryRecord.setPreBillSid(busrepairInfo.getPreBillSid());
}
wmsInventoryRecord.setManufacturerName(wmsBusrepairInventorybillDetailOld.getManufacturerName()); wmsInventoryRecord.setManufacturerName(wmsBusrepairInventorybillDetailOld.getManufacturerName());
wmsInventoryRecord.setGoodsSpuSid(wmsBusrepairInventorybillDetailOld.getGoodsSpuSid()); wmsInventoryRecord.setGoodsSpuSid(wmsBusrepairInventorybillDetailOld.getGoodsSpuSid());
wmsInventoryRecord.setGoodsSpuName(wmsBusrepairInventorybillDetailOld.getGoodsSpuName()); wmsInventoryRecord.setGoodsSpuName(wmsBusrepairInventorybillDetailOld.getGoodsSpuName());
@ -613,6 +625,13 @@ public class WmsOldInventoryService extends MybatisBaseService<WmsOldInventoryMa
} }
//生成出入库记录 //生成出入库记录
WmsInventoryRecord wmsInventoryRecord = new WmsInventoryRecord(); WmsInventoryRecord wmsInventoryRecord = new WmsInventoryRecord();
BusrepairInfo busrepairInfo = asBusrepairInventorybillFeign.getInventoryInfo(asBusrepairInventorybillDetail.getSid()).getData();
if (null != busrepairInfo) {
wmsInventoryRecord.setSourceBillSid(busrepairInfo.getSourceBillSid());
wmsInventoryRecord.setBillNo(busrepairInfo.getBillNo());
wmsInventoryRecord.setPreBillNo(busrepairInfo.getPreBillNo());
wmsInventoryRecord.setPreBillSid(busrepairInfo.getPreBillSid());
}
wmsInventoryRecord.setCreateBySid(wmsOldGroundConfirm.getCreateBySid()); wmsInventoryRecord.setCreateBySid(wmsOldGroundConfirm.getCreateBySid());
wmsInventoryRecord.setInventorySid(kcSid); wmsInventoryRecord.setInventorySid(kcSid);
wmsInventoryRecord.setSourceBillSid(asBusrepairBill.getSid()); wmsInventoryRecord.setSourceBillSid(asBusrepairBill.getSid());

2
yxt-wms-biz/src/main/java/com/yxt/wms/feign/as/AsBusrepairInventorybillFeign.java

@ -28,4 +28,6 @@ public interface AsBusrepairInventorybillFeign {
@GetMapping("/fetchBySid") @GetMapping("/fetchBySid")
ResultBean<AsBusrepairInventorybill> fetchBySid(@RequestParam("sid") String sid); ResultBean<AsBusrepairInventorybill> fetchBySid(@RequestParam("sid") String sid);
@GetMapping("/getInventoryInfo")
ResultBean<BusrepairInfo> getInventoryInfo(@RequestParam("sid") String sid);
} }

12
yxt-wms-biz/src/main/java/com/yxt/wms/feign/as/BusrepairInfo.java

@ -0,0 +1,12 @@
package com.yxt.wms.feign.as;
import lombok.Data;
@Data
public class BusrepairInfo {
private String sourceBillSid;
private String billNo;
private String preBillNo;
private String preBillSid;
}
Loading…
Cancel
Save