fix:子卷下线加上事务;一键设置加上dtl_id筛选;任务取消按钮加上权限设置

This commit is contained in:
zhouz
2026-01-06 10:04:46 +08:00
parent 1abe523c23
commit 2f73c81aaf
15 changed files with 120 additions and 43 deletions

View File

@@ -100,7 +100,7 @@ public class PdmBiSubpackagerelationController {
*
* @param whereJson 查询条件
*/
@PostMapping ("/queryContainerNameBySaleOrder")
@PostMapping("/queryContainerNameBySaleOrder")
@SaIgnore
@Log("根据订单号查询子卷信息")
public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestBody Map whereJson) {
@@ -159,13 +159,14 @@ public class PdmBiSubpackagerelationController {
}
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/zjInBound")
@SaIgnore
@Log("子卷装箱查询")
//@SaCheckPermission("@el.check(updateEntityList)")
public ResponseEntity<Object> zjInBound(@RequestBody JSONObject whereJson) {
List list = pdmBiSubpackagerelationService.zjInBound(whereJson);
return new ResponseEntity<>(TableDataInfo.build(list),HttpStatus.OK);
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
}
@@ -174,10 +175,10 @@ public class PdmBiSubpackagerelationController {
@Log("子卷装箱入库")
//@SaCheckPermission("@el.check(updateEntityList)")
public ResponseEntity<Object> zjInBoundConfirm(@RequestBody JSONObject whereJson) {
RedissonUtils.lock(c->{
RedissonUtils.lock(c -> {
pdmBiSubpackagerelationService.zjInBoundConfirm(whereJson);
},"zjInBound",0,this,"装箱入库在操作,稍后再试");
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
}, "zjInBound", 0, this, "装箱入库在操作,稍后再试");
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
}
@PostMapping("/boxReturn")
@@ -185,14 +186,13 @@ public class PdmBiSubpackagerelationController {
@Log("装箱位木箱回库")
//@SaCheckPermission("@el.check(updateEntityList)")
public ResponseEntity<Object> boxReturn(@RequestBody JSONObject whereJson) {
RedissonUtils.lock(c->{
RedissonUtils.lock(c -> {
pdmBiSubpackagerelationService.boxReturn(whereJson);
},"zjInBound",0,this,"装箱送回在操作,稍后再试");
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
}, "zjInBound", 0, this, "装箱送回在操作,稍后再试");
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
}
@PostMapping("/transferBoxPackageToMes")
@Log("传输子卷包装关系至LMS")
//@SaCheckPermission("@el.check(updateEntityList)")
@@ -225,7 +225,6 @@ public class PdmBiSubpackagerelationController {
}
@PostMapping("/schdule")
@Log("定时调度")
@SaIgnore
@@ -242,22 +241,30 @@ public class PdmBiSubpackagerelationController {
@SaIgnore
public ResponseEntity<Object> ycgzd(@RequestBody JSONObject param) {
String pointCode = param.getString("point_code");
if (StringUtils.isEmpty(pointCode)){
if (StringUtils.isEmpty(pointCode)) {
throw new BadRequestException("人工管制点不能为空");
}
// "ZXQ_135" : "ZXQ_136";
JSONObject task = new JSONObject();
task.put("point_code1", pointCode);
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
autoSendVehicleToDjq.getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/downloadData")
@SaIgnore
public void downloadData(Integer day, HttpServletResponse response) {
RedissonUtils.lock(a->{
pdmBiSubpackagerelationService.downloadData(3,(HttpServletResponse)a);
RedissonUtils.lock(a -> {
pdmBiSubpackagerelationService.downloadData(3, (HttpServletResponse) a);
return null;
},"下载任务时间",response);
}, "下载任务时间", response);
}
@PostMapping("/checkCode")
@Log("三码合一校验")
@SaIgnore
public ResponseEntity<Object> checkCode(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(pdmBiSubpackagerelationService.checkCode(whereJson), HttpStatus.OK);
}
}

View File

@@ -141,6 +141,7 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
*/
void downloadData(Integer day, HttpServletResponse response);
JSONObject checkCode(JSONObject jo);
}

View File

@@ -942,12 +942,47 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
strings[5] = "呼叫时间";
new FileUtil().downloadExcelIO(ioData, strings, response);
}
@Override
public List<JSONObject> recordQuery(List<String> pcsn) {
if (CollectionUtils.isEmpty(pcsn)){
if (CollectionUtils.isEmpty(pcsn)) {
return new ArrayList<>();
}
return this.baseMapper.recordQuery(pcsn);
}
@Override
public JSONObject checkCode(JSONObject jo) {
//内标
String nb_code = jo.getString("nb_code");
//管标
String gb_code = jo.getString("gb_code");
//木箱码
String box_code = jo.getString("box_code");
//客户标签码
String customer_code = jo.getString("customer_code");
if (!StrUtil.equals(nb_code, gb_code)) {
throw new BadRequestException("内标【" + nb_code + "】和管标【" + gb_code + "】子卷号不一致!");
}
if (!StrUtil.equals(box_code, customer_code)) {
throw new BadRequestException("木箱码【" + box_code + "】和客户标签码【" + customer_code + "】箱号不一致!");
}
PdmBiSubpackagerelation subDto = this.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, nb_code));
if (ObjectUtil.isEmpty(subDto)) {
throw new BadRequestException("子卷号【" + nb_code + "】在LMS系统上为查询到包装关系");
}
if (StrUtil.isEmpty(subDto.getPackage_box_sn())) {
throw new BadRequestException("子卷号【" + nb_code + "】在LMS系统上包装关系的木箱号为空");
}
if (!StrUtil.equals(box_code, subDto.getPackage_box_sn())) {
throw new BadRequestException("子卷号绑定的木箱码【" + subDto.getPackage_box_sn() + "】和木箱码【" + box_code + "】箱号不一致!");
}
JSONObject result = new JSONObject();
result.put("message", "校验通过!");
return result;
}
}

View File

@@ -55,6 +55,7 @@ public class SsxDjwTask extends AbstractAcsTask {
@Override
@Transactional(rollbackFor = Exception.class)
public List<AcsTaskDto> addTask() {
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>().eq(SchBaseTask::getHandle_class, THIS_CLASS)

View File

@@ -16,11 +16,14 @@ import org.nl.b_lms.sch.tasks.first_floor_area.SsxDjwTask;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
@@ -33,7 +36,6 @@ import java.util.stream.Collectors;
@Slf4j
@Component
@RequiredArgsConstructor
public class AutoExecuteWaitTask extends Prun{
private final String THIS_CLASS = AutoExecuteWaitTask.class.getName();
@@ -50,10 +52,10 @@ public class AutoExecuteWaitTask extends Prun{
private IbstIvtPackageinfoivtService packageinfoivtService;
//自动执行等待的桁架任务
@Autowired
public void run() {
try {
this.executeWaitTask();
AutoExecuteWaitTask bean = SpringContextHolder.getBean(AutoExecuteWaitTask.class);
bean.executeWaitTask();
}catch (Exception ex){
log.error(ex.getMessage());
}
@@ -64,6 +66,7 @@ public class AutoExecuteWaitTask extends Prun{
* 放满与取空桁架任务
*/
@SneakyThrows
@Transactional
public void executeWaitTask() {
log.info(THIS_CLASS+"-放满与取空桁架定时任务开始执行扫描。");
RLock lock = redissonClient.getLock(THIS_CLASS);
@@ -130,6 +133,10 @@ public class AutoExecuteWaitTask extends Prun{
task.setPoint_code1(kzjPointList.get(0).getPoint_code());
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
taskService.updateById(task);
List<SchBaseTask> test = taskService.list(new LambdaUpdateWrapper<SchBaseTask>().eq(SchBaseTask::getHandle_class, THIS_CLASS)
.eq(SchBaseTask::getTask_status, TaskStatusEnum.START_AND_POINT.getCode())
.eq(SchBaseTask::getIs_delete, 0)
);
ssxDjwTask.immediateNotifyAcs(null);
}
}

View File

@@ -44,6 +44,6 @@ public interface IStIvtIostorinvdisService extends IService<StIvtIostorinvdis> {
*/
void confirmDisIn(String task_id);
List<StructAllsetDto> getDisStructSet(String iostorinvId);
List<StructAllsetDto> getDisStructSet(String iostorinvId, String iostorinvDtlId);
}

View File

@@ -20,6 +20,7 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
/**
* 获取全部已分配未下发的分配明细
*
* @param whereJson :{
* iostorinvdtl_id 明细标识 (自动取消时传)
* box_no 箱号 (自动取消时传)
@@ -40,6 +41,7 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
/**
* 获取此单据下/此明细下 所有未生成的分配明细
*
* @param whereJson :{
* iostorinvdtl_id 明细标识
* iostorinv_id 单据标识
@@ -48,10 +50,6 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
*/
List<JSONObject> getNotCreateDis(JSONObject whereJson);
@Select("select st_ivt_structattr.sect_id,st_ivt_structattr.block_num,st_ivt_structattr.row_num,st_ivt_structattr.out_order_seq,st_ivt_structattr.struct_code,st_ivt_structattr.placement_type \n" +
"from st_ivt_iostorinvdis \n" +
"left join st_ivt_structattr on st_ivt_iostorinvdis.struct_code = st_ivt_structattr.struct_code\n" +
"where st_ivt_iostorinvdis.work_status = '00' and st_ivt_iostorinvdis.iostorinv_id = #{iostorinvId}")
List<StructAllsetDto> getDisStructSet(String iostorinvId);
List<StructAllsetDto> getDisStructSet(String iostorinvId,String iostorinvDtlId);
}

View File

@@ -128,4 +128,20 @@
</select>
<select id="getDisStructSet" resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructAllsetDto">
select st_ivt_structattr.sect_id,
st_ivt_structattr.block_num,
st_ivt_structattr.row_num,
st_ivt_structattr.out_order_seq,
st_ivt_structattr.struct_code,
st_ivt_structattr.placement_type
from st_ivt_iostorinvdis dis
left join st_ivt_structattr on st_ivt_iostorinvdis.struct_code = st_ivt_structattr.struct_code
where st_ivt_iostorinvdis.work_status = '00'
and st_ivt_iostorinvdis.iostorinv_id = #{iostorinvId}
<if test="iostorinvDtlId != null and iostorinvDtlId != ''">
AND dis.iostorinvdtl_id = #{iostorinvDtlId}
</if>
</select>
</mapper>

View File

@@ -151,8 +151,8 @@ public class StIvtIostorinvdisServiceImpl extends ServiceImpl<StIvtIostorinvdisM
}
@Override
public List<StructAllsetDto> getDisStructSet(String iostorinvId) {
List<StructAllsetDto> structSet = this.baseMapper.getDisStructSet(iostorinvId);
public List<StructAllsetDto> getDisStructSet(String iostorinvId ,String iostorinvDtlId) {
List<StructAllsetDto> structSet = this.baseMapper.getDisStructSet(iostorinvId, iostorinvDtlId);
return structSet;
}
}

View File

@@ -142,7 +142,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
List<String> permission = new LinkedList<>();
// 查看是否为管理员
permission.add("admin");
permission.addAll(sysMenuMapper.getPermissionByUserId(userDto.getString("userId")));
permission.addAll(sysMenuMapper.getPermissionByUserId(userDto.getString("user_id")));
return permission;
}

View File

@@ -280,11 +280,14 @@ public class CheckOutBillController {
@Log("出库单强制确认")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
String iostorinv_id = whereJson.getString("iostorinv_id");
RedissonUtils.lock(c -> {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.confirm(whereJson);
} else {
checkOutBillService.confirmOrder(whereJson);
}
}, iostorinv_id, 1, 120, null);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

View File

@@ -39,6 +39,7 @@ import org.nl.system.service.dept.dao.SysUserDept;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.sch.AcsUtil;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.OutTask;
import org.nl.wms.st.inbill.service.CheckOutBillService;
@@ -3253,7 +3254,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
}
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
List<StructAllsetDto> structSet = iStIvtIostorinvdisService.getDisStructSet(whereJson.getString("iostorinv_id"));
List<StructAllsetDto> structSet = iStIvtIostorinvdisService.getDisStructSet(whereJson.getString("iostorinv_id"),whereJson.getString("iostorinvdtl_id"));
//同区同排排序10302-04-01
//口口回口回口口口1
//口口回回口口口口2

View File

@@ -264,7 +264,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
mp.put("销售订单", json.getString("sale_order_name"));
mp.put("行号", "");
}
mp.put("出库日期", json.getString("input_time"));
mp.put("出库日期", json.getString("confirm_time"));
mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width")));
mp.put("产品厚度", json.getString("thickness"));
mp.put("单位面积", json.getString("mass_per_unit_area"));

View File

@@ -170,6 +170,7 @@
@click="doOperate(scope.row, 'a')"
>完成</el-button>
<el-button
v-permission="['instruction:del']"
type="text"
icon="el-icon-error"
@click="doOperate(scope.row, 'b')"
@@ -270,26 +271,33 @@ export default {
this.finishTypeList = data
})
const today = new Date()
const threeDaysAgo = new Date(today)
threeDaysAgo.setDate(today.getDate() - 3)
const year = today.getFullYear()
const month = String(today.getMonth() + 1).padStart(2, '0')
const beforeDay = String(threeDaysAgo.getDate()).padStart(2, '0')
const day = String(today.getDate()).padStart(2, '0')
// 2. 构造固定时分秒的时间字符串符合datetime-local格式
const startTime = `${year}-${month}-${day - 3} 00:00:00`
const startTime = `${year}-${month}-${beforeDay} 00:00:00`
const endTime = `${year}-${month}-${day} 23:59:59`
this.crud.query.createTime = [startTime, endTime]
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
debugger
if (this.query_flag) {
const today = new Date()
const threeDaysAgo = new Date(today) // 复制今天日期,避免修改原对象
threeDaysAgo.setDate(today.getDate() - 3) // 正确减去3天
const year = today.getFullYear()
const month = String(today.getMonth() + 1).padStart(2, '0')
const day = String(today.getDate()).padStart(2, '0')
const beforeDay = String(threeDaysAgo.getDate()).padStart(2, '0')
// 2. 构造固定时分秒的时间字符串符合datetime-local格式
const startTime = `${year}-${month}-${day - 3} 00:00:00`
const startTime = `${year}-${month}-${beforeDay} 00:00:00`
const endTime = `${year}-${month}-${day} 23:59:59`
this.crud.query.createTime = [startTime, endTime]
this.crud.query.begin_time = startTime

View File

@@ -128,7 +128,7 @@
<el-table-column show-overflow-tooltip prop="customer_name" label="客户编码" :min-width="flexWidth('customer_name',crud.data,'客户编码')" />
<el-table-column show-overflow-tooltip prop="customer_description" label="发货客户名称" :min-width="flexWidth('customer_description',crud.data,'客户名称')" />
<el-table-column show-overflow-tooltip prop="sale_order_name" label="销售订单" :min-width="flexWidth('sale_order_name',crud.data,'销售订单')" />
<el-table-column show-overflow-tooltip prop="input_time" label="出库日期" :min-width="flexWidth('input_time',crud.data,'出库日期')" />
<el-table-column show-overflow-tooltip prop="confirm_time" label="出库日期" :min-width="flexWidth('confirm_time',crud.data,'出库日期')" />
<el-table-column show-overflow-tooltip prop="width" label="产品规格" :formatter="crud.formatNum0" :min-width="flexWidth('width',crud.data,'产品规格')" />
<el-table-column show-overflow-tooltip prop="thickness" label="产品厚度" :min-width="flexWidth('thickness',crud.data,'产品厚度')" />
<el-table-column show-overflow-tooltip prop="paper_type" label="管件类型" :min-width="flexWidth('paper_type',crud.data,'管件类型')" />