Merge remote-tracking branch 'origin/master_merge' into master_merge

This commit is contained in:
zhouz
2024-08-01 16:11:32 +08:00
14 changed files with 181 additions and 201 deletions

View File

@@ -1,24 +1,25 @@
package org.nl.b_lms.pdm.subpackagerelation.controller; package org.nl.b_lms.pdm.subpackagerelation.controller;
import java.util.Set;
import java.util.Map;
import cn.dev33.satoken.annotation.SaIgnore; import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.common.TableDataInfo;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.modules.logging.annotation.Log;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.nl.modules.logging.annotation.Log; import org.springframework.web.bind.annotation.*;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/** /**
@@ -33,6 +34,8 @@ import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationServi
@Slf4j @Slf4j
public class PdmBiSubpackagerelationController { public class PdmBiSubpackagerelationController {
@Resource
private RedissonClient redissonClient;
@Resource @Resource
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService; private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
@@ -52,6 +55,7 @@ public class PdmBiSubpackagerelationController {
@GetMapping("/queryBoxSpec") @GetMapping("/queryBoxSpec")
@SaIgnore
@Log("查询待检区木箱规格") @Log("查询待检区木箱规格")
public ResponseEntity<Object> queryBoxSpec(@RequestParam Map whereJson, Pageable page) { public ResponseEntity<Object> queryBoxSpec(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(pdmBiSubpackagerelationService.queryBoxSpec(whereJson, page), HttpStatus.OK); return new ResponseEntity<>(pdmBiSubpackagerelationService.queryBoxSpec(whereJson, page), HttpStatus.OK);
@@ -117,7 +121,22 @@ public class PdmBiSubpackagerelationController {
@Log("子卷装箱") @Log("子卷装箱")
//@SaCheckPermission("@el.check(updateEntityList)") //@SaCheckPermission("@el.check(updateEntityList)")
public ResponseEntity<Object> updateEntityList(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> updateEntityList(@RequestBody JSONObject whereJson) {
pdmBiSubpackagerelationService.updateEntityList(whereJson); RLock lock = redissonClient.getLock("updateEntityList");
boolean tryLock = false;
try {
tryLock = lock.tryLock(0, TimeUnit.SECONDS);
if (tryLock) {
pdmBiSubpackagerelationService.updateEntityList(whereJson);
} else {
log.info("子卷装箱操作正在执行被锁住。");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} finally {
if (tryLock) {
lock.unlock();
}
}
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation; import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
@@ -28,6 +29,6 @@ public interface PdmBiSubpackagerelationMapper extends BaseMapper<PdmBiSubpackag
@Param("status") String status); @Param("status") String status);
List<PdmBiSubpackagerelation> queryContainerNameBySaleOrder( @Param("sale_order_name") String sale_order_name,@Param("container_name") String container_name); List<PdmBiSubpackagerelationDto> queryContainerNameBySaleOrder(@Param("sale_order_name") String sale_order_name, @Param("container_name") String container_name);
} }

View File

@@ -54,7 +54,7 @@
FROM FROM
pdm_bi_subpackagerelation pdm_bi_subpackagerelation
WHERE WHERE
container_name IN (SELECT container_name FROM bst_ivt_packageinfoivt WHERE point_status = '3' AND ivt_status = '3') container_name IN (SELECT container_name FROM bst_ivt_packageinfoivt WHERE point_status = '3' AND ivt_status = '3' AND is_used ='1' )
<if test="sale_order_name != null and sale_order_name != ''"> <if test="sale_order_name != null and sale_order_name != ''">
AND sale_order_name LIKE CONCAT('%', #{sale_order_name}, '%') AND sale_order_name LIKE CONCAT('%', #{sale_order_name}, '%')
</if> </if>
@@ -72,28 +72,43 @@
ORDER BY ORDER BY
MAX(create_time) DESC MAX(create_time) DESC
</select> </select>
<select id="queryContainerNameBySaleOrder" resultType="org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation"> <select id="queryContainerNameBySaleOrder" resultType="org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto">
SELECT a.*, SELECT
b.*, a.workorder_id,
(CASE a.package_box_sn,
WHEN c.paper_tube_or_FRP = '1' THEN c.paper_tube_description a.quanlity_in_box,
WHEN c.paper_tube_or_FRP = '2' THEN c.FRP_description END) AS paper_tube_description, a.box_weight,
c.weight, a.sale_order_name,
c.paper_weight a.customer_name,
FROM `pdm_bi_subpackagerelation` a a.customer_description,
LEFT JOIN bst_ivt_packageinfoivt b ON a.container_name = b.container_name a.container_name,
LEFT JOIN pdm_bi_slittingproductionplan c ON a.container_name = c.container_name a.status,
WHERE b.point_status = '3' a.box_type,
AND b.ivt_status = '3' a.sap_pcsn,
AND b.is_used = '1' a.box_group,
AND c.is_delete = '0' (CASE
<if test="sale_order_name != null and sale_order_name != ''"> WHEN c.paper_tube_or_FRP = '1' THEN c.paper_tube_description
AND a.sale_order_name = #{sale_order_name} WHEN c.paper_tube_or_FRP = '2' THEN c.FRP_description END) AS paper_tube_description,
</if> c.weight,
<if test="container_name != null and container_name != ''"> c.paper_weight,
AND a.container_name = #{container_name} b.point_status,
</if> b.point_code,
ORDER BY box_group b.ivt_status,
b.is_used
FROM `pdm_bi_subpackagerelation` a
LEFT JOIN bst_ivt_packageinfoivt b ON a.container_name = b.container_name
LEFT JOIN pdm_bi_slittingproductionplan c ON a.container_name = c.container_name
WHERE b.point_status = '3'
AND b.ivt_status = '3'
AND b.is_used = '1'
AND c.is_delete = '0'
<if test="sale_order_name != null and sale_order_name != ''">
AND a.sale_order_name = #{sale_order_name}
</if>
<if test="container_name != null and container_name != ''">
AND a.container_name = #{container_name}
</if>
ORDER BY box_group
</select> </select>

View File

@@ -1,11 +1,11 @@
package org.nl.b_lms.pdm.subpackagerelation.dto; package org.nl.b_lms.pdm.subpackagerelation.dto;
import java.math.BigDecimal;
import java.io.Serializable;
import lombok.*;
import lombok.Data;
import lombok.Builder; import lombok.Builder;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
/** /**
@@ -35,10 +35,7 @@ public class PdmBiSubpackagerelationDto implements Serializable {
* 木箱自身重量 * 木箱自身重量
*/ */
private BigDecimal box_weight; private BigDecimal box_weight;
/**
* 保质期
*/
private String quality_guaran_period;
/** /**
* 销售订单及行号 * 销售订单及行号
*/ */
@@ -51,158 +48,43 @@ public class PdmBiSubpackagerelationDto implements Serializable {
* 客户名称 * 客户名称
*/ */
private String customer_description; private String customer_description;
/**
* 产品编码
*/
private String product_name;
/**
* 产品描述
*/
private String product_description;
/**
* 入库日期
*/
private String date_of_FG_inbound;
/** /**
* 子卷号 * 子卷号
*/ */
private String container_name; private String container_name;
/**
* 产品规格(幅宽)
*/
private String width;
/**
* 产品厚度
*/
private String thickness;
/**
* 单位面积质量
*/
private BigDecimal mass_per_unit_area;
/**
* 净重
*/
private BigDecimal net_weight;
/**
* 长度
*/
private BigDecimal length;
/**
* 制造完成日期
*/
private String date_of_production;
/**
* 计划外分切的子卷
*/
private String is_un_plan_production;
/**
* 子卷的物性值1
*/
private String un_plan_product_property1;
/**
* 子卷的物性值2
*/
private String un_plan_product_property2;
/**
* 子卷的物性值3
*/
private String un_plan_product_property3;
/**
* 备注
*/
private String remark;
/**
* 创建人
*/
private Long create_id;
/**
* 创建人姓名
*/
private String create_name;
/**
* 创建时间
*/
private String create_time;
/** /**
* 状态 * 状态
*/ */
private String status; private String status;
/**
* 是否需要重打外包装标签
*/
private String isRePrintPackageBoxLabel;
/**
* 是否需要拆包重打子卷标签
*/
private String isUnPackBox;
/** /**
* 木箱料号 * 木箱料号
*/ */
private String box_type; private String box_type;
/** /**
* SAP批次 * SAP批次
*/ */
private String sap_pcsn; private String sap_pcsn;
/** /**
* 交货单号 * 木箱组
*/ */
private String vbeln; private String box_group;
/** /**
* 交货单行号 * 子卷规格
*/ */
private String posnr; private String paper_tube_description;
/** /**
* 木箱长度 * 纸管重量
*/ */
private String box_length; private String paper_weight;
/** /**
* 木箱宽度 * 子卷重量
*/ */
private String box_width; private String weight;
/**
* 木箱高度
*/
private String box_high;
/**
* 销售订单描述
*/
private String sale_order_description;
/**
* 客户要求规格幅宽
*/
private String width_standard;
/**
* 物料标准厚度
*/
private String thickness_request;
/**
* 实际木箱自身重量
*/
private BigDecimal real_weight;
/**
* 包装关系类型
*/
private String sub_type;
/**
* 客户需求抗拉下限
*/
private String demand_limit;
/**
* 内控标准抗拉下限
*/
private String standard_limit;
/**
* 生产实际抗拉值
*/
private String actual_value;
/**
* 解绑删除标识
*/
private String need_delete;
/**
* 储存地点
*/
private String ext_code;
} }

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation; import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -58,7 +59,7 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
* @param whereJson 查询条件 * @param whereJson 查询条件
* @return List<PdmBiSubpackagerelation> * @return List<PdmBiSubpackagerelation>
*/ */
List<PdmBiSubpackagerelation> queryContainerNameBySaleOrder(Map whereJson); List<PdmBiSubpackagerelationDto> queryContainerNameBySaleOrder(Map whereJson);
/** /**

View File

@@ -1,7 +1,6 @@
package org.nl.b_lms.pdm.subpackagerelation.service.impl; package org.nl.b_lms.pdm.subpackagerelation.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.StopWatch;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@@ -25,6 +24,7 @@ import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService; import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation; import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper; import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService; import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper; import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
@@ -189,33 +189,39 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
* @param whereJson 查询条件 * @param whereJson 查询条件
*/ */
@Override @Override
public List<PdmBiSubpackagerelation> queryContainerNameBySaleOrder(Map whereJson) { public List<PdmBiSubpackagerelationDto> queryContainerNameBySaleOrder(Map whereJson) {
List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList; List<PdmBiSubpackagerelationDto> pdmBiSubpackagerelationList;
//请求来源 //请求来源
if (!whereJson.containsKey("type")) { if (!whereJson.containsKey("type")) {
return Collections.emptyList(); whereJson.put("type", PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"));
} }
if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) { if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) {
//订单号 //订单号
if (!whereJson.containsKey("sale_order_name")) { if (!whereJson.containsKey("sale_order_name")) {
return Collections.emptyList(); throw new BadRequestException("订单号不能为空!");
} }
pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper.queryContainerNameBySaleOrder(whereJson.get("sale_order_name").toString(), null); pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper.queryContainerNameBySaleOrder(whereJson.get("sale_order_name").toString(), null);
} else { } else {
//子卷号 //子卷号
if (!whereJson.containsKey("container_name")) { if (!whereJson.containsKey("container_name")) {
return Collections.emptyList(); throw new BadRequestException("子卷号不能为空!");
}
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new QueryWrapper<BstIvtPackageinfoivt>().eq("container_name", whereJson.get("container_name").toString()).eq("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
if (CollectionUtils.isEmpty(ivtList)) {
throw new BadRequestException("该子卷未质检或品质不符合要求,请扫码质检!");
} }
pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper.queryContainerNameBySaleOrder(null, whereJson.get("container_name").toString()); pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper.queryContainerNameBySaleOrder(null, whereJson.get("container_name").toString());
} }
Map<String, Long> countByGroup = pdmBiSubpackagerelationList.stream() Map<String, Long> countByGroup = pdmBiSubpackagerelationList.stream()
.filter(item -> item.getBox_group() != null) .filter(item -> item.getBox_group() != null)
.collect(Collectors.groupingBy(PdmBiSubpackagerelation::getBox_group, Collectors.counting())); .collect(Collectors.groupingBy(PdmBiSubpackagerelationDto::getBox_group, Collectors.counting()));
pdmBiSubpackagerelationList.forEach(r -> { pdmBiSubpackagerelationList.forEach(r -> {
//获取子卷长度 //获取子卷长度
// int containerLength = getMaxNum(null, r.getPaper_tube_description()); // int containerLength = getMaxNum(null, r.getPaper_tube_description());
// r.setUn_plan_product_property3(Integer.toString(containerLength)); // r.setUn_plan_product_property3(Integer.toString(containerLength));
if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) { if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) {
// r.setWeight(r.getWeight() != null ? r.getPaper_weight() : "0");
// r.setPaper_weight(r.getPaper_weight() != null ? r.getPaper_weight() : "0");
if (r.getBox_group() != null) { if (r.getBox_group() != null) {
r.setQuanlity_in_box(BigDecimal.valueOf(countByGroup.getOrDefault(r.getBox_group(), null))); r.setQuanlity_in_box(BigDecimal.valueOf(countByGroup.getOrDefault(r.getBox_group(), null)));
} else { } else {
@@ -224,6 +230,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
} }
} }
// 调用方法获取木箱料号:输入:子卷号、输出:木箱信息 // 调用方法获取木箱料号:输入:子卷号、输出:木箱信息
r.setBox_type("");
PdmBiOrderbominfo bomInfoDao = iPdmBiOrderbominfoService.getBiOrderbominfoByContainer(r.getContainer_name()); PdmBiOrderbominfo bomInfoDao = iPdmBiOrderbominfoService.getBiOrderbominfoByContainer(r.getContainer_name());
if (ObjectUtil.isNotEmpty(bomInfoDao)) { if (ObjectUtil.isNotEmpty(bomInfoDao)) {
r.setBox_type(bomInfoDao.getProductName()); r.setBox_type(bomInfoDao.getProductName());
@@ -271,9 +278,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
throw new BadRequestException("无选中子卷信息"); throw new BadRequestException("无选中子卷信息");
} }
//检查是否存在已分配规格的子卷号 //检查是否存在已分配规格的子卷号
List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList()); List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> !r.getStatus().equals("99")).collect(Collectors.toList());
if (isOutBox.size() > 0) { if (isOutBox.size() > 0) {
throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷"); throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷");
} }
JSONArray jsonArray = whereJson.getJSONArray("tableMater"); JSONArray jsonArray = whereJson.getJSONArray("tableMater");
if (jsonArray == null || jsonArray.size() == 0) { if (jsonArray == null || jsonArray.size() == 0) {
@@ -307,7 +314,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.collect(Collectors.toSet()); .collect(Collectors.toSet());
List<PdmBiSlittingproductionplan> planList = iPdmBiSlittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().in(PdmBiSlittingproductionplan::getContainer_name, containerNameList)); List<PdmBiSlittingproductionplan> planList = iPdmBiSlittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().in(PdmBiSlittingproductionplan::getContainer_name, containerNameList));
if (CollectionUtils.isEmpty(planList)) { if (CollectionUtils.isEmpty(planList)) {
throw new BadRequestException("需要装箱的子卷号不存在分切计划"); throw new BadRequestException("存在查询不到分切计划的子卷号");
} }
BigDecimal totalWeight; BigDecimal totalWeight;
totalWeight = planList.stream() totalWeight = planList.stream()
@@ -319,7 +326,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (totalWeight.compareTo(new BigDecimal(0)) == 0) { if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
throw new BadRequestException("分切计划的子卷重量不能为0"); throw new BadRequestException("分切计划的子卷重量不能为0");
} }
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup, whereJson.getString("checked"), totalWeight); // outBox(workIdList, containerNameList, deviceCode, maxBoxGroup,whereJson,totalWeight);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException(e.getMessage()); throw new BadRequestException(e.getMessage());
} }
@@ -374,11 +381,11 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
/** /**
* 空木箱出库 * 空木箱出库
*/ */
private void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer maxBoxGroup, String boxType, BigDecimal totalWeight) { private void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer maxBoxGroup, JSONObject whereJson, BigDecimal totalWeight) {
JSONObject boxInfo = new JSONObject(); JSONObject boxInfo = new JSONObject();
//确定装箱区终点 //确定装箱区终点
boxInfo.put("device_code", deviceCode); boxInfo.put("device_code", deviceCode);
boxInfo.put("material_code", boxType); boxInfo.put("material_code",whereJson.getString("checked"));
boxInfo.put("num", workIdList.size()); boxInfo.put("num", workIdList.size());
String boxSn = outBoxManageService.outBox(boxInfo); String boxSn = outBoxManageService.outBox(boxInfo);
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne( BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
@@ -397,13 +404,11 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (totalWeight.compareTo(new BigDecimal(0)) == 0) { if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
throw new BadRequestException("理论毛重不能为0"); throw new BadRequestException("理论毛重不能为0");
} }
StopWatch stopWatch1 = new StopWatch();
stopWatch1.start();
//更新及子卷包装状态已分配规格及木箱规格组 //更新及子卷包装状态已分配规格及木箱规格组
String weightTotal = totalWeight.toString(); String weightTotal = totalWeight.toString();
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
try { try {
updateBoxGroup(maxBoxGroup, workIdList, boxSn, boxType, weightTotal); updateBoxGroup(maxBoxGroup, workIdList, boxSn, whereJson.getString("checked"), weightTotal);
} catch (Exception e) { } catch (Exception e) {
log.error("子卷装箱异常,更新子卷包装关系异常:" + e); log.error("子卷装箱异常,更新子卷包装关系异常:" + e);
} }
@@ -411,7 +416,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
//给MES传输子卷包装关系 //给MES传输子卷包装关系
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
try { try {
transferBoxPackageToMes(true, null, containerNameList, boxSn, weightTotal); transferBoxPackageToMes(false, whereJson, containerNameList, boxSn, weightTotal);
} catch (Exception e) { } catch (Exception e) {
log.error("子卷装箱异常给MES传输子卷包装关系异常" + e); log.error("子卷装箱异常给MES传输子卷包装关系异常" + e);
} }
@@ -424,6 +429,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
log.error("子卷装箱异常,待检区->装箱区agv确定起点任务创建异常" + e); log.error("子卷装箱异常,待检区->装箱区agv确定起点任务创建异常" + e);
} }
}, pool); }, pool);
} }
/** /**

View File

@@ -50,7 +50,7 @@ public class TwoExceptionInTask extends AbstractAcsTask {
.task_type(json.getString("acs_task_type")) .task_type(json.getString("acs_task_type"))
.start_device_code(json.getString("point_code1")) .start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2")) .next_device_code(json.getString("point_code2"))
.vehicle_code(json.getString("vehicle_code")) .vehicle_code(json.getString("vehicle_code2"))
.interaction_json(json.getJSONObject("request_param")) .interaction_json(json.getJSONObject("request_param"))
.priority(json.getString("priority")) .priority(json.getString("priority"))
.class_type(json.getString("task_type")) .class_type(json.getString("task_type"))

View File

@@ -7,7 +7,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService; import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
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;
@@ -110,11 +109,16 @@ public class AutoSendVehicleToKzj {
} else { } else {
return; return;
} }
if (existTask.size() % 2 != 0) { List<BstIvtPackageinfoivt> packageinfoivtList = packageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code(""), null);
//优先去待检区 if (packageinfoivtList.size() == 1) {
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)")); pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
} else { } else {
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)")); if (existTask.size() % 2 != 0) {
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"));
} else {
//优先去待检区
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
}
} }
//去待检区或管制区搬运空载具 //去待检区或管制区搬运空载具
if (pointCode1 != null) { if (pointCode1 != null) {

View File

@@ -234,10 +234,12 @@
box.box_high box.box_high
FROM FROM
st_ivt_structattr attr st_ivt_structattr attr
LEFT JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code AND box.is_packing = '0' LEFT JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code
WHERE WHERE
attr.is_used = '1' attr.is_used = '1'
AND attr.is_delete = '0' AND attr.is_delete = '0'
AND attr.lock_type = '1'
AND box.is_packing = '0'
AND attr.sect_id = 输入.sect_id AND attr.sect_id = 输入.sect_id
OPTION 输入.row_in <> "" OPTION 输入.row_in <> ""

View File

@@ -183,4 +183,11 @@ public class MesToLmsController {
public ResponseEntity<Object> WasteFoilSuccess(@RequestBody JSONObject jo) { public ResponseEntity<Object> WasteFoilSuccess(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.WasteFoilSuccess(jo), HttpStatus.OK); return new ResponseEntity<>(mesToLmsService.WasteFoilSuccess(jo), HttpStatus.OK);
} }
@PostMapping("/boxIsPass")
@Log("飞书通知LMS木箱是否通过")
@SaIgnore
public ResponseEntity<Object> boxIsPass(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.boxIsPass(jo), HttpStatus.OK);
}
} }

View File

@@ -84,6 +84,5 @@ public interface MesToLmsService {
JSONObject WasteFoilSuccess(JSONObject param); JSONObject WasteFoilSuccess(JSONObject param);
JSONObject boxIsPass(JSONObject jo);
} }

View File

@@ -2361,4 +2361,36 @@ public class MesToLmsServiceImpl implements MesToLmsService {
return resultParam; return resultParam;
} }
@Override
public JSONObject boxIsPass(JSONObject param) {
log.info("boxIsPass输入参数为-------------------" + param.toString());
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
JSONObject resultParam = new JSONObject();
try {
if (ObjectUtil.isEmpty(param.getString("PackageBoxSn"))) {
throw new BadRequestException("木箱号不能为空!");
}
if (ObjectUtil.isEmpty(param.getString("IsPss"))) {
throw new BadRequestException("是否通过不能为空!");
}
// 更新子卷包装关系
JSONObject json = new JSONObject();
json.put("is_pass", param.getString("IsPss"));
subTab.update(json,"package_box_sn = '"+param.getString("PackageBoxSn")+"'");
resultParam.put("RTYPE", "S");
resultParam.put("RTMSG", "操作成功!");
resultParam.put("RTOAL", 1);
resultParam.put("RTDAT", null);
} catch (Exception e) {
resultParam.put("RTYPE", "E");
resultParam.put("RTMSG", "操作失败!" + e.getMessage());
resultParam.put("RTOAL", 0);
resultParam.put("RTDAT", null);
}
return resultParam;
}
} }

View File

@@ -388,7 +388,9 @@ export default {
this.form.checked = row.material_code this.form.checked = row.material_code
this.form.sale_order_name = this.saleOrderName this.form.sale_order_name = this.saleOrderName
await crudPackagerelation.updateEntityList(this.form) await crudPackagerelation.updateEntityList(this.form)
const res = crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.saleOrderName }) debugger
const queryParam = { sale_order_name: this.saleOrderName, type: '0' }
const res = crudSubpackagerelation.queryContainerization(queryParam)
this.openParam = res.content this.openParam = res.content
this.clearSelection() this.clearSelection()
this.form.tableMater = [] this.form.tableMater = []
@@ -399,9 +401,15 @@ export default {
debugger debugger
if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) { if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) {
debugger debugger
const weightList = this.currentSelection.filter(item => item.weight === '0' || item.weight === null)
if (weightList.length > 0) {
this.crud.notify('该子卷重量不能为空,请检查子卷的分切计划信息!', CRUD.NOTIFICATION_TYPE.WARNING)
return
}
const descriptionList = this.currentSelection.filter(item => item.paper_tube_description !== null && item.paper_tube_description !== '') const descriptionList = this.currentSelection.filter(item => item.paper_tube_description !== null && item.paper_tube_description !== '')
if (descriptionList.length === 0) { if (descriptionList.length === 0) {
this.crud.notify('未查询到该子卷的规格信息,请检查子卷的分切计划信息!', CRUD.NOTIFICATION_TYPE.WARNING) this.crud.notify('未查询到该子卷的规格信息,请检查子卷的分切计划信息!', CRUD.NOTIFICATION_TYPE.WARNING)
return
} }
const paper_tube_description = descriptionList[0].paper_tube_description const paper_tube_description = descriptionList[0].paper_tube_description
const descriptionsAreSame = this.currentSelection.every(item => item.paper_tube_description === paper_tube_description) const descriptionsAreSame = this.currentSelection.every(item => item.paper_tube_description === paper_tube_description)

View File

@@ -224,6 +224,7 @@ export default {
this.crud.toQuery() this.crud.toQuery()
}, },
async divOpen() { async divOpen() {
debugger
this.saleOrderName = this.currentRow.sale_order_name this.saleOrderName = this.currentRow.sale_order_name
const queryParam = { sale_order_name: this.currentRow.sale_order_name, type: '0' } const queryParam = { sale_order_name: this.currentRow.sale_order_name, type: '0' }
const res = await crudSubpackagerelation.queryContainerization(queryParam) const res = await crudSubpackagerelation.queryContainerization(queryParam)
@@ -231,6 +232,8 @@ export default {
// this.divShow = true // this.divShow = true
}, },
divOpen1() { divOpen1() {
debugger
this.saleOrderName = this.currentRow.sale_order_name
const queryParam = { sale_order_name: this.currentRow.sale_order_name, type: '0' } const queryParam = { sale_order_name: this.currentRow.sale_order_name, type: '0' }
crudSubpackagerelation.queryContainerization(queryParam).then(res => { crudSubpackagerelation.queryContainerization(queryParam).then(res => {
this.openParam = res.content this.openParam = res.content