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

This commit is contained in:
2025-05-10 14:29:22 +08:00
8 changed files with 101 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ package org.nl.b_lms.bst.ivt.cutpointivt.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
import org.nl.common.domain.query.PageQuery;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -93,6 +94,7 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
* @return
*/
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String location);
/**
* 获取一半的点位

View File

@@ -2,6 +2,7 @@ package org.nl.b_lms.bst.ivt.cutpointivt.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
import java.util.List;
@@ -18,6 +19,8 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String location);
List<BstIvtCutpointivt> getAllHalfPlacePoints(String type, String pointStatus, String location);
List<BstIvtCutpointivt> getCachePointSame(SlitterPlanDistinctDto dto);

View File

@@ -188,4 +188,36 @@
ORDER BY bic.sort_seq DESC
</if>
</select>
<select id="getAreaNotTaskPointByTcQzzPoint"
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto">
SELECT bic.ivt_id,bic.point_code,bic.qzz_no1 as qzz_no,bic.truss_point_code1 as qzz_point, p.qzz_generation, p.qzz_size
FROM bst_ivt_cutpointivt bic
LEFT JOIN pdm_bi_slittingproductionplan p ON ((p.qzzno = bic.qzz_no1 AND IFNULL(bic.qzz_no1,'') != '')
OR (p.qzzno = bic.qzz_no2 AND IFNULL(bic.qzz_no2,'') != ''))
WHERE bic.point_type = '1'
AND bic.is_used = '1'
AND bic.point_status = '3'
AND qzz_no1 !=''
AND bic.point_location = #{area}
AND 0 = (SELECT COUNT(*)
FROM sch_base_task t
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07'
AND t.is_delete = '0'
AND (t.point_code1 = bic.truss_point_code1 oR t.point_code2 = bic.truss_point_code1))
UNION all
SELECT bic.ivt_id,bic.point_code,bic.qzz_no2 as qzz_no,bic.truss_point_code2 as qzz_point, p.qzz_generation, p.qzz_size
FROM bst_ivt_cutpointivt bic
LEFT JOIN pdm_bi_slittingproductionplan p ON ((p.qzzno = bic.qzz_no1 AND IFNULL(bic.qzz_no1,'') != '')
OR (p.qzzno = bic.qzz_no2 AND IFNULL(bic.qzz_no2,'') != ''))
WHERE bic.point_type = '1'
AND bic.is_used = '1'
AND bic.point_location = #{area}
AND bic.point_status = '3'
AND qzz_no2 !=''
AND 0 = (SELECT COUNT(*)
FROM sch_base_task t
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07'
AND t.is_delete = '0'
AND (t.point_code1 = bic.truss_point_code2 oR t.point_code2 = bic.truss_point_code2));
</select>
</mapper>

View File

@@ -13,6 +13,7 @@ import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.mapper.BstIvtCutpointivtMapper;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
import org.nl.common.domain.query.PageQuery;
@@ -126,6 +127,11 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
return bstIvtCutpointivtMapper.getAreaNotTaskPointByLocationAreaAndStatus(location);
}
@Override
public List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String location) {
return bstIvtCutpointivtMapper.getAreaNotTaskPointByTcQzzPoint(location);
}
@Override
public List<BstIvtCutpointivt> getAllHalfPlacePoints(String type, String pointStatus, String location) {
return bstIvtCutpointivtMapper.getAllHalfPlacePoints(type, pointStatus, location);

View File

@@ -7,9 +7,11 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
import org.nl.b_lms.bst.ivt.papervehicle.service.IMdPbPapervehicleService;
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
import org.nl.b_lms.bst.ivt.shafttubeivt.service.IBstIvtShafttubeivtService;
@@ -20,6 +22,7 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproducti
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.sch.tasks.first_floor_area.auto.Prun;
import org.nl.b_lms.sch.tasks.slitter.StockAreaCallTubeTask;
import org.nl.b_lms.sch.tasks.slitter.StockAreaSendVehicleTask;
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
@@ -61,7 +64,7 @@ import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.doSavePaperInf
*/
@Slf4j
@Component
public class AutoCallAirShaftTask {
public class AutoCallAirShaftTask extends Prun {
@Autowired
private IBstIvtShafttubeivtService bstIvtShafttubeivtService;
@@ -759,7 +762,9 @@ public class AutoCallAirShaftTask {
stepStr += ",8";
log.info("不需要套轴,只做拔轴!");
//查询套轴缓存位哦:point_type=1
List<BstIvtCutpointivt> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByLocationAreaAndStatus(empty.getPoint_location());
List<CutpointAirShhaftDto> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByTcQzzPoint(empty.getPoint_location());
//所有TC暂存位有卷的Truss_point_code1Truss_point_code2有任务的
//根据point_code排序
if (notTaskPoints.size() == 0) {
stepStr += ",99";
return;
@@ -767,7 +772,8 @@ public class AutoCallAirShaftTask {
stepStr += ",9";
// 筛选一个满足的位置3寸看代数4/56寸直接
//判断气胀轴代
BstIvtCutpointivt cutpointivt = notTaskPoints.stream()
CutpointAirShhaftDto cutpointivt = notTaskPoints.stream()
.sorted(Comparator.comparingLong(CutpointAirShhaftDto::getIvt_id))
.filter(cut -> "6".equals(cut.getQzz_size()) ||
("3".equals(cut.getQzz_size()) && specification.equals(cut.getQzz_generation())))
.findFirst()
@@ -777,8 +783,8 @@ public class AutoCallAirShaftTask {
return;
}
stepStr += ",10";
String pointCode1 = ObjectUtil.isNotEmpty(cutpointivt.getQzz_no1()) ? cutpointivt.getTruss_point_code1() : cutpointivt.getTruss_point_code2();
String qzzNo = ObjectUtil.isNotEmpty(cutpointivt.getQzz_no1()) ? cutpointivt.getQzz_no1() : cutpointivt.getQzz_no2();
String pointCode1 = cutpointivt.getPoint_code();
String qzzNo = cutpointivt.getQzz_no();
// 获取对应的分切计划
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
.eq(PdmBiSlittingproductionplan::getQzzno, qzzNo)
@@ -786,11 +792,12 @@ public class AutoCallAirShaftTask {
if (list.size() == 0) {
stepStr += ",99";
log.warn("气涨轴[{}]对应的分切计划不存在!", qzzNo);
// 把点位禁用
cutpointivt.setIs_used("0");
cutpointivt.setRemark("气胀轴" + qzzNo + "的计划不存在,无效点位自动禁用。");
cutpointivt.setUpdate_time(DateUtil.now());
bcutpointivtService.updateById(cutpointivt);
bcutpointivtService.update(new UpdateWrapper<BstIvtCutpointivt>()
.eq("ivt_id",cutpointivt.getIvt_id())
.set("is_used","0")
.set("remark","气胀轴" + qzzNo + "的计划不存在,无效点位自动禁用")
.set("update_time",DateUtil.now()));
return;
}
PdmBiSlittingproductionplan plan = list.get(0);

View File

@@ -56,6 +56,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.system.service.param.ISysParamService;
import org.nl.system.service.param.dao.Param;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
@@ -65,6 +66,7 @@ import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
import org.nl.wms.pda.st.service.impl.PrintServiceImpl;
import org.nl.wms.sch.ComPareUtil;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.AutoSendFeiShu;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.CutConveyorTask;
import org.nl.wms.sch.tasks.EmptyVehicleTask;
@@ -2053,6 +2055,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
if (!compaerResult){
errorMsg.add("称重"+current_weight+"不匹配"+box_weight);
Param notify = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("weight_notify");
if (notify!=null && StringUtils.isNotEmpty(notify.getValue())){
AutoSendFeiShu.sendFeiShuMsg(notify.getValue(),box_no+"称重"+current_weight+",理论"+box_weight,"二期称重异常提醒");
}
}
if (!inbound){
errorMsg.add("手动至异常口");

View File

@@ -1,6 +1,7 @@
package org.nl.wms.pdm.bi.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
@@ -8,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.modules.logging.annotation.Log;
import org.nl.wms.pdm.bi.service.SubpackagerelationService;
import org.nl.wms.pdm.bi.service.dto.SubpackagerelationDto;
import org.nl.wms.sch.manage.AutoSendFeiShu;
import org.nl.wms.util.TranUtil;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
@@ -73,13 +75,10 @@ public class SubpackagerelationController {
public void download(@RequestParam Map map, HttpServletResponse response) throws IOException {
subpackagerelationService.download(map, response);
}
@Log("导出数据")
@GetMapping(value = "/tranTest")
public void tranTest(@RequestBody JSONObject param) throws IOException {
TranUtil.openTransaction((req,callback)->{
return null;
},new JSONArray());
@PostMapping (value = "/sendMsg")
@SaIgnore
public void tranTest(@RequestBody JSONObject param) {
AutoSendFeiShu.sendFeiShuMsg(param.getString("u"),param.getString("m"),param.getString("t"));
}
}

View File

@@ -47,7 +47,35 @@ public class AutoSendFeiShu {
}
}
}
public static void sendFeiShuMsg(String ul,String m,String t){
JSONObject jo = new JSONObject();
String[] u = ul.split(",");
JSONArray UserList = new JSONArray();
if (u.length > 0) {
for (String s : u) {
JSONObject param = new JSONObject();
param.put("User", s);
UserList.add(param);
}
}
jo.put("SendType", "L");
jo.put("Title", t);
jo.put("WarnType", "string");
jo.put("MessageType", "P");
jo.put("UserList", UserList);
jo.put("Message", m);
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/CommunalApi";
url = url + api;
try {
log.info("飞书输 ru参数为-------------------" + String.valueOf(jo));
String resultMsg = HttpRequest.post(url)
.body(String.valueOf(jo))
.execute().body();
} catch (Exception e) {
log.info(e.getMessage());
}
}
void sendInfo(JSONArray device_rows) {
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
for (int i = 0; i < device_rows.size(); i++) {