Merge remote-tracking branch 'origin/master'

This commit is contained in:
hongchao 2026-02-05 15:34:57 +08:00
commit 7f4dfd752d
10 changed files with 151 additions and 29 deletions

View File

@ -2,6 +2,7 @@ package com.bonus.common.biz.utils;
import com.alibaba.fastjson2.JSONObject;
import com.bonus.common.biz.constant.MaterialConstants;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@ -20,6 +21,7 @@ import java.nio.charset.StandardCharsets;
/**
* @author bonus
*/
@Slf4j
public class AutomaticHttpHelper {
public static final String KEY = "$jqgcYouote@c103";
@ -190,6 +192,7 @@ public class AutomaticHttpHelper {
//String tokenUrl = MaterialConstants.TEST_TOKEN_URL;
// 立体库生产环境token路径
String tokenUrl = MaterialConstants.PROD_TOKEN_URL;
log.info("立体仓获取token路径:{}", tokenUrl);
try {
String userName = "ZNXT";
String password = "123456";

View File

@ -79,6 +79,19 @@ public class BmQrBoxController extends BaseController {
return getDataTable(list);
}
/**
* 查询葫芦类及立体仓类标准箱混合信息
* @param bmQrBoxInfo
* @return
*/
@ApiOperation(value = "查询葫芦类及立体仓类标准箱混合信息")
@GetMapping("/getTotalList")
public TableDataInfo getTotalList(BmQrBoxInfo bmQrBoxInfo) {
startPage();
List<BmQrBoxInfo> list = qrBoxService.getTotalList(bmQrBoxInfo);
return getDataTable(list);
}
/**
* APP -- 查询二维码标准箱绑定列表 -- 不分页
* @param

View File

@ -230,4 +230,11 @@ public interface BmQrBoxMapper {
* @return
*/
List<BmQrBoxInfoExport> exportDetails(BmQrBoxInfo bean);
/**
* 查询葫芦类及立体仓类标准箱混合信息
* @param bmQrBoxInfo
* @return
*/
List<BmQrBoxInfo> getTotalList(BmQrBoxInfo bmQrBoxInfo);
}

View File

@ -177,4 +177,11 @@ public interface BmQrBoxService {
* @return
*/
List<BmQrBoxInfoExport> exportDetails(BmQrBoxInfo bean);
/**
* 查询葫芦类及立体仓类标准箱混合信息
* @param bmQrBoxInfo
* @return
*/
List<BmQrBoxInfo> getTotalList(BmQrBoxInfo bmQrBoxInfo);
}

View File

@ -925,6 +925,19 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
return bmQrBoxMapper.exportDetails(bean);
}
/**
* 查询葫芦类及立体仓类标准箱混合信息
* @param bmQrBoxInfo
* @return
*/
@Override
public List<BmQrBoxInfo> getTotalList(BmQrBoxInfo bmQrBoxInfo) {
if (bmQrBoxInfo == null || StringUtils.isBlank(bmQrBoxInfo.getBoxCode())) {
throw new RuntimeException("标准箱编码为空,请完善后重试!");
}
return bmQrBoxMapper.getTotalList(bmQrBoxInfo);
}
private int updateBoxStatus(BoxBindWarehouseDto boxMa) {
int result = 0;
result = bmQrBoxMapper.updateBoxStatus(boxMa);

View File

@ -221,7 +221,6 @@ public class LeaseApplyInfoController extends BaseController {
String title = "领料明细" + "" + "导出时间:" + DateUtils.getTime() + "";
ExcelUtil<LeaseApplyDetailExport> util = new ExcelUtil<>(LeaseApplyDetailExport.class);
util.exportExcel(response, list, fileName, title);
// expOutExcel(response, list, fileName);
} catch (Exception e) {
logger.error("导出领料明细失败", e);
}

View File

@ -1329,6 +1329,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
public List<LeaseApplyDetailExport> selectLeaseApplyDetailList(LeaseApplyInfo bean) {
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId() ;
bean.setUserId(userId);
// 转换为HashSet提高contains操作的效率O(1)
Set<?> statusSet = CollectionUtils.isEmpty(bean.getStatusList()) ?
Collections.emptySet() :
new HashSet<>(bean.getStatusList());
List<LeaseApplyDetailExport> listAll = new ArrayList<>();
//领料
List<LeaseApplyDetailExport> listOne = leaseApplyDetailsMapper.selectLeaseApplyLL(bean);
@ -1344,16 +1348,26 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 对合并后的列表进行排序
if (!CollectionUtils.isEmpty(listAll)) {
String keyWord = bean.getKeyWord();
if (StringUtils.isNotBlank(keyWord)) {
listAll = listAll.stream()
.filter(item -> StringUtils.isBlank(keyWord) || containsKeywordDetail(item, keyWord))
.collect(Collectors.toList());
for (LeaseApplyDetailExport leaseApplyDetailExport : listAll) {
if (leaseApplyDetailExport.getAlNum().compareTo(leaseApplyDetailExport.getOutNum()) == 0) {
leaseApplyDetailExport.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
} else {
leaseApplyDetailExport.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
}
}
listAll = listAll.stream()
// 先按code升序再按releaseTime降序null排末尾一次sorted完成多条件排序
.sorted(Comparator.comparing(LeaseApplyDetailExport::getCode)
.thenComparing(LeaseApplyDetailExport::getReleaseTime))
// 状态过滤
.filter(item -> statusSet.isEmpty() || statusSet.contains(item.getTaskStatus()))
// 分公司
.filter(item -> StringUtils.isBlank(bean.getImpUnitName())
|| Objects.equals(item.getImpUnitName(), bean.getImpUnitName()))
// 关键字
.filter(item -> StringUtils.isBlank(bean.getKeyWord())
|| containsKeywordDetail(item, bean.getKeyWord()))
// 按releaseTime降序null排末尾
.sorted(Comparator.comparing(LeaseApplyDetailExport::getReleaseTime,
Comparator.nullsFirst(Comparator.naturalOrder())).reversed())
.collect(Collectors.toList());
}
return listAll;
@ -1615,6 +1629,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 根据parentId查询属于立体仓的数据
List<LeaseApplyDetails> detailsList = leaseApplyInfoMapper.selectLeaseApplyInfoByParentId(leaseApplyInfo.getId());
if (!CollectionUtils.isEmpty(detailsList)) {
log.info("----------------开始同步数据到立体仓----------------");
// 向第三方发送出库请求创建出库单
ArrayList<AutomaticOutPutDto> list = new ArrayList<>();
// 数量出库
@ -1641,13 +1656,16 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
//String url = MaterialConstants.TEST_CREATE_OUT_URL;
// 立体库生产建立出库单接口路径
String url = MaterialConstants.PROD_CREATE_OUT_URL;
log.info("立体仓建立出库单路径:{}", url);
String data = AutomaticHttpHelper.sendHttpPostPushCost(url, body);
log.info("传输立体仓返回data:{}", data);
if (StringUtils.isEmpty(data)) {
System.err.println("立体仓出库单创建失败");
throw new RuntimeException("立体仓出库单创建失败");
}
JSONObject object = JSONObject.parseObject(data);
String code = object.getString("code");
log.info("传输立体仓返回code:{}", code);
if (!"0".equals(code)) {
System.err.println("立体仓出库单创建失败");
throw new RuntimeException("立体仓出库单创建失败");

View File

@ -586,6 +586,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
DESC
</select>
<select id="getTotalList" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
SELECT
qb.id as id,
qb.box_id as boxId,
qb.create_by as createBy,
mt1.type_name as typeName,
mt.type_name as typeModelName,
mm.ma_code as maCode,
mm.type_id as maTypeId,
qb.ma_id as maId,
qb.create_time AS createTime
FROM
bm_qrcode_box_bind qb
LEFT JOIN bm_qrcode_box bqb ON qb.box_id = bqb.box_id
LEFT JOIN ma_machine mm ON qb.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
where
mt1.type_name is not NULL
and mt.type_name is not NULL
and mm.ma_code is not NULL
and bqb.box_code = #{boxCode}
GROUP BY
mt1.type_name,
mt.type_name,
mm.ma_code
UNION ALL
SELECT
qb.id as id,
qb.box_id as boxId,
qb.create_by as createBy,
mt1.type_name as typeName,
mt.type_name as typeModelName,
qb.ma_code as maCode,
mt.type_id as maTypeId,
qb.ma_id AS maId,
qb.create_time AS createTime
FROM
bm_qrcode_box_bind qb
LEFT JOIN bm_qrcode_box bqb ON qb.box_id = bqb.box_id
LEFT JOIN ma_type mt ON bqb.type_id = mt.type_id AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
where
mt1.type_name is not NULL
and mt.type_name is not NULL
and qb.ma_code is not NULL
and bqb.box_code = #{boxCode}
GROUP BY
mt1.type_name,
mt.type_name,
qb.ma_code
</select>
<update id="updateTaskStatus">
UPDATE tm_task SET task_status = 22 WHERE task_id = #{taskId}
</update>

View File

@ -816,19 +816,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectLeaseApplyLL" resultType="com.bonus.common.biz.domain.lease.LeaseApplyDetailExport">
select
lod.id as id,
lad.id as id,
mt2.type_name as materialName,
mt1.type_name as typeModelName,
mt.type_name as typeName,
mt.unit_name as unitName,
lai.code,
lai.code as code,
lai.lease_person as leasePerson,
tt.task_status as taskStatus,
COALESCE(lai.release_time, lai.create_time) as releaseTime,
bu.unit_name as leaseUnit ,
bp.pro_name as leaseProject,
IFNULL(sum(lod.out_num),0) as alNum,
IFNULL(sum(lod.out_num),0) as outNum,
IFNULL(lad.pre_num, 0) as alNum,
IFNULL(lod.num, 0) as outNum,
sda.dict_label as taskStatusName,
sd.dept_name as impUnitName,
CASE
@ -838,8 +838,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bai.agreement_code as agreementCode,
bp.contract_part as contractPart
from
lease_out_details lod
left join lease_apply_info lai on lai.id = lod.parent_id
lease_apply_info lai
left join lease_apply_details lad on lai.id = lad.parent_id
LEFT JOIN (SELECT parent_id, type_id ,IFNULL( sum( out_num ), 0 )as num, lease_sign_id FROM lease_out_details
GROUP BY parent_id,type_id) lod ON lai.id = lod.parent_id and lad.type_id = lod.type_id
left join tm_task tt on lai.task_id = tt.task_id
left join tm_task_agreement tta on lai.task_id = tta.task_id
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
@ -848,12 +850,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_dept sd on sd.dept_id = bp.imp_unit
left join sys_dict_data sda on tt.task_status = sda.dict_value
and sda.dict_type = 'lease_task_status'
left join ma_type mt on lod.type_id = mt.type_id and mt.del_flag = '0'
left join ma_type mt on lad.type_id = mt.type_id and mt.del_flag = '0'
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
<if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id =#{userId}
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id =#{userId}
</if>
where
tt.task_type = '2' and lai.direct_id is null
@ -866,12 +868,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="leaseProjectId != null ">
and bai.project_id = #{leaseProjectId}
</if>
GROUP BY lai.id,lod.type_id
GROUP BY lai.id,lad.type_id
order by lai.id
</select>
<select id="selectLeaseApplyLY" resultType="com.bonus.common.biz.domain.lease.LeaseApplyDetailExport">
select
lod.id as id,
lpd.id as id,
mt2.type_name as materialName,
mt1.type_name as typeModelName,
mt.type_name as typeName,
@ -883,30 +885,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lpd.create_time AS releaseTime,
bu.unit_name as leaseUnit ,
bp.pro_name as leaseProject,
lod.out_num as alNum,
lod.out_num as outNum,
IFNULL(lpd.num, 0 ) AS alNum,
IFNULL(lod.num, 0) AS outNum,
sd.dept_name as impUnitName,
CASE
WHEN mt.manage_type = 0 THEN '编码出库'
ELSE '数量出库'
END as manageTypeName,
mm.ma_code as maCode,
bai.agreement_code as agreementCode,
bp.contract_part as contractPart
from
lease_out_details lod
left join lease_apply_info lai on lai.id = lod.parent_id
left join lease_publish_details lpd on lod.parent_id = lpd.parent_id and lod.publish_task = lpd.publish_task
lease_publish_details lpd
left join lease_apply_info lai on lai.id = lpd.parent_id
LEFT JOIN (SELECT IFNULL( sum(out_num ), 0) AS num, parent_id, publish_task, lease_sign_id ,a.type_id as type_id
from lease_out_details a
<if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = a.type_id AND mtk.user_id = #{userId}
</if>
WHERE a.publish_task is not null
GROUP BY parent_id, publish_task, a.type_id) lod ON lpd.parent_id = lod.parent_id
and lpd.new_type = lod.type_id
left join tm_task tt on tt.code = lai.code
left join bm_unit bu on bu.unit_id = lpd.unit_id
left join bm_project bp on bp.pro_id = lpd.project_id
left join sys_dept sd on sd.dept_id = bp.imp_unit
LEFT JOIN bm_agreement_info bai ON lpd.unit_id = bai.unit_id AND lpd.project_id = bai.project_id AND bai.project_unit_id IS NULL
left join ma_type mt on lod.type_id = mt.type_id and mt.del_flag = '0'
left join ma_type mt on lpd.new_type = mt.type_id and mt.del_flag = '0'
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
LEFT JOIN ma_machine mm on mm.ma_id = lod.ma_id
<if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id =#{userId}
</if>
@ -921,7 +928,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="leaseProjectId != null ">
and lpd.project_id = #{leaseProjectId}
</if>
GROUP BY lpd.publish_task,lod.type_id,lod.ma_Id
GROUP BY lpd.publish_task,lpd.new_type
order by lpd.id
</select>

View File

@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
pmc.type = 1 and
( pmc.LEASE_MONEY > 0 OR pmc.LOST_MONEY != 0 OR pmc.REPAIR_MONEY > 0 OR pmc.SCRAP_MONEY > 0 )
( (pmc.LEASE_MONEY > 0 or pmc.LEASE_MONEY &lt; 0) OR pmc.LOST_MONEY != 0 OR pmc.REPAIR_MONEY > 0 OR pmc.SCRAP_MONEY > 0 )
<if test="pushStatus != null">
AND a.pushStatus = #{pushStatus}
</if>