opt:提交erp组盘下发接口
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.ext_manage.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.ext_manage.service.AcsToWmsService;
|
||||
@@ -34,4 +35,11 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/apply")
|
||||
@Log("ACS向LMS申请任务")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> apply(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.acsApply(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,13 +39,6 @@ public class ErpToWmsController {
|
||||
return new ResponseEntity<>(erpToWmsService.erpQueryIvt(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/task")
|
||||
@Log("下发出库单据")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> sendTask(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(erpToWmsService.sendTask(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/groupplate")
|
||||
@Log("下发组盘信息")
|
||||
@SaIgnore
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.nl.wms.ext_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -20,4 +22,7 @@ public interface AcsToWmsService {
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> receiveTaskStatusAcs(String string);
|
||||
|
||||
/** ACS请求接口 */
|
||||
Map<String, Object> acsApply(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -25,38 +25,17 @@ public interface ErpToWmsService {
|
||||
ErpResponse erpQueryIvt(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 下发出库单据
|
||||
* 下发组盘单据
|
||||
* @param whereJson: {
|
||||
* stor_code:仓库编码
|
||||
* inv_code:单据号(可为空)
|
||||
* task_type :业务类型(可为空)
|
||||
* data : [
|
||||
* {
|
||||
* mater_code:物料编码
|
||||
* batch_no:批次号(可为空)
|
||||
* vehicle_code:托盘号
|
||||
* vehicle_code2:料框号
|
||||
* quantity:数量
|
||||
* unit_code:计量单位
|
||||
* unit_name:计量单位名称
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* @return ErpResponse
|
||||
*/
|
||||
ErpResponse sendTask(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 下发出库单据
|
||||
* @param whereJson: {
|
||||
* stor_code:仓库编码
|
||||
* inv_code:单据号(可为空)
|
||||
* task_type :业务类型(可为空)
|
||||
* data : [
|
||||
* {
|
||||
* mater_code:物料编码
|
||||
* batch_no:批次号(可为空)
|
||||
* quantity:数量
|
||||
* unit_code:计量单位
|
||||
* unit_name:计量单位名称
|
||||
* ext_code:单据号
|
||||
* ext_type:单据类型
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package org.nl.wms.ext_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext_manage.enums.ResultAcsStatus;
|
||||
import org.nl.wms.ext_manage.service.AcsToWmsService;
|
||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.service.dao.mapper.PmFormDataMapper;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.TaskFactory;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateMapper;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -19,6 +27,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -39,13 +49,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
*/
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
/*
|
||||
* 任务服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
@Resource
|
||||
private PmFormDataMapper pmFormDataMapper;
|
||||
/**
|
||||
* 任务工厂服务
|
||||
*/
|
||||
@@ -103,4 +114,65 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("acs向lms反馈任务状态,返回参数:--------------------------------------" + result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public Map<String, Object> acsApply(JSONObject param) {
|
||||
JSONObject result = new JSONObject();
|
||||
param.put("user_id", "3");
|
||||
param.put("person_name","ACS");
|
||||
try {
|
||||
result = this.applyInTask(param);
|
||||
} catch (Exception e) {
|
||||
log.error("ACS请求LMS出现错误: {}{}", e,e.getMessage());
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message", "申请任务失败!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请入库任务
|
||||
*
|
||||
* @param param
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public JSONObject applyInTask(JSONObject param) throws BadRequestException {
|
||||
JSONObject result = new JSONObject();
|
||||
log.info("ACS请求apply参数: {}", param);
|
||||
// 申请任务
|
||||
SchBaseTask task = new SchBaseTask(); // 任务实体
|
||||
//起点
|
||||
String device_code = param.getString("device_code"); // 请求点
|
||||
String vehicle_code = param.getString("vehicle_code");//子托盘
|
||||
if(ObjectUtil.isNotEmpty(vehicle_code)) {
|
||||
vehicle_code = vehicle_code.trim();
|
||||
}
|
||||
//子托盘非空
|
||||
if(ObjectUtil.isNotEmpty(vehicle_code)) {
|
||||
Assert.isFalse(vehicle_code.contains(";"),
|
||||
"该任务申请托盘["+vehicle_code+"]存在串读,无法申请任务!");
|
||||
}else{
|
||||
Assert.isFalse(ObjectUtil.isEmpty(vehicle_code),
|
||||
"该任务申请托盘["+vehicle_code+"]为空,无法申请任务!");
|
||||
}
|
||||
//判断该子托盘是否存在未完成任务
|
||||
Integer sub_tray_lists = iSchBaseTaskService.findUnFinishTasksBySub_tray(vehicle_code);
|
||||
Assert.isFalse(sub_tray_lists>0,
|
||||
"该任务申请托盘["+vehicle_code+"]已存在未完成的任务,无法申请任务!");
|
||||
|
||||
//校验组盘单据信息
|
||||
LambdaQueryWrapper<PmFormData> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PmFormData::getVehicle_code,vehicle_code);
|
||||
wrapper.eq(PmFormData::getStatus, IOSEnum.BILL_STATUS.code("生成"));
|
||||
List<PmFormData> list = pmFormDataMapper.selectList(wrapper);
|
||||
Assert.isFalse(list.size()<=0, "该任务申请托盘["+vehicle_code+"]异常,无入库组盘单据信息!");
|
||||
|
||||
|
||||
//todo 查询组盘数据,生成入库单,自动分配,生成任务
|
||||
//String task_code =taskService.create(task);
|
||||
//result.put("task_code",task_code);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.nl.wms.ext_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
@@ -15,11 +15,17 @@ import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.ext_manage.service.ErpToWmsService;
|
||||
import org.nl.wms.ext_manage.service.util.ErpResponse;
|
||||
import org.nl.wms.pm_manage.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.IOutBillService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -41,6 +47,11 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
||||
@Autowired
|
||||
private IBsrealStorattrService iBsrealStorattrService;
|
||||
|
||||
@Autowired
|
||||
private IPmFormDataService iPmFormDataService;
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
/**
|
||||
* 物料基础数据服务
|
||||
*/
|
||||
@@ -73,82 +84,14 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
||||
return erpResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpResponse sendTask(JSONObject whereJson) {
|
||||
log.info("sendTask下发出库任务接口输入参数为:-------------------" + whereJson.toString());
|
||||
// 组织主表数据
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonMst.put("source_id", whereJson.getString("inv_code"));
|
||||
jsonMst.put("source_type", whereJson.getString("task_type"));
|
||||
jsonMst.put("bill_type", whereJson.getString("task_type"));
|
||||
jsonMst.put("user", "erp");
|
||||
// 查询仓库
|
||||
BsrealStorattr storDao = iBsrealStorattrService.findByCode(whereJson.getString("stor_code"));
|
||||
if (storDao == null) {
|
||||
throw new BadRequestException("仓库不存在");
|
||||
}
|
||||
jsonMst.put("stor_id", storDao.getStor_id());
|
||||
// 组织明细
|
||||
List<JSONObject> dataList = whereJson.getJSONArray("data").toJavaList(JSONObject.class);
|
||||
// 查询所有物料
|
||||
List<MdMeMaterialbase> materDaoList = iMdMeMaterialbaseService.list(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||
.in(MdMeMaterialbase::getMaterial_code, dataList.stream()
|
||||
.map(row -> row.getString("mater_code"))
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
);
|
||||
// 查询所有计量单位
|
||||
List<MdPbMeasureunit> unitDaoList = iMdPbMeasureunitService.list(
|
||||
new QueryWrapper<MdPbMeasureunit>().lambda()
|
||||
.in(MdPbMeasureunit::getUnit_code, dataList.stream()
|
||||
.map(row -> row.getString("unit_code"))
|
||||
.collect(Collectors.toList()))
|
||||
);
|
||||
// 明细集合
|
||||
JSONArray dtlArr = new JSONArray();
|
||||
for (JSONObject json : dataList) {
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
MdMeMaterialbase materDao = materDaoList.stream()
|
||||
.filter(row -> row.getMaterial_code().equals(json.getString("mater_code")))
|
||||
.findFirst().orElse(null);
|
||||
jsonDtl.put("material_id", materDao.getMaterial_id());
|
||||
jsonDtl.put("pcsn", json.getString("batch_no"));
|
||||
MdPbMeasureunit unitDao = unitDaoList.stream()
|
||||
.filter(row -> row.getUnit_code().equals(json.getString("unit_code")))
|
||||
.findFirst().orElse(null);
|
||||
jsonDtl.put("qty_unit_id", unitDao.getMeasure_unit_id());
|
||||
jsonDtl.put("qty_unit_name", unitDao.getUnit_name());
|
||||
jsonDtl.put("qty", json.getString("quantity"));
|
||||
dtlArr.add(jsonDtl);
|
||||
}
|
||||
jsonMst.put("tableData",dtlArr);
|
||||
// 调用出库单新增服务
|
||||
iOutBillService.insertDtl(jsonMst);
|
||||
|
||||
log.info("sendTask下发出库任务接口输出参数为:-------------------" + ErpResponse.requestOk().toString());
|
||||
return ErpResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpResponse sendGroupplate(JSONObject whereJson) {
|
||||
log.info("sendTask下发出库任务接口输入参数为:-------------------" + whereJson.toString());
|
||||
// 组织主表数据
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonMst.put("source_id", whereJson.getString("inv_code"));
|
||||
jsonMst.put("source_type", whereJson.getString("task_type"));
|
||||
jsonMst.put("bill_type", whereJson.getString("task_type"));
|
||||
jsonMst.put("user", "erp");
|
||||
log.info("sendGroupplate下发组盘接口输入参数为:-------------------" + whereJson.toString());
|
||||
// 查询仓库
|
||||
BsrealStorattr storDao = iBsrealStorattrService.findByCode(whereJson.getString("stor_code"));
|
||||
BsrealStorattr storDao = iBsrealStorattrService.findByCode("GW");
|
||||
if (storDao == null) {
|
||||
throw new BadRequestException("仓库不存在");
|
||||
}
|
||||
jsonMst.put("stor_id", storDao.getStor_id());
|
||||
// 组织明细
|
||||
List<JSONObject> dataList = whereJson.getJSONArray("data").toJavaList(JSONObject.class);
|
||||
// 查询所有物料
|
||||
@@ -167,27 +110,56 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
||||
.collect(Collectors.toList()))
|
||||
);
|
||||
// 明细集合
|
||||
JSONArray dtlArr = new JSONArray();
|
||||
List<PmFormData> dtlArr = new ArrayList<>();
|
||||
// 明细集合
|
||||
List<GroupPlate> plates = new ArrayList<>();
|
||||
for (JSONObject json : dataList) {
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
PmFormData jsonDtl = new PmFormData();
|
||||
MdMeMaterialbase materDao = materDaoList.stream()
|
||||
.filter(row -> row.getMaterial_code().equals(json.getString("mater_code")))
|
||||
.findFirst().orElse(null);
|
||||
jsonDtl.put("material_id", materDao.getMaterial_id());
|
||||
jsonDtl.put("pcsn", json.getString("batch_no"));
|
||||
jsonDtl.setId(IdUtil.getStringId());
|
||||
jsonDtl.setCode(json.getString("ext_code"));
|
||||
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonDtl.setStor_id(storDao.getStor_id());
|
||||
jsonDtl.setStor_name(storDao.getStor_name());
|
||||
jsonDtl.setForm_type(json.getString("ext_type"));
|
||||
jsonDtl.setSource_form_date(DateUtil.today());
|
||||
jsonDtl.setMaterial_code(json.getString("mater_code"));
|
||||
jsonDtl.setMaterial_id(materDao.getMaterial_id());
|
||||
jsonDtl.setQty(BigDecimal.valueOf(json.getDoubleValue("quantity")));
|
||||
jsonDtl.setPlan_qty(BigDecimal.valueOf(json.getDoubleValue("quantity")));
|
||||
MdPbMeasureunit unitDao = unitDaoList.stream()
|
||||
.filter(row -> row.getUnit_code().equals(json.getString("unit_code")))
|
||||
.findFirst().orElse(null);
|
||||
jsonDtl.put("qty_unit_id", unitDao.getMeasure_unit_id());
|
||||
jsonDtl.put("qty_unit_name", unitDao.getUnit_name());
|
||||
jsonDtl.put("qty", json.getString("quantity"));
|
||||
jsonDtl.setUnit_id(unitDao.getMeasure_unit_id());
|
||||
jsonDtl.setUnit_name(unitDao.getUnit_name());
|
||||
jsonDtl.setVehicle_code(json.getString("vehicle_code"));
|
||||
jsonDtl.setVehicle_code2(json.getString("vehicle_code2"));
|
||||
jsonDtl.setCreate_name("ERP");
|
||||
jsonDtl.setCreate_time(DateUtil.now());
|
||||
dtlArr.add(jsonDtl);
|
||||
}
|
||||
jsonMst.put("tableData",dtlArr);
|
||||
// 调用出库单新增服务
|
||||
iOutBillService.insertDtl(jsonMst);
|
||||
|
||||
log.info("sendTask下发出库任务接口输出参数为:-------------------" + ErpResponse.requestOk().toString());
|
||||
GroupPlate plate = new GroupPlate();
|
||||
plate.setGroup_id(IdUtil.getStringId());
|
||||
plate.setStoragevehicle_code(json.getString("vehicle_code"));
|
||||
plate.setMaterial_id(materDao.getMaterial_id());
|
||||
plate.setQty_unit_id(unitDao.getMeasure_unit_id());
|
||||
plate.setQty_unit_name(unitDao.getUnit_name());
|
||||
plate.setQty(BigDecimal.valueOf(json.getDoubleValue("quantity")));
|
||||
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
|
||||
plate.setExt_code(json.getString("ext_code"));
|
||||
plate.setExt_type(json.getString("ext_type"));
|
||||
plate.setCreate_name("ERP");
|
||||
plate.setCreate_time(DateUtil.now());
|
||||
plates.add(plate);
|
||||
}
|
||||
//保存组盘记录到单据表
|
||||
iPmFormDataService.saveBatch(dtlArr);
|
||||
//保存组盘记录到组盘表
|
||||
iMdPbGroupplateService.saveBatch(plates);
|
||||
|
||||
log.info("sendGroupplate下发组盘接口输出参数为:-------------------" + ErpResponse.requestOk().toString());
|
||||
return ErpResponse.requestOk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
package org.nl.wms.pda_manage.ios_manage.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda_manage.ios_manage.service.PdaIosCheckService;
|
||||
import org.nl.wms.pda_manage.ios_manage.service.PdaIosInService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持盘点确认 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/groupMater")
|
||||
@Slf4j
|
||||
public class PdaIosCheckController {
|
||||
|
||||
@Autowired
|
||||
private PdaIosCheckService pdaIosCheckService;
|
||||
@Autowired
|
||||
private PdaIosInService pdaIosInService;
|
||||
@PostMapping("/getDtl")
|
||||
@Log("获取盘点明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosCheckService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组盘获取物料列表
|
||||
*/
|
||||
@PostMapping("/maters")
|
||||
@Log("获取物料列表")
|
||||
@SaIgnore
|
||||
public ResponseEntity<TableDataInfo<MdMeMaterialbase>> getMaterialList(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getMaterialList(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("确认")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosCheckService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package org.nl.wms.pda_manage.ios_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持盘点确认 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-06-06
|
||||
*/
|
||||
public interface PdaIosCheckService extends IService<StIvtCheckdtl> {
|
||||
|
||||
/**
|
||||
* 获取盘点明细
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
* struct_code: 仓位
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 确认
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
* struct_code:仓位编码
|
||||
* data: [
|
||||
* checkdtl_id: 明细标识
|
||||
* bill_code: 单据编码
|
||||
* bill_code: 单据编码
|
||||
* pcsn: 批次
|
||||
* base_qty: 库存数量
|
||||
* fac_qty: 盘点数量
|
||||
* qty_unit_name: 单位
|
||||
* ]
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse confirm(JSONObject whereJson);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package org.nl.wms.pda_manage.ios_manage.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.pda_manage.ios_manage.service.PdaIosCheckService;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.StIvtCheckdtlMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持盘点确认 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-06-06
|
||||
*/
|
||||
@Service
|
||||
public class PdaIosCheckServiceImpl extends ServiceImpl<StIvtCheckdtlMapper, StIvtCheckdtl> implements PdaIosCheckService {
|
||||
|
||||
/**
|
||||
* 盘点单主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
/**
|
||||
* 盘点单明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckdtlService iStIvtCheckdtlService;
|
||||
|
||||
@Override
|
||||
public PdaResponse getDtl(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(this.baseMapper.getPdaDtl(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirm(JSONObject whereJson) {
|
||||
List<JSONObject> dataList = whereJson.getJSONArray("data").toJavaList(JSONObject.class);
|
||||
// 查询明细
|
||||
List<StIvtCheckdtl> dtlDaoList = this.list(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.in(StIvtCheckdtl::getCheckdtl_id, dataList.stream()
|
||||
.map(row -> row.getString("checkdtl_id"))
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
);
|
||||
// 需要更新的明细集合
|
||||
List<StIvtCheckdtl> needUpdateList = new ArrayList<>();
|
||||
for (JSONObject json : dataList) {
|
||||
StIvtCheckdtl dtlDao = dtlDaoList.stream()
|
||||
.filter(row -> row.getCheckdtl_id().equals(json.getString("checkdtl_id")))
|
||||
.findFirst().orElse(null);
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("完成"));
|
||||
dtlDao.setFac_qty(json.getBigDecimal("fac_qty"));
|
||||
needUpdateList.add(dtlDao);
|
||||
}
|
||||
// 更新明细
|
||||
this.updateBatchById(needUpdateList);
|
||||
// 更新主表状态
|
||||
iStIvtCheckmstService.updateMst(dtlDaoList.get(0).getCheck_id());
|
||||
// 创建损益单
|
||||
iStIvtCheckdtlService.createMore(needUpdateList,dtlDaoList.get(0).getCheck_id());
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
}
|
||||
@@ -67,12 +67,20 @@ public class PmFormData extends Model<PmFormData> {
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料code
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
@@ -105,9 +113,9 @@ public class PmFormData extends Model<PmFormData> {
|
||||
|
||||
|
||||
/**
|
||||
* 载具组盘id
|
||||
* 料框号
|
||||
*/
|
||||
private String vehicle_id;
|
||||
private String vehicle_code2;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,5 +72,10 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
SchBaseTask getByCode(String taskCode);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据任务号和子托盘查询未完成的任务
|
||||
* @param sub_tray
|
||||
* @return
|
||||
*/
|
||||
Integer findUnFinishTasksBySub_tray(String sub_tray);
|
||||
}
|
||||
|
||||
@@ -48,9 +48,6 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
@Autowired
|
||||
private SchBaseTaskMapper schBaseTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Autowired
|
||||
private TaskFactory taskFactory;
|
||||
|
||||
@@ -167,7 +164,16 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
return this.getOne(lam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer findUnFinishTasksBySub_tray(String sub_tray) {
|
||||
Assert.notNull(sub_tray, "托盘不能为空!");
|
||||
LambdaQueryWrapper<SchBaseTask> lam = new LambdaQueryWrapper<>();
|
||||
lam.lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode())
|
||||
.eq(SchBaseTask::getVehicle_code, sub_tray)
|
||||
.eq(SchBaseTask::getIs_delete, false);
|
||||
Integer taskCount = schBaseTaskMapper.selectCount(lam);
|
||||
return taskCount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.controller;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_manage.service.dto.CheckInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/check")
|
||||
@Slf4j
|
||||
public class CheckController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询盘点单")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtCheckmstService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增盘点单")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改盘点单")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除盘点单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iStIvtCheckmstService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getDtl")
|
||||
@Log("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtCheckmstService.getDtl(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveCheck")
|
||||
@Log("保存盘点")
|
||||
public ResponseEntity<Object> saveCheck(@RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.saveCheck(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("确认盘点")
|
||||
public ResponseEntity<Object> confirm(@RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.confirm(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.controller;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtMoreorlessmstService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_manage.service.dto.MoreOrLessInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损益 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/moreorLess")
|
||||
@Slf4j
|
||||
public class MoreOrlessController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtMoreorlessmstService iStIvtMoreorlessmstService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询损益单")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtMoreorlessmstService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增损益单")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MoreOrLessInsertDto dto) {
|
||||
iStIvtMoreorlessmstService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改损益单")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MoreOrLessInsertDto dto) {
|
||||
iStIvtMoreorlessmstService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除损益单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iStIvtMoreorlessmstService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryMolDtl")
|
||||
@Log("查询损益单明细")
|
||||
public ResponseEntity<Object> queryMolDtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtMoreorlessmstService.queryMolDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody StIvtMoreorlessmst dao) {
|
||||
iStIvtMoreorlessmstService.confirm(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,21 +52,6 @@ public enum IOSEnum {
|
||||
|
||||
// 移库单明细状态
|
||||
MOVE_DTL_STATUS(MapOf.of("生成", "10", "执行中", "20", "完成", "99")),
|
||||
|
||||
// 损益单据类型
|
||||
MORE_MST_TYPE(MapOf.of("手工损益", "1001", "盘点损益", "1002")),
|
||||
|
||||
// 损益单状态
|
||||
MORE_MST_STATUS(MapOf.of("生成", "10", "审核", "20", "完成", "99")),
|
||||
|
||||
// 损益类型
|
||||
MORE_TYPE(MapOf.of("损", "1", "溢", "2")),
|
||||
|
||||
// 盘点单主表状态
|
||||
CHECK_MST_STATUS(MapOf.of("生成", "10", "盘点中", "20", "完成", "99")),
|
||||
|
||||
// 盘点明细状态
|
||||
CHECK_DTL_STATUS(MapOf.of("生成", "10", "盘点中", "20", "已盘点", "30", "完成", "99")),
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dto.CheckInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单明细表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface IStIvtCheckdtlService extends IService<StIvtCheckdtl> {
|
||||
|
||||
/**
|
||||
* 新增明细
|
||||
* @param dto 新增修改实体dto
|
||||
*/
|
||||
void createCheckDtl(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson {
|
||||
* check_id:主表标识
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 创建损益单据
|
||||
* @param list 明细实体类集合
|
||||
*/
|
||||
void createMore(List<StIvtCheckdtl> list, String check_id);
|
||||
|
||||
/**
|
||||
* 手持盘点获取明细
|
||||
* @param whereJson {
|
||||
* storagevehicle_code:载具号
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getPdaDtl(JSONObject whereJson);
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_manage.service.dto.CheckInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单主表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface IStIvtCheckmstService extends IService<StIvtCheckmst> {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<StIvtCheckmst> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增盘点单
|
||||
* @param dto 新增修改实体dto
|
||||
*/
|
||||
void create(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 修改盘点单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
void update(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 删除盘点单
|
||||
* @param ids 标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson {
|
||||
* check_id: 主表标识
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 保存盘点单
|
||||
* @param dto 新增修改dto实体类
|
||||
*/
|
||||
void saveCheck(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 确认盘点
|
||||
* @param dto 新增修改dto实体类
|
||||
*/
|
||||
void confirm(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 更新主表状态
|
||||
* @param check_id 主表id
|
||||
*/
|
||||
void updateMst(String check_id);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dto.MoreOrLessInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface IStIvtMoreorlessdtlService extends IService<StIvtMoreorlessdtl> {
|
||||
|
||||
/**
|
||||
* 创建明细
|
||||
* @param dto 新增修改实体类
|
||||
*/
|
||||
void createMoreDtl(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 查询明细
|
||||
* @param whereJson {
|
||||
* mol_id:标识id
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryMolDtl(Map whereJson);
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_manage.service.dto.MoreOrLessInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface IStIvtMoreorlessmstService extends IService<StIvtMoreorlessmst> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<JSONObject> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增损益单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
String create(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 修改损益单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
void update(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 删除损益单
|
||||
* @param ids id集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 查询损益单明细
|
||||
* @param whereJson {
|
||||
* mol_id: 标识id
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryMolDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
* @param dao 主表实体类
|
||||
*/
|
||||
void confirm(StIvtMoreorlessmst dao);
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface StIvtCheckdtlMapper extends BaseMapper<StIvtCheckdtl> {
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson {
|
||||
* check_id 主表标识
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getDtl(@Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 手持获取盘点明细
|
||||
* @param whereJson {
|
||||
* storagevehicle_code:载具编码
|
||||
* struct_code: 仓位
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getPdaDtl(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?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="org.nl.wms.warehouse_manage.service.dao.mapper.StIvtCheckdtlMapper">
|
||||
|
||||
<select id="getDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dtl.*,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
sect.sect_name,
|
||||
attr.struct_name
|
||||
FROM
|
||||
st_ivt_checkdtl dtl
|
||||
LEFT JOIN st_ivt_checkmst ios ON ios.check_id = dtl.check_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
LEFT JOIN st_ivt_sectattr sect ON sect.sect_code = dtl.sect_code
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_code = dtl.struct_code
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.check_id != null and param.check_id != ''">
|
||||
AND
|
||||
ios.check_id = #{param.check_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPdaDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dtl.checkdtl_id,
|
||||
ios.check_code AS bill_code,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
dtl.pcsn,
|
||||
dtl.base_qty,
|
||||
dtl.fac_qty,
|
||||
dtl.qty_unit_name
|
||||
FROM
|
||||
st_ivt_checkdtl dtl
|
||||
LEFT JOIN st_ivt_checkmst ios ON ios.check_id = dtl.check_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
<where>
|
||||
dtl.status IN ('10','20')
|
||||
AND ios.status IN ('10','20')
|
||||
AND ios.is_delete = '0'
|
||||
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">
|
||||
AND
|
||||
dtl.storagevehicle_code = #{param.storagevehicle_code}
|
||||
</if>
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
dtl.struct_code = #{param.struct_code}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckmst;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface StIvtCheckmstMapper extends BaseMapper<StIvtCheckmst> {
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?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="org.nl.wms.warehouse_manage.service.dao.mapper.StIvtCheckmstMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface StIvtMoreorlessdtlMapper extends BaseMapper<StIvtMoreorlessdtl> {
|
||||
|
||||
/**
|
||||
* 查询明细
|
||||
* @param whereJson {
|
||||
* mol_id 标识id
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryMolDtl(@Param("param") Map whereJson);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?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="org.nl.wms.warehouse_manage.service.dao.mapper.StIvtMoreorlessdtlMapper">
|
||||
|
||||
<select id="queryMolDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dtl.mol_dtl_id,
|
||||
dtl.sect_code,
|
||||
dtl.struct_code,
|
||||
dtl.storagevehicle_code,
|
||||
dtl.material_id,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
dtl.pcsn,
|
||||
dtl.qty_unit_id,
|
||||
dtl.qty_unit_name,
|
||||
dtl.mol_qty,
|
||||
dtl.status,
|
||||
dtl.source_bill_code,
|
||||
ext.qty AS ivt_qty
|
||||
FROM
|
||||
st_ivt_moreorlessdtl dtl
|
||||
LEFT JOIN st_ivt_moreorlessmst ios ON ios.mol_id = dtl.mol_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
INNER JOIN md_pb_groupplate ext ON ext.storagevehicle_code = dtl.storagevehicle_code
|
||||
AND ext.material_id = dtl.material_id AND dtl.pcsn = ext.pcsn
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.mol_id != null and param.mol_id != ''">
|
||||
AND
|
||||
ios.mol_id = #{param.mol_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessmst;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface StIvtMoreorlessmstMapper extends BaseMapper<StIvtMoreorlessmst> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page,@Param("param") Map whereJson);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?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="org.nl.wms.warehouse_manage.service.dao.mapper.StIvtMoreorlessmstMapper">
|
||||
|
||||
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ios.*
|
||||
FROM
|
||||
st_ivt_moreorlessmst ios
|
||||
LEFT JOIN st_ivt_moreorlessdtl dtl ON ios.mol_id = dtl.mol_id
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.mol_code != null and param.mol_code != ''">
|
||||
AND
|
||||
ios.mol_code LIKE #{param.mol_code}
|
||||
</if>
|
||||
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
ios.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
dtl.struct_code LIKE #{param.struct_code}
|
||||
</if>
|
||||
|
||||
<if test="param.mol_type != null and param.mol_type != ''">
|
||||
AND
|
||||
ios.mol_type = #{param.mol_type}
|
||||
</if>
|
||||
|
||||
<if test="param.mol_inv_type != null and param.mol_inv_type != ''">
|
||||
AND
|
||||
ios.mol_inv_type = #{param.mol_inv_type}
|
||||
</if>
|
||||
|
||||
<if test="param.status != null and param.status != ''">
|
||||
AND
|
||||
ios.status = #{param.status}
|
||||
</if>
|
||||
|
||||
<if test="param.begin_time != null and param.begin_time != ''">
|
||||
AND
|
||||
ios.input_time >= #{param.begin_time}
|
||||
</if>
|
||||
<if test="param.end_time != null and param.end_time != ''">
|
||||
AND
|
||||
#{param.end_time} >= ios.input_time
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ios.input_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,75 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点新增修改dto实体类
|
||||
* @author Liuxy
|
||||
* 2025/5/29
|
||||
*/
|
||||
@Data
|
||||
public class CheckInsertDto {
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
*/
|
||||
private String check_id;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String check_type;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private BigDecimal dtl_num;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 明细数据:
|
||||
* {
|
||||
* sect_code 库区
|
||||
* struct_code 货位
|
||||
* storagevehicle_code 载具编码
|
||||
* material_id 物料id
|
||||
* material_code 物料编码
|
||||
* pcsn 批次
|
||||
* base_qty 库存数量
|
||||
* fac_qty 盘点数量
|
||||
* qty_unit_id 计量单位标识
|
||||
* qty_unit_name 计量单位名称
|
||||
* status 状态
|
||||
* remark 备注
|
||||
* }
|
||||
*/
|
||||
private List<JSONObject> tableData;
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 损益新增修改dto实体类
|
||||
* @author Liuxy
|
||||
* 2025/5/28
|
||||
*/
|
||||
@Data
|
||||
public class MoreOrLessInsertDto {
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
*/
|
||||
private String mol_id;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String mol_inv_type;
|
||||
|
||||
/**
|
||||
* 损益类型
|
||||
*/
|
||||
private String mol_type;
|
||||
|
||||
/**
|
||||
* 业务日期
|
||||
*/
|
||||
private String biz_date;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private BigDecimal dtl_num;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
private BigDecimal total_qty;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 明细数据:
|
||||
* {
|
||||
* material_code 物料编码
|
||||
* material_id 物料id
|
||||
* material_name 物料名称
|
||||
* pcsn 批次
|
||||
* ivt_qty 库存数量
|
||||
* mol_qty 损益数量
|
||||
* qty_unit_id 计量单位标识
|
||||
* qty_unit_name 计量单位名称
|
||||
* storagevehicle_code 载具编码
|
||||
* sect_code 库区
|
||||
* struct_code 仓位
|
||||
* status 执行状态
|
||||
* remark 备注
|
||||
* source_bill_code 源单据编码(盘点业务使用)
|
||||
* }
|
||||
*/
|
||||
private List<JSONObject> tableData;
|
||||
}
|
||||
@@ -534,10 +534,6 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
task_form.put("PickingLocation", point_code);
|
||||
task_form.put("PlacedLocation", ioStorInvDis.getStruct_code());
|
||||
task_form.put("vehicle_code", map.get("storagevehicle_code"));
|
||||
// GroupPlate groupPlate = mdPbGroupplateMapper.selectOne(new LambdaQueryWrapper<>(GroupPlate.class)
|
||||
// .eq(GroupPlate::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
// );
|
||||
// task_form.put("group_id", groupPlate.getGroup_id());
|
||||
StInTask stInTask = SpringContextHolder.getBean("STInTask");
|
||||
|
||||
String task_id = stInTask.create(task_form);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class RetrunServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
lambda.ge(ObjectUtil.isNotEmpty(begin_time), IOStorInv::getInput_time, begin_time);
|
||||
lambda.lt(ObjectUtil.isNotEmpty(end_time), IOStorInv::getInput_time, end_time);
|
||||
lambda.eq(IOStorInv::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
lambda.eq(IOStorInv::getBill_status, IOSEnum.CHECK_MST_STATUS.code("完成"));
|
||||
lambda.eq(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"));
|
||||
lambda.orderByDesc(IOStorInv::getInput_time);
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
lambda
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtMoreorlessmstService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.StIvtCheckdtlMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dto.CheckInsertDto;
|
||||
import org.nl.wms.warehouse_manage.service.dto.MoreOrLessInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单明细表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
@Service
|
||||
public class StIvtCheckdtlServiceImpl extends ServiceImpl<StIvtCheckdtlMapper, StIvtCheckdtl> implements IStIvtCheckdtlService {
|
||||
|
||||
/**
|
||||
* 盘点单主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
/**
|
||||
* 损益单主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoreorlessmstService iStIvtMoreorlessmstService;
|
||||
|
||||
@Override
|
||||
public void createCheckDtl(CheckInsertDto dto) {
|
||||
// 批量新增集合
|
||||
List<StIvtCheckdtl> dtlDaoList = new ArrayList<>();
|
||||
for (int i = 0; i < dto.getTableData().size(); i++) {
|
||||
JSONObject json = dto.getTableData().get(i);
|
||||
if (json.getString("status").equals(IOSEnum.CHECK_DTL_STATUS.code("完成"))) {
|
||||
continue;
|
||||
}
|
||||
StIvtCheckdtl dao = new StIvtCheckdtl();
|
||||
dao.setCheckdtl_id(IdUtil.getStringId());
|
||||
dao.setCheck_id(dto.getCheck_id());
|
||||
dao.setSeq_no(BigDecimal.valueOf(i+1));
|
||||
dao.setSect_code(json.getString("sect_code"));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setStoragevehicle_code(json.getString("storagevehicle_code"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setBase_qty(json.getBigDecimal("base_qty"));
|
||||
dao.setFac_qty(json.getBigDecimal("fac_qty"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setQty_unit_name(json.getString("qty_unit_name"));
|
||||
dao.setStatus(json.getString("status"));
|
||||
dao.setRemark(json.getString("remark"));
|
||||
dtlDaoList.add(dao);
|
||||
}
|
||||
this.saveBatch(dtlDaoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getDtl(Map whereJson) {
|
||||
return this.baseMapper.getDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMore(List<StIvtCheckdtl> dtlDaoList, String check_id) {
|
||||
StIvtCheckmst mstDao = iStIvtCheckmstService.getById(check_id);
|
||||
for (StIvtCheckdtl dao : dtlDaoList) {
|
||||
// 组织创建损益单据主数据
|
||||
MoreOrLessInsertDto moreDto = new MoreOrLessInsertDto();
|
||||
moreDto.setMol_inv_type(IOSEnum.MORE_MST_TYPE.code("盘点损益"));
|
||||
// 根据库存数量以及盘点数量来判断损益类型
|
||||
double base_qty = dao.getBase_qty().doubleValue();
|
||||
double fac_qty = dao.getFac_qty().doubleValue();
|
||||
double mol_qty;
|
||||
if (base_qty == fac_qty) {
|
||||
continue;
|
||||
} else if (base_qty > fac_qty) {
|
||||
moreDto.setMol_type(IOSEnum.MORE_TYPE.code("损"));
|
||||
mol_qty = NumberUtil.sub(base_qty, fac_qty);
|
||||
} else {
|
||||
moreDto.setMol_type(IOSEnum.MORE_TYPE.code("溢"));
|
||||
mol_qty = NumberUtil.sub(fac_qty, base_qty);
|
||||
}
|
||||
moreDto.setBiz_date(DateUtil.today());
|
||||
moreDto.setDtl_num(BigDecimal.valueOf(1));
|
||||
moreDto.setStor_id(mstDao.getStor_id());
|
||||
moreDto.setRemark("由明细标识【"+dao.getCheck_optid()+"】创建");
|
||||
moreDto.setTotal_qty(BigDecimal.valueOf(mol_qty));
|
||||
moreDto.setCreate_mode(IOSConstant.CREATE_TYPE);
|
||||
moreDto.setStatus(IOSEnum.MORE_MST_STATUS.code("生成"));
|
||||
|
||||
// 创建损益单明细数据
|
||||
List<JSONObject> tableData = new ArrayList<>();
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("material_id", dao.getMaterial_id());
|
||||
jsonDtl.put("pcsn", dao.getPcsn());
|
||||
jsonDtl.put("ivt_qty", base_qty);
|
||||
jsonDtl.put("mol_qty", mol_qty);
|
||||
jsonDtl.put("qty_unit_id", dao.getQty_unit_id());
|
||||
jsonDtl.put("qty_unit_name", dao.getQty_unit_name());
|
||||
jsonDtl.put("storagevehicle_code", dao.getStoragevehicle_code());
|
||||
jsonDtl.put("sect_code", dao.getSect_code());
|
||||
jsonDtl.put("struct_code", dao.getStruct_code());
|
||||
jsonDtl.put("status", IOSEnum.MORE_MST_STATUS.code("生成"));
|
||||
jsonDtl.put("remark", "由明细标识【"+dao.getCheck_optid()+"】创建");
|
||||
jsonDtl.put("source_bill_code", mstDao.getCheck_code());
|
||||
tableData.add(jsonDtl);
|
||||
moreDto.setTableData(tableData);
|
||||
//调用创建
|
||||
String mol_id = iStIvtMoreorlessmstService.create(moreDto);
|
||||
// 调用强制确认
|
||||
iStIvtMoreorlessmstService.confirm(iStIvtMoreorlessmstService.getById(mol_id));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getPdaDtl(JSONObject whereJson) {
|
||||
return this.baseMapper.getPdaDtl(whereJson);
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.StIvtCheckmstMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dto.CheckInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单主表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
@Service
|
||||
public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, StIvtCheckmst> implements IStIvtCheckmstService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtCheckdtlService iStIvtCheckdtlService;
|
||||
|
||||
@Override
|
||||
public IPage<StIvtCheckmst> queryAll(Map whereJson, PageQuery page) {
|
||||
String check_code = MapUtil.getStr(whereJson, "check_code");
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
String check_type = MapUtil.getStr(whereJson, "check_type");
|
||||
String create_mode = MapUtil.getStr(whereJson, "create_mode");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
// 查询条件
|
||||
LambdaQueryWrapper<StIvtCheckmst> queryWrapper = new QueryWrapper<StIvtCheckmst>().lambda();
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(check_code), StIvtCheckmst::getCheck_code, check_code);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(stor_id), StIvtCheckmst::getStor_id, stor_id);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(check_type), StIvtCheckmst::getCheck_type, check_type);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(status), StIvtCheckmst::getStatus, status);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(create_mode), StIvtCheckmst::getCreate_mode, create_mode);
|
||||
queryWrapper.ge(ObjectUtil.isNotEmpty(begin_time), StIvtCheckmst::getInput_time, begin_time);
|
||||
queryWrapper.lt(ObjectUtil.isNotEmpty(end_time), StIvtCheckmst::getInput_time, end_time);
|
||||
queryWrapper.eq(StIvtCheckmst::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
queryWrapper.orderByDesc(StIvtCheckmst::getInput_time);
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
queryWrapper
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(CheckInsertDto dto) {
|
||||
// 主表
|
||||
StIvtCheckmst mstDao = new StIvtCheckmst();
|
||||
mstDao.setCheck_id(IdUtil.getStringId());
|
||||
mstDao.setCheck_code(CodeUtil.getNewCode("CHECK_BILL_CODE"));
|
||||
mstDao.setCheck_type(dto.getCheck_type());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setStor_name(dto.getStor_name());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
mstDao.setCreate_mode(dto.getCreate_mode());
|
||||
mstDao.setStatus(dto.getStatus());
|
||||
mstDao.setRemark(dto.getRemark());
|
||||
mstDao.setInput_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setInput_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setInput_time(DateUtil.now());
|
||||
this.save(mstDao);
|
||||
// 明细
|
||||
dto.setCheck_id(mstDao.getCheck_id());
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(CheckInsertDto dto) {
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setCheck_type(dto.getCheck_type());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
this.updateById(mstDao);
|
||||
// 删除老明细
|
||||
iStIvtCheckdtlService.remove(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, mstDao.getCheck_id())
|
||||
);
|
||||
// 新增明细
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Set<String> ids) {
|
||||
this.update(
|
||||
new UpdateWrapper<StIvtCheckmst>().lambda()
|
||||
.in(StIvtCheckmst::getCheck_id, ids)
|
||||
.set(StIvtCheckmst::getIs_delete, IOSConstant.IS_DELETE_YES)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getDtl(Map whereJson) {
|
||||
return iStIvtCheckdtlService.getDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveCheck(CheckInsertDto dto) {
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("盘点中"));
|
||||
this.updateById(mstDao);
|
||||
// 更新明细
|
||||
iStIvtCheckdtlService.remove(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, mstDao.getCheck_id())
|
||||
.ne(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
);
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
iStIvtCheckdtlService.update(
|
||||
new UpdateWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.ne(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
.set(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("盘点中"))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirm(CheckInsertDto dto) {
|
||||
// 更新主表
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("完成"));
|
||||
mstDao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setConfirm_time(DateUtil.now());
|
||||
this.updateById(mstDao);
|
||||
// 创建损益单
|
||||
iStIvtCheckdtlService.createMore(iStIvtCheckdtlService.list(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, mstDao.getCheck_id())
|
||||
.ne(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
), mstDao.getCheck_id());
|
||||
// 更新明细
|
||||
iStIvtCheckdtlService.update(
|
||||
new UpdateWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.set(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMst(String check_id) {
|
||||
StIvtCheckmst mstDao = this.getById(check_id);
|
||||
List<StIvtCheckdtl> dtlDaoList = iStIvtCheckdtlService.list(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, check_id)
|
||||
);
|
||||
boolean is_confirm = dtlDaoList.stream()
|
||||
.allMatch(row -> row.getStatus().equals(IOSEnum.CHECK_DTL_STATUS.code("完成")));
|
||||
|
||||
mstDao.setStatus(is_confirm ? IOSEnum.CHECK_MST_STATUS.code("完成") : IOSEnum.CHECK_MST_STATUS.code("盘点中"));
|
||||
mstDao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setConfirm_time(DateUtil.now());
|
||||
this.updateById(mstDao);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtMoreorlessdtlService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.StIvtMoreorlessdtlMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dto.MoreOrLessInsertDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class StIvtMoreorlessdtlServiceImpl extends ServiceImpl<StIvtMoreorlessdtlMapper, StIvtMoreorlessdtl> implements IStIvtMoreorlessdtlService {
|
||||
|
||||
@Override
|
||||
public void createMoreDtl(MoreOrLessInsertDto dto) {
|
||||
// 批量新增明细集合
|
||||
List<StIvtMoreorlessdtl> dtlDaoList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dto.getTableData().size(); i++) {
|
||||
JSONObject json = dto.getTableData().get(i);
|
||||
StIvtMoreorlessdtl dao = new StIvtMoreorlessdtl();
|
||||
dao.setMol_dtl_id(IdUtil.getStringId());
|
||||
dao.setMol_id(dto.getMol_id());
|
||||
dao.setSeq_no(BigDecimal.valueOf(i+1));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setSect_code(json.getString("sect_code"));
|
||||
dao.setStoragevehicle_code(json.getString("storagevehicle_code"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setQty_unit_name(json.getString("qty_unit_name"));
|
||||
dao.setMol_qty(json.getBigDecimal("mol_qty"));
|
||||
dao.setStatus(IOSEnum.MORE_MST_STATUS.code("生成"));
|
||||
dao.setSource_bill_code(json.getString("source_bill_code"));
|
||||
dtlDaoList.add(dao);
|
||||
}
|
||||
this.saveBatch(dtlDaoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryMolDtl(Map whereJson) {
|
||||
return this.baseMapper.queryMolDtl(whereJson);
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
package org.nl.wms.warehouse_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtMoreorlessdtlService;
|
||||
import org.nl.wms.warehouse_manage.service.IStIvtMoreorlessmstService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessdtl;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.StIvtMoreorlessmstMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dto.MoreOrLessInsertDto;
|
||||
import org.nl.wms.warehouse_manage.service.util.UpdateIvtUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuixy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class StIvtMoreorlessmstServiceImpl extends ServiceImpl<StIvtMoreorlessmstMapper, StIvtMoreorlessmst> implements IStIvtMoreorlessmstService {
|
||||
|
||||
/**
|
||||
* 损益明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoreorlessdtlService iStIvtMoreorlessdtlService;
|
||||
|
||||
/**
|
||||
* 变更库存工具类
|
||||
*/
|
||||
@Autowired
|
||||
private UpdateIvtUtils updateIvtUtils;
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String create(MoreOrLessInsertDto dto) {
|
||||
// 主表
|
||||
StIvtMoreorlessmst mstDao = new StIvtMoreorlessmst();
|
||||
mstDao.setMol_id(IdUtil.getStringId());
|
||||
mstDao.setMol_code(CodeUtil.getNewCode("MORE_BILL_CODE"));
|
||||
mstDao.setMol_type(dto.getMol_type());
|
||||
mstDao.setMol_inv_type(dto.getMol_inv_type());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
mstDao.setTotal_qty(dto.getTotal_qty());
|
||||
mstDao.setCreate_mode(dto.getCreate_mode());
|
||||
mstDao.setInput_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setInput_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setInput_time(DateUtil.now());
|
||||
mstDao.setStatus(dto.getStatus());
|
||||
this.save(mstDao);
|
||||
|
||||
// 明细
|
||||
dto.setMol_id(mstDao.getMol_id());
|
||||
iStIvtMoreorlessdtlService.createMoreDtl(dto);
|
||||
return mstDao.getMol_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(MoreOrLessInsertDto dto) {
|
||||
StIvtMoreorlessmst mstDao = this.getById(dto.getMol_id());
|
||||
mstDao.setMol_type(dto.getMol_type());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
mstDao.setTotal_qty(dto.getTotal_qty());
|
||||
mstDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setUpdate_time(DateUtil.now());
|
||||
this.updateById(mstDao);
|
||||
|
||||
// 删除老的所有明细
|
||||
iStIvtMoreorlessdtlService.remove(
|
||||
new QueryWrapper<StIvtMoreorlessdtl>().lambda()
|
||||
.eq(StIvtMoreorlessdtl::getMol_id, mstDao.getMol_id())
|
||||
);
|
||||
// 新增明细
|
||||
iStIvtMoreorlessdtlService.createMoreDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
this.update(
|
||||
new UpdateWrapper<StIvtMoreorlessmst>().lambda()
|
||||
.in(StIvtMoreorlessmst::getMol_id,ids)
|
||||
.set(StIvtMoreorlessmst::getIs_delete, IOSConstant.IS_DELETE_YES)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryMolDtl(Map whereJson) {
|
||||
return iStIvtMoreorlessdtlService.queryMolDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirm(StIvtMoreorlessmst dao) {
|
||||
// 更新主表
|
||||
dao.setStatus(IOSEnum.MORE_MST_STATUS.code("完成"));
|
||||
dao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
dao.setConfirm_time(DateUtil.now());
|
||||
this.updateById(dao);
|
||||
// 查询所有明细
|
||||
List<StIvtMoreorlessdtl> dtlDaoList = iStIvtMoreorlessdtlService.list(
|
||||
new QueryWrapper<StIvtMoreorlessdtl>().lambda()
|
||||
.eq(StIvtMoreorlessdtl::getMol_id, dao.getMol_id())
|
||||
);
|
||||
// 更新库存
|
||||
for (StIvtMoreorlessdtl dto : dtlDaoList) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("type", dao.getMol_type().equals(IOSEnum.MORE_TYPE.code("损"))
|
||||
? IOSConstant.UPDATE_IVT_TYPE_SUB_CANUSE_IVT : IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE_IVT);
|
||||
json.put("storagevehicle_code",dto.getStoragevehicle_code());
|
||||
json.put("material_id",dto.getMaterial_id());
|
||||
json.put("pcsn",dto.getPcsn());
|
||||
json.put("qty_unit_id",dto.getQty_unit_id());
|
||||
json.put("qty_unit_name",dto.getQty_unit_name());
|
||||
json.put("change_qty",dto.getMol_qty());
|
||||
json.put("remark","由损益单据【"+dao.getMol_code()+"】变更库存数量【"+dto.getMol_qty()+"】");
|
||||
updateIvtUtils.updateIvt(json);
|
||||
}
|
||||
// 更新明细为完成
|
||||
iStIvtMoreorlessdtlService.update(
|
||||
new UpdateWrapper<StIvtMoreorlessdtl>().lambda()
|
||||
.eq(StIvtMoreorlessdtl::getMol_id, dao.getMol_id())
|
||||
.set(StIvtMoreorlessdtl::getStatus, IOSEnum.MORE_MST_STATUS.code("完成"))
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user