opt:优化手持功能。
This commit is contained in:
@@ -40,7 +40,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/bigScreenScreen")
|
||||
@RequestMapping("/mobile/auth")
|
||||
public class MobileAuthorizationController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@@ -51,7 +51,7 @@ public class MobileAuthorizationController {
|
||||
@SaIgnore
|
||||
//("手持登陆验证")
|
||||
public ResponseEntity<Object> handLogin(@RequestBody Map<String, String> whereJson) {
|
||||
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", whereJson.get("user")));
|
||||
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", whereJson.get("username")));
|
||||
if (userInfo == null || !userInfo.getPassword().equals(SaSecureUtil.md5BySalt(RsaUtils.decryptByPrivateKey(RsaUtils.KEY, whereJson.get("password")), "salt"))) { // 这里需要密码加密
|
||||
throw new BadRequestException("账号或密码错误");
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
/**
|
||||
* 出库规则
|
||||
*/
|
||||
List<StrategyStructMaterialVO> outBoundSectDiv(StrategyStructParam param);
|
||||
List<StructattrVechielDto> outBoundSectDiv(StrategyStructParam param);
|
||||
|
||||
/**
|
||||
* 入库规则
|
||||
|
||||
@@ -333,7 +333,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
* 当前分配不会自动锁定货位及冻结出库数量,分配完成后需要手动锁定货位并冻结出库数量
|
||||
*/
|
||||
@Override
|
||||
public List<StrategyStructMaterialVO> outBoundSectDiv(StrategyStructParam param) {
|
||||
public List<StructattrVechielDto> outBoundSectDiv(StrategyStructParam param) {
|
||||
//只校验仓库,库区
|
||||
Assert.noNullElements(new Object[]{param.getStor_code(),param.getSect_code()},"请求参数不能为空");
|
||||
StSectStrategy one = iStSectStrategyService.getOne(new LambdaQueryWrapper<StSectStrategy>()
|
||||
@@ -344,11 +344,13 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
}
|
||||
List<String> strategy = one.getStrategy();
|
||||
Map<String, Decisioner> decisionerMap = SpringContextHolder.getBeansOfType(Decisioner.class);
|
||||
// 判断策略类型
|
||||
List list = null;
|
||||
for (String decisionerType : strategy) {
|
||||
Decisioner decisioner = decisionerMap.get(decisionerType);
|
||||
log.info("执行出入库规格:"+decisioner.strategyConfig.getStrategy_name());
|
||||
list = decisioner.handler(list, param);
|
||||
JSONObject params = (JSONObject) JSON.toJSON(param);
|
||||
list = decisioner.handler(list, params);
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
throw new BadRequestException("当前策略"+decisioner.strategyConfig.getStrategy_name()+"无可用货位,分配前数量:"+list.size());
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FIFORuleHandler extends Decisioner<StructattrVechielDto, JSONObject
|
||||
, "stor_code", param.getString("stor_code")
|
||||
, "plan_qty", plan_qty
|
||||
, "is_lock", "false"
|
||||
, "order_by", "md_pb_vehicleMater.pcsn asc")
|
||||
, "order_by", "gro.pcsn asc")
|
||||
);
|
||||
if (ObjectUtils.isEmpty(vechielDtos)) {
|
||||
throw new BadRequestException("当前出库策略:先进先出,库存分配失败,失败原因:库存不足!");
|
||||
@@ -69,7 +69,7 @@ public class FIFORuleHandler extends Decisioner<StructattrVechielDto, JSONObject
|
||||
for (Map.Entry<String, List<StructattrVechielDto>> entry : sortedGroupMap.entrySet()) {
|
||||
List<StructattrVechielDto> sortedList = new ArrayList<>(entry.getValue());
|
||||
for (StructattrVechielDto structattr : sortedList) {
|
||||
BigDecimal qty = structattr.getXqty() != null ? structattr.getQty() : BigDecimal.ZERO;
|
||||
BigDecimal qty = structattr.getQty() != null ? structattr.getQty() : BigDecimal.ZERO;
|
||||
BigDecimal frozen = structattr.getFrozen_qty() != null ? structattr.getFrozen_qty() : BigDecimal.ZERO;
|
||||
int available = qty.subtract(frozen).intValue();
|
||||
if (available <= 0) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
|
||||
* 轻上重下策略
|
||||
*/
|
||||
@Service("weight")
|
||||
public class WeightRuleHandler extends Decisioner<Structattr, String> {
|
||||
public class WeightRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,21 +32,16 @@ public class WeightRuleHandler extends Decisioner<Structattr, String> {
|
||||
* @return List<Structattr> :仓位集合
|
||||
*/
|
||||
@Override
|
||||
public List<Structattr> handler(List<Structattr> list, String param) {
|
||||
public List<Structattr> handler(List<Structattr> list, JSONObject param) {
|
||||
// 判断仓位是否为空
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new BadRequestException("仓位集合为空!");
|
||||
}
|
||||
|
||||
// 判断策略类型
|
||||
JSONObject jsonParam = JSONObject.parseObject(param, JSONObject.class);
|
||||
|
||||
List<Structattr> resultList = new ArrayList<>();
|
||||
|
||||
switch (jsonParam.getString("ioType")) {
|
||||
switch (param.getString("ioType")) {
|
||||
case "1":
|
||||
// 入库策略
|
||||
resultList = inHandler(list, jsonParam);
|
||||
resultList = inHandler(list, param);
|
||||
break;
|
||||
case "2":
|
||||
// 出库策略
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package org.nl.wms.decision_manage.service.strategyConfig.decisioner.impl.diy;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,9 +8,9 @@ import java.util.List;
|
||||
* @Date 2024/4/6 16:18
|
||||
* 自定义类处理器
|
||||
*/
|
||||
public class ClassRuleHandler extends Decisioner<String,String> {
|
||||
public class ClassRuleHandler extends Decisioner<String, JSONObject> {
|
||||
@Override
|
||||
public List<String> handler(List<String> list, String param) {
|
||||
public List<String> handler(List<String> list, JSONObject param) {
|
||||
System.out.println("迭代器使用中"+this.toString());
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ 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.ios_manage.service.PdaIosInService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -40,7 +41,7 @@ public class PdaIosInController {
|
||||
@Log("物料组盘确认")
|
||||
public ResponseEntity<Object> groupPlate(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code", "material_id","qty");
|
||||
return new ResponseEntity<>(pdaIosInService.groupPlate(whereJson),HttpStatus.OK);
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaIosInService.groupPlate(whereJson)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getPlateDtl")
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface PdaIosInService {
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse groupPlate(JSONObject whereJson);
|
||||
JSONObject groupPlate(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询明细
|
||||
@@ -90,7 +90,7 @@ public interface PdaIosInService {
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getRegion(JSONObject whereJson);
|
||||
List<SelectItemVo> getRegion(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
|
||||
|
||||
@Override
|
||||
public PdaResponse groupPlate(JSONObject whereJson) {
|
||||
public JSONObject groupPlate(JSONObject whereJson) {
|
||||
// 物料编码
|
||||
String materialId = whereJson.getString("material_id");
|
||||
//批次
|
||||
@@ -151,6 +151,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
if (ObjectUtil.isEmpty(vehicleDao) || ObjectUtil.isEmpty(materDao) || ObjectUtil.isEmpty(materDao)) {
|
||||
throw new BadRequestException("载具,物料或单位信息有误!");
|
||||
}
|
||||
whereJson.put("material_id", materDao.getMaterial_id());
|
||||
whereJson.put("material_code", materDao.getMaterial_code());
|
||||
//判断该载具是否存在组盘信息
|
||||
long statusCount = iMdPbGroupplateService.count(
|
||||
new LambdaQueryWrapper<GroupPlate>()
|
||||
@@ -170,7 +172,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
GroupPlate groupDao = GroupPlate.builder()
|
||||
.group_id(IdUtil.getStringId())
|
||||
.material_id(materDao.getMaterial_code())
|
||||
.material_id(materDao.getMaterial_id())
|
||||
.storagevehicle_code(vehicleDao.getStoragevehicle_code())
|
||||
.pcsn(pcsn)
|
||||
.qty_unit_id(unitDao.getMeasure_unit_id())
|
||||
@@ -183,7 +185,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
.create_time(DateUtil.now())
|
||||
.build();
|
||||
iMdPbGroupplateService.save(groupDao);
|
||||
return PdaResponse.requestOk();
|
||||
return whereJson;
|
||||
}
|
||||
|
||||
|
||||
@@ -234,12 +236,15 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getRegion(JSONObject whereJson) {
|
||||
public List<SelectItemVo> getRegion(JSONObject whereJson) {
|
||||
PageQuery pageQuery = new PageQuery();
|
||||
pageQuery.setPage(whereJson.getInteger("page") - 1);
|
||||
pageQuery.setSize(whereJson.getInteger("size"));
|
||||
IPage<SchBaseRegion> regionList = iSchBaseRegionService.queryAll(new HashMap(), pageQuery);
|
||||
return PdaResponse.requestParamOk(regionList.getRecords());
|
||||
|
||||
List<SelectItemVo> selectList = new ArrayList<>();
|
||||
regionList.getRecords().forEach(r ->
|
||||
selectList.add(SelectItemVo.builder().text(r.getRegion_name()).value(r.getRegion_code()).build())
|
||||
);
|
||||
return selectList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -325,7 +330,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
params.put("material_code", whereJson.getString("material_code"));
|
||||
params.put("qty", whereJson.getString("qty"));
|
||||
params.put("pcsn", whereJson.getString("pcsn"));
|
||||
Structattr attrDao = iRawAssistIStorService.getStructattr(whereJson);
|
||||
Structattr attrDao = iRawAssistIStorService.getStructattr(params);
|
||||
//确定起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("site_code")));
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
@@ -357,15 +362,19 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmIn(JSONObject whereJson) {
|
||||
// 查询库区
|
||||
Sectattr sectDao = iSectattrService.getById(whereJson.getString("sect_id"));
|
||||
whereJson.put("stor_id", sectDao.getStor_id());
|
||||
whereJson.put("sect_code", sectDao.getSect_code());
|
||||
//物料组盘入库
|
||||
if (StringUtils.isBlank(whereJson.getString("is_empty_vehicle"))) {
|
||||
//获取起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code")));
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("site_code")));
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
throw new BadRequestException("未找到载具所在的点位信息,请检查该载具是否绑定点位");
|
||||
}
|
||||
whereJson.put("point_code",whereJson.getString("site_code"));
|
||||
whereJson.put("point_code", whereJson.getString("site_code"));
|
||||
// 预组织出入库单据实体
|
||||
Map<String, Object> jsonMst = organizeInsertData(whereJson);
|
||||
// 调用服务新增出入库单
|
||||
@@ -385,6 +394,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
} else {
|
||||
//空载具入库
|
||||
whereJson.put("qty", 1);
|
||||
whereJson.put("pcsn", whereJson.getString("material_id"));
|
||||
String materialCode = "1".equals(whereJson.getString("material_id")) ? StatusEnum.VEHICLE_TYPE.code("空托盘") : StatusEnum.VEHICLE_TYPE.code("空料箱");
|
||||
whereJson.put("material_id", materialCode);
|
||||
//组盘
|
||||
@@ -422,16 +432,14 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
Double total_qty = plateDaoList.stream()
|
||||
.map(row -> row.getQty().doubleValue())
|
||||
.reduce(Double::sum).orElse(0.0);
|
||||
|
||||
// 查询库区
|
||||
Sectattr sectDao = iSectattrService.getById(whereJson.getString("sect_id"));
|
||||
// 组织主表数据
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("stor_id", sectDao.getStor_id());
|
||||
jsonMst.put("stor_id", whereJson.getString("stor_id"));
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonMst.put("total_qty", total_qty);
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_type", StatusEnum.IOBILL_TYPE_IN.code("生产入库"));
|
||||
jsonMst.put("create_mode", IOSEnum.CREATE_MODE.code("终端产生"));
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
// 组织明细数据
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
@@ -447,6 +455,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
dtl.put("qty_unit_name", plateDao.getQty_unit_name());
|
||||
dtl.put("qty", String.valueOf(total_qty));
|
||||
dtl.put("plan_qty", String.valueOf(total_qty));
|
||||
dtl.put("source_bill_code", plateDao.getExt_code());
|
||||
// 调用新增
|
||||
tableData.add(dtl);
|
||||
jsonMst.put("tableData",tableData);
|
||||
|
||||
@@ -164,7 +164,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
public PdaResponse getMaterialDtl(JSONObject whereJson) {
|
||||
List<StructattrVechielDto> list = iStructattrService.collectVechicle(
|
||||
MapOf.of("search", whereJson.getString("search"),
|
||||
"stor_code", "XB01",
|
||||
"stor_code", "XB",
|
||||
"status", GROUP_PLATE_STATUS.code("入库"),
|
||||
"is_lock", "false",
|
||||
"order_by", "gro.create_time asc"));
|
||||
@@ -240,28 +240,23 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
@Transactional
|
||||
public PdaResponse vehicleOutConfirm(JSONObject whereJson) {
|
||||
long qty = 1L;
|
||||
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new LambdaQueryWrapper<>();
|
||||
String materialCode = StatusEnum.VEHICLE_TYPE.code("空托盘");
|
||||
//空料箱出库
|
||||
if (StringUtils.isNotBlank(whereJson.getString("qty"))) {
|
||||
qty = whereJson.getLongValue("qty");
|
||||
if (qty > 6) {
|
||||
throw new BadRequestException("一次性只能输入小于7以内的载具数量");
|
||||
}
|
||||
queryWrapper.eq(MdMeMaterialbase::getMaterial_id, StatusEnum.VEHICLE_TYPE.code("空料箱"));
|
||||
} else {
|
||||
queryWrapper.eq(MdMeMaterialbase::getMaterial_id, StatusEnum.VEHICLE_TYPE.code("空托盘"));
|
||||
|
||||
materialCode = StatusEnum.VEHICLE_TYPE.code("空料箱");
|
||||
}
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getOne(queryWrapper);
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(materialCode);
|
||||
if (materDao == null) {
|
||||
throw new BadRequestException("未找到空载具物料信息!");
|
||||
}
|
||||
whereJson.put("pcsn", "1");
|
||||
whereJson.put("material_id", materDao.getMaterial_id());
|
||||
whereJson.put("material_code", materDao.getMaterial_code());
|
||||
Sectattr sectattr = iSectattrService.getById(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.eq(Sectattr::getSect_id, whereJson.getString("sect_id"))
|
||||
.eq(Sectattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
);
|
||||
Sectattr sectattr = iSectattrService.getById(whereJson.getString("sect_id"));
|
||||
if (ObjectUtil.isEmpty(sectattr)) {
|
||||
throw new BadRequestException("该仓位所属的库区已禁用,请先启用该库区!");
|
||||
}
|
||||
@@ -276,7 +271,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
.material_code(whereJson.getString("material_code"))
|
||||
.qty(BigDecimal.valueOf(qty))
|
||||
.build();
|
||||
List<StrategyStructMaterialVO> structList = iStructattrService.outBoundSectDiv(strategyStructParam);
|
||||
List<StructattrVechielDto> structList = iStructattrService.outBoundSectDiv(strategyStructParam);
|
||||
if (CollectionUtils.isEmpty(structList)) {
|
||||
throw new BadRequestException("无可用库存!");
|
||||
}
|
||||
@@ -284,18 +279,16 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
//创建任务
|
||||
JSONObject taskForm = new JSONObject();
|
||||
taskForm.put("task_type", IOSConstant.VEHICLE_OUT_TASK);
|
||||
taskForm.put("config_code", IOSConstant.VEHICLE_IN_TASK);
|
||||
taskForm.put("config_code", IOSConstant.VEHICLE_OUT_TASK);
|
||||
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
taskForm.put("PickingLocation", r.getStruct_code());
|
||||
taskForm.put("PlacedLocation", whereJson.getString("siteCode"));
|
||||
taskForm.put("vehicle_code", r.getStoragevehicle_code());
|
||||
VehicleOutTask vehicleOutTask = SpringContextHolder.getBean("VehicleOutTask");
|
||||
applyTaskMap.get(IOSConstant.VEHICLE_IN_TASK).create(whereJson);
|
||||
vehicleOutTask.create(taskForm);
|
||||
applyTaskMap.get(IOSConstant.VEHICLE_OUT_TASK).create(taskForm);
|
||||
});
|
||||
//更新组盘记录表
|
||||
Set<String> vehicleCodeSet = structList.stream()
|
||||
.map(StrategyStructMaterialVO::getStoragevehicle_code)
|
||||
.map(StructattrVechielDto::getStoragevehicle_code)
|
||||
.collect(Collectors.toSet());
|
||||
mdPbGroupplateMapper.update(
|
||||
new GroupPlate(),
|
||||
@@ -306,7 +299,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
);
|
||||
//锁定仓位
|
||||
Set<String> structCodeSet = structList.stream()
|
||||
.map(StrategyStructMaterialVO::getStruct_code)
|
||||
.map(StructattrVechielDto::getStruct_code)
|
||||
.collect(Collectors.toSet());
|
||||
iStructattrService.update(
|
||||
new LambdaUpdateWrapper<Structattr>()
|
||||
@@ -337,7 +330,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
io_mst.put("stor_name", whereJson.get("store_name"));
|
||||
io_mst.put("detail_count", 1);
|
||||
io_mst.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
||||
io_mst.put("create_mode", IOSEnum.CREATE_MODE.code("PC产生"));
|
||||
io_mst.put("create_mode", ObjectUtils.isEmpty(whereJson.get("create_mode")) ? IOSEnum.CREATE_MODE.code("PC产生") : whereJson.get("create_mode"));
|
||||
io_mst.put("input_optid", currentUserId + "");
|
||||
io_mst.put("input_optname", nickName);
|
||||
io_mst.put("input_time", now);
|
||||
@@ -358,6 +351,12 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
ioStorInvDtl.put("seq_no", "1");
|
||||
ioStorInvDtl.put("material_id", whereJson.get("material_id"));
|
||||
ioStorInvDtl.put("material_code", whereJson.get("material_code"));
|
||||
ioStorInvDtl.put("sect_id", whereJson.get("sect_id"));
|
||||
ioStorInvDtl.put("sect_code", whereJson.get("sect_code"));
|
||||
ioStorInvDtl.put("sect_name", whereJson.get("sect_name"));
|
||||
ioStorInvDtl.put("struct_id", whereJson.get("struct_id"));
|
||||
ioStorInvDtl.put("struct_code", whereJson.get("struct_code"));
|
||||
ioStorInvDtl.put("struct_name", whereJson.get("struct_name"));
|
||||
ioStorInvDtl.put("Pcsn", whereJson.get("pcsn"));
|
||||
ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
||||
ioStorInvDtl.put("qty_unit_id", whereJson.get("unit_id"));
|
||||
|
||||
@@ -23,6 +23,11 @@ public class PdaResponse<T> {
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 消息码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
@@ -35,6 +40,7 @@ public class PdaResponse<T> {
|
||||
public static PdaResponse requestOk() {
|
||||
return PdaResponse.builder()
|
||||
.message("操作成功!")
|
||||
.code(String.valueOf(HttpStatus.HTTP_OK))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -45,6 +51,7 @@ public class PdaResponse<T> {
|
||||
public static <T> PdaResponse requestParamOk(T data) {
|
||||
return PdaResponse.builder()
|
||||
.message("操作成功!")
|
||||
.code(String.valueOf(HttpStatus.HTTP_OK))
|
||||
.data(data)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ public enum StatusEnum {
|
||||
/**
|
||||
* 出入库单据类型退货出库
|
||||
*/
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "10", "inStorageTask", "调拨入库", "11", "inStorageTask", "退货入库", "12", "inStorageTask", "拣选回库",
|
||||
"13", "inStorageTask", "盘点入库", "14", "inStorageTask", "托盘入库", "30", "inStorageTask", "二楼CTU入库", "80", "inStorageTask")),
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask", "生产出库", "21", "outStorageTask", "调拨出库", "22", "outStorageTask",
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "0001", "inStorageTask", "调拨入库", "0004", "inStorageTask", "退货入库", "0002", "inStorageTask", "拣选回库",
|
||||
"13", "inStorageTask", "盘点入库", "14", "inStorageTask", "托盘入库", "30", "inStorageTask", "返检入库", "0005", "inStorageTask", "报废入库", "0003", "inStorageTask", "inStorageTask", "手工入库", "0009", "inStorageTask")),
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask","发货出库", "1001", "outStorageTask", "生产出库", "21", "outStorageTask", "调拨出库", "1004", "outStorageTask",
|
||||
"拣选出库", "23", "conveyorOutStorageTask", "盘点出库", "24", "outStorageTask", "出库拣选", "25", "toPickPlatformTask",
|
||||
"退货出库", "26", "outStorageTask", "托盘出库", "40", "outStorageTask", "二楼CTU出库", "81", "inStorageTask", "二楼出库AGV搬运",
|
||||
"82", "inStorageTask", "二楼空架AGV搬运", "83", "inStorageTask")),
|
||||
"退货出库", "26", "outStorageTask", "托盘出库", "40", "outStorageTask", "二楼CTU出库", "81", "outStorageTask", "返检出库",
|
||||
"1006", "outStorageTask", "报废出库", "1002", "outStorageTask")),
|
||||
|
||||
|
||||
IOBILL_TYPE_MOVE(ForkMap.of("移库", "50", "moveStorageTask", "异常位移库", "51", "moveStorageTask")),
|
||||
|
||||
@@ -168,12 +168,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
|
||||
@Override
|
||||
public List<SchBasePoint> getPointList(SchBasePoint region) {
|
||||
if (ObjectUtil.isEmpty(region)) {
|
||||
return this.list();
|
||||
}
|
||||
return pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, region.getRegion_code())
|
||||
.eq(SchBasePoint::getIs_has_workder, true));
|
||||
.eq(SchBasePoint::getIs_used, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -134,6 +134,7 @@ public class VehicleOutTask extends AbstractTask {
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark("已完成");
|
||||
taskObj.setHandle_status("1");
|
||||
taskService.updateById(taskObj);
|
||||
outBillService.taskFinish(taskObj);
|
||||
}
|
||||
|
||||
@@ -78,4 +78,16 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String VEHICLE_OUT_TASK = "VehicleOutTask";
|
||||
|
||||
|
||||
/**
|
||||
* 线边仓入库
|
||||
*/
|
||||
public final static String XB_IN_TASK = "XbInTask";
|
||||
|
||||
|
||||
/**
|
||||
* 线边仓出库
|
||||
*/
|
||||
public final static String XB_OUT_TASK = "XbOutTask";
|
||||
|
||||
}
|
||||
|
||||
@@ -57,8 +57,9 @@
|
||||
SELECT
|
||||
gro.*,
|
||||
mater.material_id,
|
||||
mater.material_name,
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
mater.material_spec
|
||||
FROM
|
||||
md_pb_groupplate gro
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = gro.material_id
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -1178,72 +1179,76 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void taskFinish(SchBaseTask task) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
||||
);
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)) {
|
||||
throw new BadRequestException("未找到任务对应的分配明细");
|
||||
}
|
||||
// 完成当前分配明细
|
||||
ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,ioStorInvDis.getIostorinvdis_id())
|
||||
);
|
||||
//解锁库位
|
||||
JSONObject finish_map = new JSONObject();
|
||||
finish_map.put("struct_code",ioStorInvDis.getStruct_code());
|
||||
finish_map.put("storagevehicle_code",null);
|
||||
finish_map.put("struct_code", task.getPoint_code1());
|
||||
finish_map.put("storagevehicle_code", null);
|
||||
finish_map.put("inv_type", null);
|
||||
finish_map.put("inv_id", null);
|
||||
finish_map.put("inv_code", null);
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
//修改库存 恢复库存 手持进行减扣
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
JSONObject jsonIvt = new JSONObject();
|
||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_SUB_FROZEN_ADD_CANUSE);
|
||||
jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||
jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||
jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
||||
.ne(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
);
|
||||
// 明细
|
||||
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInvDtl)){
|
||||
throw new BadRequestException("未找到明细");
|
||||
}
|
||||
// 如果分配明细全部完成则更新明细表状态
|
||||
if (countDis == 0){
|
||||
// 更新明细表状态
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||
iStructattrService.updateStatusByCode("1", finish_map);
|
||||
if (StringUtils.isBlank(task.getHandle_status())) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
||||
);
|
||||
// 如果明细全部完成则更新主表状态
|
||||
if (countDtl == 0){
|
||||
//更新主表状态
|
||||
ioStorInvMapper.update(new IOStorInv(),new LambdaUpdateWrapper<>(IOStorInv.class)
|
||||
.set(IOStorInv::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||
.set(IOStorInv::getConfirm_optid,currentUserId)
|
||||
.set(IOStorInv::getConfirm_optname,nickName)
|
||||
.set(IOStorInv::getConfirm_time,now)
|
||||
.eq(IOStorInv::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)) {
|
||||
throw new BadRequestException("未找到任务对应的分配明细");
|
||||
}
|
||||
// 完成当前分配明细
|
||||
ioStorInvDisMapper.update(ioStorInvDis, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.eq(IOStorInvDis::getIostorinvdis_id, ioStorInvDis.getIostorinvdis_id())
|
||||
);
|
||||
//修改库存,恢复库存,手持进行减扣,无需修改,需要载具出库确认后更改
|
||||
// List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
// JSONObject jsonIvt = new JSONObject();
|
||||
// jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_SUB_FROZEN_ADD_CANUSE);
|
||||
// jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
// jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||
// jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||
// jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||
// jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
// jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
// updateIvtList.add(jsonIvt);
|
||||
// iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id())
|
||||
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
);
|
||||
// 明细
|
||||
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInvDtl)) {
|
||||
throw new BadRequestException("未找到明细");
|
||||
}
|
||||
// 如果分配明细全部完成则更新明细表状态
|
||||
if (countDis == 0) {
|
||||
// 更新明细表状态
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
|
||||
.ne(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||
);
|
||||
// 如果明细全部完成则更新主表状态
|
||||
if (countDtl == 0) {
|
||||
//更新主表状态
|
||||
ioStorInvMapper.update(new IOStorInv(), new LambdaUpdateWrapper<>(IOStorInv.class)
|
||||
.set(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||
.set(IOStorInv::getConfirm_optid, currentUserId)
|
||||
.set(IOStorInv::getConfirm_optname, nickName)
|
||||
.set(IOStorInv::getConfirm_time, now)
|
||||
.eq(IOStorInv::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ 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.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -155,7 +157,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
io_mst.put("detail_count", rows.size());
|
||||
io_mst.put("remark", whereJson.get("remark"));
|
||||
io_mst.put("bill_status", whereJson.get("bill_status"));
|
||||
io_mst.put("create_mode", IOSEnum.CREATE_MODE.code("PC产生"));
|
||||
io_mst.put("create_mode", ObjectUtils.isEmpty(whereJson.get("create_mode"))?IOSEnum.CREATE_MODE.code("PC产生"):whereJson.get("create_mode"));
|
||||
io_mst.put("input_optid", currentUserId + "");
|
||||
io_mst.put("input_optname", nickName);
|
||||
io_mst.put("input_time", now);
|
||||
@@ -658,17 +660,17 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
|
||||
//修改库存
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
JSONObject jsonIvt = new JSONObject();
|
||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
||||
jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||
jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||
jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
// JSONObject jsonIvt = new JSONObject();
|
||||
// jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
||||
// jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
// jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||
// jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||
// jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||
// jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
// jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
// updateIvtList.add(jsonIvt);
|
||||
// iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# 欧伦电器WMS系统
|
||||
# 欧伦电气WMS系统
|
||||
|
||||
/api/sysMenu/build?systemType=1
|
||||
Reference in New Issue
Block a user