fix:出入库流程修改

This commit is contained in:
zhouz
2024-05-28 09:26:40 +08:00
parent 3b4576ef12
commit 5939a0e520
10 changed files with 115 additions and 67 deletions

View File

@@ -87,6 +87,7 @@ public class TwoLashTask extends AbstractAcsTask {
interaction_json.put("height",dao.get(0).getBox_high()); interaction_json.put("height",dao.get(0).getBox_high());
interaction_json.put("template","2"); interaction_json.put("template","2");
interaction_json.put("bindingTimes","1"); interaction_json.put("bindingTimes","1");
interaction_json.put("isBinding", IOSEnum.IS_SEND.code(""));
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1); char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
AcsTaskDto dto = AcsTaskDto.builder() AcsTaskDto dto = AcsTaskDto.builder()

View File

@@ -7,8 +7,11 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.checkerframework.checker.units.qual.A;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService; import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum; import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService; import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService; import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService;
@@ -53,6 +56,9 @@ public class InBussManageServiceImpl implements InBussManageService {
@Autowired @Autowired
private IschBaseTaskService ischBaseTaskService; private IschBaseTaskService ischBaseTaskService;
@Autowired
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
/** /**
* 不需要查询的排集合 * 不需要查询的排集合
*/ */
@@ -204,6 +210,12 @@ public class InBussManageServiceImpl implements InBussManageService {
throw new BadRequestException("设备号不能为空!"); throw new BadRequestException("设备号不能为空!");
} }
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, jsonObject.getString("box_no"))
);
List<String> pcsnList = Arrays.asList(material_barcode.split(",")); List<String> pcsnList = Arrays.asList(material_barcode.split(","));
// 查询子卷包装关系 // 查询子卷包装关系
@@ -276,6 +288,7 @@ public class InBussManageServiceImpl implements InBussManageService {
jsonDiv.put("stor_id", IOSEnum.STOR_ID.code("二期")); jsonDiv.put("stor_id", IOSEnum.STOR_ID.code("二期"));
jsonDiv.put("material_barcode", jsonObject.getString("material_barcode")); jsonDiv.put("material_barcode", jsonObject.getString("material_barcode"));
jsonDiv.put("vehicle_code", jsonObject.getString("vehicle_code")); jsonDiv.put("vehicle_code", jsonObject.getString("vehicle_code"));
jsonDiv.put("vehicle_type", boxDao.getVehicle_type());
iStIvtIostorinvService.divStruct(jsonDiv); iStIvtIostorinvService.divStruct(jsonDiv);
} }
@@ -361,6 +374,7 @@ public class InBussManageServiceImpl implements InBussManageService {
/** /**
* 获取最小巷道 * 获取最小巷道
*
* @param jsonSub { * @param jsonSub {
* jsonSub木箱信息 * jsonSub木箱信息
* sect_id库区 * sect_id库区
@@ -426,6 +440,7 @@ public class InBussManageServiceImpl implements InBussManageService {
/** /**
* 计算最小巷道木箱数 * 计算最小巷道木箱数
*
* @param blockList : 所有巷道 * @param blockList : 所有巷道
* @param boxAllList: 所有木箱 * @param boxAllList: 所有木箱
* @return JSONObject最小木箱数的巷道 JSONObject{block_numbox_num} * @return JSONObject最小木箱数的巷道 JSONObject{block_numbox_num}
@@ -456,6 +471,7 @@ public class InBussManageServiceImpl implements InBussManageService {
/** /**
* 获取最小排 * 获取最小排
*
* @param jsonSub { * @param jsonSub {
* jsonSub木箱信息 * jsonSub木箱信息
* sect_id库区 * sect_id库区
@@ -527,6 +543,7 @@ public class InBussManageServiceImpl implements InBussManageService {
/** /**
* 计算最小木箱的排 * 计算最小木箱的排
*
* @param rowList : 所有排 * @param rowList : 所有排
* @param boxAllList: 所有木箱 * @param boxAllList: 所有木箱
* @return JSONObject最小木箱数的排 JSONObject{row_numbox_num} * @return JSONObject最小木箱数的排 JSONObject{row_numbox_num}
@@ -557,6 +574,7 @@ public class InBussManageServiceImpl implements InBussManageService {
/** /**
* 获取仓位 * 获取仓位
*
* @param jsonSub { * @param jsonSub {
* jsonSub木箱信息 * jsonSub木箱信息
* sect_id库区 * sect_id库区
@@ -590,6 +608,7 @@ public class InBussManageServiceImpl implements InBussManageService {
/** /**
* 获取一个货位公共方法 * 获取一个货位公共方法
*
* @param jsonSub { * @param jsonSub {
* jsonSub木箱信息 * jsonSub木箱信息
* sect_id库区 * sect_id库区

View File

@@ -209,15 +209,15 @@ public class LashManageServiceImpl implements LashManageService {
result.put("width", boxDao.getBox_width()); result.put("width", boxDao.getBox_width());
result.put("height", boxDao.getBox_high()); result.put("height", boxDao.getBox_high());
result.put("case", boxDao.getMaterial_code()); result.put("case", boxDao.getMaterial_code());
result.put("isBinding", IOSEnum.IS_SEND.code("")); result.put("isBinding", IOSEnum.IS_SEND.code(""));
result.put("isLabeling", IOSEnum.IS_SEND.code("")); result.put("isLabeling", IOSEnum.IS_SEND.code(""));
result.put("labelingTemplate", boxDao.getLash_num()); result.put("labelingTemplate", boxDao.getLash_num());
result.put("bindingTemplate", "1"); result.put("bindingTemplate", boxDao.getLash_num());
result.put("printDevice", "1"); result.put("printDevice", "1");
result.put("printQty", "1"); result.put("printQty", "1");
result.put("bundleTimes", "2"); result.put("bundleTimes", "1");
return result; return result;
} }

View File

@@ -70,14 +70,8 @@ public class SendOutManageServiceImpl implements SendOutManageService {
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_NOTANDYES.code("")) .eq(SchBasePoint::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))
); );
// 根据载具号找到对应的木箱号
JSONObject jsonExt = extTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonExt)) {
throw new BadRequestException("此载具上没有木箱,请检查!"+whereJson.getString("vehicle_code"));
}
// 1.查询此木箱号的子卷包装关系 // 1.查询此木箱号的子卷包装关系
JSONObject jsonSub = subTab.query("package_box_sn = '" + jsonExt.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("package_box_sn = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSub)) { if (ObjectUtil.isEmpty(jsonSub)) {
throw new BadRequestException("未查询到该木箱对应的包装关系!"); throw new BadRequestException("未查询到该木箱对应的包装关系!");
} }
@@ -215,6 +209,6 @@ public class SendOutManageServiceImpl implements SendOutManageService {
); );
// 删除载具对应木箱记录 // 删除载具对应木箱记录
extTab.delete(jsonExt); //extTab.delete(jsonExt);
} }
} }

View File

@@ -48,8 +48,8 @@ public class StoragevehicleinfoController {
@Log("修改载具") @Log("修改载具")
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')") //@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody StoragevehicleinfoDto dto) { public ResponseEntity<Object> update(@RequestBody JSONObject map) {
storagevehicleinfoService.update(dto); storagevehicleinfoService.update(map);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }

View File

@@ -61,7 +61,7 @@ public interface StoragevehicleinfoService {
* *
* @param dto / * @param dto /
*/ */
void update(StoragevehicleinfoDto dto); void update(JSONObject dto);
/** /**
* 多选删除 * 多选删除

View File

@@ -160,24 +160,47 @@ public class StoragevehicleinfoServiceImpl implements StoragevehicleinfoService
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(StoragevehicleinfoDto dto) { public void update(JSONObject dto) {
WQLObject wo = WQLObject.getWQLObject("md_pb_storagevehicleinfo"); WQLObject wo = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
JSONObject jsonObject = wo.query("storagevehicle_code = '" + dto.getStoragevehicle_code() + "' and is_delete = '0'").uniqueResult(0); WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
JSONObject jsonObject = wo.query("storagevehicle_code = '" + dto.getString("storagevehicle_code") + "' and is_delete = '0' AND storagevehicle_id != '" + dto.getString("storagevehicle_id") + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(jsonObject)) { if (!ObjectUtil.isEmpty(jsonObject)) {
throw new BadRequestException("此载具已存在"); throw new BadRequestException("此载具已存在");
} }
StoragevehicleinfoDto entity = this.findById(dto.getStoragevehicle_id());
if (entity == null) {
throw new BadRequestException("被删除或无权限,操作失败!");
}
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String qty = dto.getString("qty");
dto.setUpdate_time(now); String pcsn = dto.getString("pcsn");
dto.setUpdate_optid(currentUserId); if (StrUtil.isNotEmpty(qty) || StrUtil.isNotEmpty(pcsn)) {
dto.setUpdate_optname(nickName); JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+dto.getString("storagevehicle_code")+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(ext_jo)) {
//新增一条记录
JSONObject jsonVeExt = new JSONObject();
jsonVeExt.put("storagevehicleext_id", org.nl.common.utils.IdUtil.getLongId());
jsonVeExt.put("storagevehicle_id", dto.getLongValue("storagevehicle_id"));
jsonVeExt.put("storagevehicle_code", dto.getString("storagevehicle_code"));
jsonVeExt.put("storagevehicle_type", dto.getString("storagevehicle_type"));
if (StrUtil.isNotEmpty(pcsn)) {
jsonVeExt.put("pcsn", pcsn);
}
if (StrUtil.isNotEmpty(qty)) {
jsonVeExt.put("qty", qty);
}
jsonVeExt.put("device_uuid", org.nl.common.utils.IdUtil.getLongId());
jsonVeExt.put("update_time", DateUtil.now());
veExtTab.insert(jsonVeExt);
} else {
if (StrUtil.isNotEmpty(pcsn)) {
ext_jo.put("pcsn", pcsn);
}
if (StrUtil.isNotEmpty(qty)) {
ext_jo.put("qty", qty);
}
veExtTab.update(ext_jo);
}
}
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json); wo.update(json);

View File

@@ -45,6 +45,9 @@
PAGEQUERY PAGEQUERY
SELECT SELECT
s.*, s.*,
ext.pcsn,
ext.qty,
ext.update_time AS change_time,
mater.material_code, mater.material_code,
mater.material_name, mater.material_name,
point.point_code, point.point_code,
@@ -56,6 +59,7 @@
LEFT JOIN ST_IVT_StructIvt ivt ON point.source_id = ivt.struct_id LEFT JOIN ST_IVT_StructIvt ivt ON point.source_id = ivt.struct_id
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id
LEFT JOIN md_pb_classstandard class ON class.class_code = s.storagevehicle_type LEFT JOIN md_pb_classstandard class ON class.class_code = s.storagevehicle_type
LEFT JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = s.storagevehicle_code
WHERE WHERE
s.is_delete = '0' s.is_delete = '0'
ENDOPTION ENDOPTION

View File

@@ -68,7 +68,7 @@
width="450px" width="450px"
> >
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
<el-form-item label="载具类型" prop="storagevehicle_type"> <el-form-item label="载具类型" v-if="crud.status.add > 0" prop="storagevehicle_type">
<treeselect <treeselect
v-model="form.storagevehicle_type" v-model="form.storagevehicle_type"
:load-options="loadChildNodes" :load-options="loadChildNodes"
@@ -78,8 +78,14 @@
/> />
</el-form-item> </el-form-item>
<br> <br>
<el-form-item label="载具数量" prop="num"> <el-form-item label="载具数量" v-if="crud.status.add > 0" prop="num">
<el-input-number v-model="form.num" :precision="0" style="width: 150px;"/> <el-input-number v-model="form.num" v-if="crud.status.add > 0" :precision="0" style="width: 150px;"/>
</el-form-item>
<el-form-item label="载具重量" v-if="crud.status.edit > 0" prop="qty">
<el-input-number v-model="form.qty" :precision="0" style="width: 150px;"/>
</el-form-item>
<el-form-item label="绑定物料" v-if="crud.status.edit > 0" prop="pcsn">
<el-input v-model="form.pcsn" :precision="0" style="width: 150px;"/>
</el-form-item> </el-form-item>
<el-form-item label="是否启用"> <el-form-item label="是否启用">
<el-radio v-model="form.is_used" label="0">否</el-radio> <el-radio v-model="form.is_used" label="0">否</el-radio>
@@ -88,8 +94,8 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="info" @click="crud.cancelCU">取消</el-button> <el-button type="info" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">生成</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button type="primary" @click="addAndprint">生成并打印</el-button> <el-button v-if="crud.status.add > 0" type="primary" @click="addAndprint">保存并打印</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
@@ -110,8 +116,8 @@
<!--<el-table-column prop="point_code" label="当前点位" width="120px"/> <!--<el-table-column prop="point_code" label="当前点位" width="120px"/>
<el-table-column prop="start_point_code" label="起点" width="120px"/> <el-table-column prop="start_point_code" label="起点" width="120px"/>
<el-table-column prop="next_point_code" label="终点" width="120px"/>--> <el-table-column prop="next_point_code" label="终点" width="120px"/>-->
<el-table-column prop="material_code" label="物料编码"/> <el-table-column prop="pcsn" label="绑定物料"/>
<el-table-column prop="material_name" label="物料名称"/> <el-table-column prop="qty" label="托盘重量"/>
<el-table-column label="是否启用" align="center" prop="is_used"> <el-table-column label="是否启用" align="center" prop="is_used">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@@ -127,7 +133,7 @@
<el-table-column <el-table-column
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']" v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
label="操作" label="操作"
width="100px" width="150px"
align="center" align="center"
fixed="right" fixed="right"
> >
@@ -135,7 +141,6 @@
<udOperation <udOperation
:data="scope.row" :data="scope.row"
:permission="permission" :permission="permission"
:is-visiable-edit="false"
/> />
</template> </template>
</el-table-column> </el-table-column>
@@ -180,7 +185,9 @@ const defaultForm = {
overstruct_type: null, overstruct_type: null,
occupystruct_qty: null, occupystruct_qty: null,
ext_id: null, ext_id: null,
num: '1' num: '1',
qty: null,
pcsn: null
} }
export default { export default {
name: 'Storagevehicleinfo', name: 'Storagevehicleinfo',