代码提交

This commit is contained in:
liang.chao 2025-03-10 18:12:05 +08:00
parent 9fd3d09005
commit 8243be6781
16 changed files with 142 additions and 13 deletions

View File

@ -9,4 +9,4 @@ spring:
name: sgzb-auth name: sgzb-auth
profiles: profiles:
# 环境配置 # 环境配置
active: sgzb_cloud_dev active: sgzb_cloud_local

View File

@ -9,4 +9,4 @@ spring:
name: sgzb-gateway name: sgzb-gateway
profiles: profiles:
# 环境配置 # 环境配置
active: sgzb_cloud_dev active: sgzb_cloud_local

View File

@ -8,6 +8,7 @@ import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
import com.bonus.sgzb.app.service.LeaseApplyInfoService; import com.bonus.sgzb.app.service.LeaseApplyInfoService;
import com.bonus.sgzb.app.service.LeaseUserBookService; import com.bonus.sgzb.app.service.LeaseUserBookService;
import com.bonus.sgzb.app.service.TmTaskService; import com.bonus.sgzb.app.service.TmTaskService;
import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.base.service.ITypeService; import com.bonus.sgzb.base.service.ITypeService;
import com.bonus.sgzb.common.core.utils.ListPagingUtil; import com.bonus.sgzb.common.core.utils.ListPagingUtil;
import com.bonus.sgzb.common.core.utils.ServletUtils; import com.bonus.sgzb.common.core.utils.ServletUtils;
@ -626,6 +627,19 @@ public class TmTaskController extends BaseController {
List<TmTask> leaseAuditList = tmTaskService.getLeaseListAllCq(task); List<TmTask> leaseAuditList = tmTaskService.getLeaseListAllCq(task);
return getDataTable(leaseAuditList); return getDataTable(leaseAuditList);
} }
@Log(title = "查询差缺量在哪些工程上申请", businessType = BusinessType.QUERY)
@GetMapping("/getPreNumInUse")
public AjaxResult getPreNumInUse(PreNumInUse tmTask) {
startPage();
List<PreNumInUse> leaseAuditList = tmTaskService.getPreNumInUse(tmTask);
return AjaxResult.success(getDataTable(leaseAuditList));
}
@PostMapping("/exportPreNumInUse")
public void exportPreNumInUse(HttpServletResponse response,PreNumInUse tmTask) {
List<PreNumInUse> list = tmTaskService.getPreNumInUse(tmTask);
ExcelUtil<PreNumInUse> util = new ExcelUtil<PreNumInUse>(PreNumInUse.class);
util.exportExcel(response, list, "差缺量工程申请详情表");
}
/** /**
* 查询库管员下拉信息 * 查询库管员下拉信息

View File

@ -205,4 +205,10 @@ public class LeaseApplyDetails implements Serializable {
@ApiModelProperty(value="代替规格") @ApiModelProperty(value="代替规格")
private String maModel; private String maModel;
@ApiModelProperty(value="成套机具三级typeId")
private Integer ctParentId;
@ApiModelProperty(value="是否是成套机具0是 1否")
private Integer isCt;
@ApiModelProperty(value="默认1,0不是库存管理")
private String isStorage;
} }

View File

@ -10,6 +10,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
* Description: * Description:

View File

@ -0,0 +1,22 @@
package com.bonus.sgzb.app.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import lombok.Data;
/**
* @Authorliang.chao
* @Date2025/3/10 - 16:55
*/
@Data
public class PreNumInUse {
@Excel(name = "领料工程")
private String proName;
@Excel(name = "领料单位")
private String unitName;
@Excel(name = "单号")
private String code;
@Excel(name = "领料数量")
private String preNum;
private String typeId;
private String keyWord;
}

View File

@ -11,6 +11,7 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Description: 任务表tm_task * Description: 任务表tm_task
@ -42,6 +43,7 @@ public class TmTask implements Serializable {
@ApiModelProperty(value = "任务类型(数据字典)") @ApiModelProperty(value = "任务类型(数据字典)")
private Integer taskType; private Integer taskType;
private List<TmTask> outboundType; private List<TmTask> outboundType;
private List<Integer> wholeTypeName;
/** /**
* 任务状态(定义数据字典) * 任务状态(定义数据字典)
@ -61,6 +63,11 @@ public class TmTask implements Serializable {
*/ */
@ApiModelProperty(value = "已出库数量") @ApiModelProperty(value = "已出库数量")
private Integer alNum; private Integer alNum;
/**
* 预领料合计数
*/
@ApiModelProperty(value = "预领数量")
private Integer preNum;
/** /**
* 库存 * 库存
*/ */
@ -162,6 +169,9 @@ public class TmTask implements Serializable {
*/ */
@ApiModelProperty(value = "领料任务详情集合") @ApiModelProperty(value = "领料任务详情集合")
private List<LeaseApplyDetails> leaseApplyDetails; private List<LeaseApplyDetails> leaseApplyDetails;
/** 机具规格详情列表 */
@ApiModelProperty(value = "成套机具规格详情列表")
Map<String, List<LeaseApplyDetails>> ctLeaseApplyDetails;
private List<LeaseOutDetailRecord> leaseOutDetailRecord; private List<LeaseOutDetailRecord> leaseOutDetailRecord;
@ApiModelProperty(value = "协议id") @ApiModelProperty(value = "协议id")
@ -325,4 +335,10 @@ public class TmTask implements Serializable {
@ApiModelProperty(value = "库管员名称") @ApiModelProperty(value = "库管员名称")
private String maTypeUserName; private String maTypeUserName;
@ApiModelProperty(value = "成套机具三级typeId")
private Integer ctParentId;
@ApiModelProperty(value = "是否成套设备")
private Integer isCt;
} }

View File

@ -2,6 +2,7 @@ package com.bonus.sgzb.app.mapper;
import com.bonus.sgzb.app.domain.LeaseApplyDetails; import com.bonus.sgzb.app.domain.LeaseApplyDetails;
import com.bonus.sgzb.app.domain.LeaseApplyInfo; import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.domain.PreNumInUse;
import com.bonus.sgzb.app.domain.TmTask; import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.base.api.domain.BackApplyInfo; import com.bonus.sgzb.base.api.domain.BackApplyInfo;
import com.bonus.sgzb.base.api.domain.MachinePart; import com.bonus.sgzb.base.api.domain.MachinePart;
@ -151,4 +152,8 @@ public interface TmTaskMapper {
List<TmTask> getLeaseOutDetailRecord(TmTask record); List<TmTask> getLeaseOutDetailRecord(TmTask record);
LeaseApplyDetails getApplyNeedDetailsCq(LeaseApplyDetails detail); LeaseApplyDetails getApplyNeedDetailsCq(LeaseApplyDetails detail);
String getCtParentName(LeaseApplyDetails applyDetails);
List<PreNumInUse> getPreNumInUse(PreNumInUse typeId);
} }

View File

@ -2,6 +2,7 @@ package com.bonus.sgzb.app.service;
import com.bonus.sgzb.app.domain.LeaseApplyDetails; import com.bonus.sgzb.app.domain.LeaseApplyDetails;
import com.bonus.sgzb.app.domain.LeaseApplyInfo; import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.domain.PreNumInUse;
import com.bonus.sgzb.app.domain.TmTask; import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
@ -122,4 +123,6 @@ public interface TmTaskService{
* @return * @return
*/ */
AjaxResult getMaTypeKeepList(LeaseApplyDetails leaseApplyDetails); AjaxResult getMaTypeKeepList(LeaseApplyDetails leaseApplyDetails);
List<PreNumInUse> getPreNumInUse(PreNumInUse typeId);
} }

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.bonus.sgzb.app.domain.LeaseApplyDetails; import com.bonus.sgzb.app.domain.LeaseApplyDetails;
import com.bonus.sgzb.app.domain.LeaseApplyInfo; import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.domain.PreNumInUse;
import com.bonus.sgzb.app.domain.TmTask; import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper; import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
import com.bonus.sgzb.app.mapper.LeaseApplyInfoMapper; import com.bonus.sgzb.app.mapper.LeaseApplyInfoMapper;
@ -1368,19 +1369,33 @@ public class TmTaskServiceImpl implements TmTaskService {
if (task.getFlag() == 1) { if (task.getFlag() == 1) {
tmTask.setLeaseApplyInfoList(leaseApplyInfoList); tmTask.setLeaseApplyInfoList(leaseApplyInfoList);
List<LeaseApplyDetails> listLeaseDetails = new ArrayList<>();
for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) { for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
if (leaseApplyInfo != null) { if (leaseApplyInfo != null) {
// 去查询领料任务详情表 // 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetailsByApply(leaseApplyInfo); List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetailsByApply(leaseApplyInfo);
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) { if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails); List<Integer> wholeTypeName = leaseApplyDetails.stream()
listLeaseDetails.addAll(leaseApplyDetails); .map(LeaseApplyDetails::getCtParentId)
.distinct()
.collect(Collectors.toList());
tmTask.setWholeTypeName(wholeTypeName);
Map<String, List<LeaseApplyDetails>> list = leaseApplyDetails.stream()
.filter(detail -> detail.getIsCt() == 0)
.filter(detail -> detail.getCtParentId() != null)
.collect(Collectors.groupingBy(LeaseApplyDetails::getTypeName));
/* for (LeaseApplyDetails applyDetails : list) {
String parentName = tmTaskMapper.getCtParentName(applyDetails);
applyDetails.setp
}*/
List<LeaseApplyDetails> collect = leaseApplyDetails.stream()
.filter(detail -> detail.getIsCt() == 1)
.filter(detail -> detail.getCtParentId() == null)
.collect(Collectors.toList());
tmTask.setCtLeaseApplyDetails(list);
tmTask.setLeaseApplyDetails(collect);
} }
} }
} }
// 塞入领料任务详情的集合中
tmTask.setLeaseApplyDetails(listLeaseDetails);
} }
} }
tmTaskList.add(tmTask); tmTaskList.add(tmTask);
@ -1482,6 +1497,11 @@ public class TmTaskServiceImpl implements TmTaskService {
return AjaxResult.success(detailsArrayList); return AjaxResult.success(detailsArrayList);
} }
@Override
public List<PreNumInUse> getPreNumInUse(PreNumInUse typeId) {
return tmTaskMapper.getPreNumInUse(typeId);
}
/* public static void main(String[] args) { /* public static void main(String[] args) {
String aa = "A101"; String aa = "A101";
System.out.println(aa.charAt(0)); System.out.println(aa.charAt(0));

View File

@ -30,4 +30,6 @@ public class SelectVo {
* 是否替换 默认0,1替换 * 是否替换 默认0,1替换
*/ */
private String isReplace; private String isReplace;
//0不是库存管理 1是库存管理
private String isStorage;
} }

View File

@ -5,4 +5,4 @@ spring:
name: sgzb-material name: sgzb-material
profiles: profiles:
# 环境配置 # 环境配置
active: sgzb_cloud_dev active: sgzb_cloud_local

View File

@ -401,13 +401,13 @@
<!--@mbg.generated--> <!--@mbg.generated-->
insert into lease_apply_details insert into lease_apply_details
(parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by, (parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id) update_time, remark, company_id,ct_parent_id,is_ct)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.parenntId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=INTEGER}, (#{item.parenntId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=INTEGER},
#{item.alNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.alNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
NOW(), #{item.updateBy,jdbcType=VARCHAR}, NOW(), NOW(), #{item.updateBy,jdbcType=VARCHAR}, NOW(),
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}) #{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.ctParentId,jdbcType=INTEGER}, IFNULL(#{item.isCt}, '1'))
</foreach> </foreach>
</insert> </insert>

View File

@ -961,7 +961,7 @@
</select> </select>
<select id="getLeaseApplyDetailsByApply" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails"> <select id="getLeaseApplyDetailsByApply" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
SELECT SELECT
lad.*, mt.type_name AS typeModelName, lad.replace_type_id as replaceTypeId, mt.is_replace as isReplace, mt1.type_id as maTypeId, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType, lad.*, mt.type_name AS typeModelName, lad.replace_type_id as replaceTypeId,mt.is_storage, mt.is_replace as isReplace, mt1.type_id as maTypeId, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName, case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
CASE mt.manage_type CASE mt.manage_type
WHEN 0 THEN WHEN 0 THEN
@ -1089,6 +1089,8 @@
mt.is_storage as isStorage, mt.is_storage as isStorage,
lad.type_name as maName, lad.type_name as maName,
lad.model_name as maModel, lad.model_name as maModel,
lad.ct_parent_id as ctParentId,
lad.is_ct as isCt,
lad.replace_type_id as replaceTypeId, lad.replace_type_id as replaceTypeId,
lad.lease_price as leasePrice lad.lease_price as leasePrice
FROM FROM
@ -1109,7 +1111,7 @@
<if test="typeId != null and typeId != ''"> <if test="typeId != null and typeId != ''">
and lad.type_id = #{typeId} and lad.type_id = #{typeId}
</if> </if>
GROUP BY lad.type_id GROUP BY lad.type_id,lad.is_ct
</select> </select>
<select id="getMaTypeDetails" resultType="com.bonus.sgzb.app.domain.TmTask"> <select id="getMaTypeDetails" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT SELECT
@ -1239,4 +1241,40 @@
GROUP BY lad.type_id GROUP BY lad.type_id
</select> </select>
<select id="getCtParentName" resultType="java.lang.String">
SELECT
mt.type_name
FROM
ma_type mt
WHERE
mt.type_id = #{typeId}
</select>
<select id="getPreNumInUse" resultType="com.bonus.sgzb.app.domain.PreNumInUse">
SELECT
bui.unit_name,
bpl.lot_name proName,
lad.pre_num,
tt.code
FROM
lease_apply_details lad
LEFT JOIN lease_apply_info lai ON lad.parennt_id = lai.id
LEFT JOIN tm_task tt ON tt.task_id = lai.task_id
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
WHERE
lad.type_id = #{typeId}
AND lad.pre_num - IFNULL( lad.al_num, 0 ) > 0
<if test="keyWord != null and keyWord != ''">
and (bui.unit_name like concat('%',#{keyWord},'%') or
bpl.lot_name like concat('%',#{keyWord},'%') or
tt.code like concat('%',#{keyWord},'%'))
</if>
GROUP BY
bui.unit_id,
bpl.pro_id,
tt.code
</select>
</mapper> </mapper>

View File

@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ELSE ELSE
IFNULL(mt.num, 0) IFNULL(mt.num, 0)
END as num, END as num,
mt.is_storage,
mt.is_replace as isReplace mt.is_replace as isReplace
FROM ma_type mt FROM ma_type mt
left join ( left join (

View File

@ -9,4 +9,4 @@ spring:
name: sgzb-system name: sgzb-system
profiles: profiles:
# 环境配置 # 环境配置
active: sgzb_cloud_dev active: sgzb_cloud_local