问题修复

This commit is contained in:
hongchao 2025-08-01 09:08:36 +08:00
parent abcb019b70
commit 122630d711
9 changed files with 156 additions and 18 deletions

View File

@ -351,7 +351,10 @@ public class TmTask implements Serializable {
private Date outTime; private Date outTime;
@ApiModelProperty(value = "修改前时间") @ApiModelProperty(value = "修改前时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date preTime; private Date preTime;
private BigDecimal leaseFee; private BigDecimal leaseFee;
private int costType; private int costType;
private long days; private long days;
@ -362,6 +365,13 @@ public class TmTask implements Serializable {
@ApiModelProperty(value = "领料id") @ApiModelProperty(value = "领料id")
private Integer leaseId; private Integer leaseId;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
@Excel(name = "备注", sort = 11)
private String remarkLease;
public void setLeaseFee(BigDecimal leaseFee) { public void setLeaseFee(BigDecimal leaseFee) {
this.leaseFee = leaseFee; this.leaseFee = leaseFee;
} }

View File

@ -118,9 +118,11 @@ public interface LeaseOutDetailsMapper {
int updateOutTimeDetails(TmTask bean); int updateOutTimeDetails(TmTask bean);
List<TmTask> getSlt(TmTask bean); TmTask getSlt(TmTask bean);
int updateOutTimeSlt(TmTask bean); int updateOutTimeSlt(TmTask bean);
List<TmTask> getSltFeeList(TmTask bean); List<TmTask> getSltFeeList(TmTask bean);
int checkUpdateRecords(TmTask bean);
} }

View File

@ -205,7 +205,17 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
public TmTask getLeaseOutOrder(String parentId, String typeId) { public TmTask getLeaseOutOrder(String parentId, String typeId) {
TmTask orderHead = leaseApplyDetailsMapper.getOrderHead(parentId); TmTask orderHead = leaseApplyDetailsMapper.getOrderHead(parentId);
List<LeaseOutDetailRecord> list = leaseApplyDetailsMapper.getOrderBody(parentId, typeId); List<LeaseOutDetailRecord> list = leaseApplyDetailsMapper.getOrderBody(parentId, typeId);
Set<String> processedTypeIds = new HashSet<>();
for (LeaseOutDetailRecord record : list) { for (LeaseOutDetailRecord record : list) {
String typeIdTemp = String.valueOf(record.getTypeId());
if (processedTypeIds.contains(typeIdTemp)) {
// 如果 typeId 已处理过 remark 置为 null
record.setRemark(null);
} else {
// 首次遇到该 typeId标记为已处理
processedTypeIds.add(typeIdTemp);
}
List<MaWholeVo> maWholeVoList = leaseApplyDetailsMapper.getCtList(record); List<MaWholeVo> maWholeVoList = leaseApplyDetailsMapper.getCtList(record);
if (CollUtil.isNotEmpty(maWholeVoList)) { if (CollUtil.isNotEmpty(maWholeVoList)) {
record.setOutNum(String.valueOf(maWholeVoList.get(0).getSetsNum())); record.setOutNum(String.valueOf(maWholeVoList.get(0).getSetsNum()));
@ -241,18 +251,31 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
return AjaxResult.error("出库时间修改失败"); return AjaxResult.error("出库时间修改失败");
} }
} }
List<TmTask> sltList = new ArrayList<>();
List<TmTask> sltList = leaseOutDetailsMapper.getSlt(bean); for(TmTask tmTask : detailList){
TmTask sltDetail = leaseOutDetailsMapper.getSlt(tmTask);
if(sltDetail != null){
sltList.add(sltDetail);
}
}
if(!sltList.isEmpty()){ if(!sltList.isEmpty()){
int k = leaseOutDetailsMapper.updateOutTimeSlt(bean); for(TmTask tmTaskThree : sltList){
tmTaskThree.setUpdateTime(bean.getUpdateTime());
int k = leaseOutDetailsMapper.updateOutTimeSlt(tmTaskThree);
if (k == 0) { if (k == 0) {
return AjaxResult.error("出库时间修改失败"); return AjaxResult.error("出库时间修改失败");
} }
}
// 检查是否有退料记录 // 检查是否有退料记录
boolean hasBackRecord = sltList.stream().anyMatch(task -> task.getBackId() != null); boolean hasBackRecord = sltList.stream().anyMatch(task -> task.getBackId() != null);
if (!hasBackRecord) { if (!hasBackRecord) {
for(TmTask tmTaskTwo : sltList){
tmTaskTwo.setOutTime(bean.getOutTime());
tmTaskTwo.setPreTime(bean.getPreTime());
//冲减帐 //冲减帐
int l = updateTimeAccount(bean); int l = updateTimeAccount(tmTaskTwo);
}
}else{ }else{
return AjaxResult.success("出库时间修改成功,但该领料单存在已退料情况,无法冲减账单"); return AjaxResult.success("出库时间修改成功,但该领料单存在已退料情况,无法冲减账单");
} }

View File

@ -135,7 +135,7 @@ public class RepairApplyRecord implements Serializable {
private String partChange; private String partChange;
private int partChangeNum; private Integer partChangeNum;
private int parentId; private int parentId;

View File

@ -443,6 +443,26 @@ public class RepairServiceImpl implements RepairService {
backReceiveMapper.insertBmFileInfo(fileInfo); backReceiveMapper.insertBmFileInfo(fileInfo);
} }
} }
}else{
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setCreateBy(loginUser.getUserid());
partDetails.setRepairer(bean.getRepairer());
partDetails.setCompanyId(bean.getCompanyId());
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
beanTempTwo.setTypeId(bean.getTypeId());
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
beanTempTwo.setPartId(null);
beanTempTwo.setPartPrice(null);
beanTempTwo.setPartNum(null);
beanTempTwo.setRepairContent(partDetails.getRepairContent());
beanTempTwo.setPartType(null);
beanTempTwo.setRepairRemark(partDetails.getRepairRemark());
beanTempTwo.setPartChange(null);
beanTempTwo.setPartChangeNum(null);
beanTempTwo.setCreateBy(loginUser.getUserid());
mapper.addPartNew(beanTempTwo);
} }
} }
@ -718,6 +738,26 @@ public class RepairServiceImpl implements RepairService {
backReceiveMapper.insertBmFileInfo(fileInfo); backReceiveMapper.insertBmFileInfo(fileInfo);
} }
} }
}else{
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setCreateBy(loginUser.getUserid());
partDetails.setRepairer(bean.getRepairer());
partDetails.setCompanyId(bean.getCompanyId());
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
beanTempTwo.setTypeId(bean.getTypeId());
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
beanTempTwo.setPartId(null);
beanTempTwo.setPartPrice(null);
beanTempTwo.setPartNum(null);
beanTempTwo.setRepairContent(partDetails.getRepairContent());
beanTempTwo.setPartType(null);
beanTempTwo.setRepairRemark(partDetails.getRepairRemark());
beanTempTwo.setPartChange(null);
beanTempTwo.setPartChangeNum(null);
beanTempTwo.setCreateBy(loginUser.getUserid());
mapper.addPartNew(beanTempTwo);
} }
} }
@ -1025,6 +1065,26 @@ public class RepairServiceImpl implements RepairService {
backReceiveMapper.insertBmFileInfo(fileInfo); backReceiveMapper.insertBmFileInfo(fileInfo);
} }
} }
}else{
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setCreateBy(loginUser.getUserid());
partDetails.setRepairer(bean.getRepairer());
partDetails.setCompanyId(bean.getCompanyId());
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
beanTempTwo.setTypeId(bean.getTypeId());
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
beanTempTwo.setPartId(null);
beanTempTwo.setPartPrice(null);
beanTempTwo.setPartNum(null);
beanTempTwo.setRepairContent(partDetails.getRepairContent());
beanTempTwo.setPartType(null);
beanTempTwo.setRepairRemark(partDetails.getRepairRemark());
beanTempTwo.setPartChange(null);
beanTempTwo.setPartChangeNum(null);
beanTempTwo.setCreateBy(loginUser.getUserid());
mapper.addPartSaveNew(beanTempTwo);
} }
} }
@ -1247,6 +1307,26 @@ public class RepairServiceImpl implements RepairService {
backReceiveMapper.insertBmFileInfo(fileInfo); backReceiveMapper.insertBmFileInfo(fileInfo);
} }
} }
}else{
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setCreateBy(loginUser.getUserid());
partDetails.setRepairer(bean.getRepairer());
partDetails.setCompanyId(bean.getCompanyId());
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
beanTempTwo.setTypeId(bean.getTypeId());
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
beanTempTwo.setPartId(null);
beanTempTwo.setPartPrice(null);
beanTempTwo.setPartNum(null);
beanTempTwo.setRepairContent(partDetails.getRepairContent());
beanTempTwo.setPartType(null);
beanTempTwo.setRepairRemark(partDetails.getRepairRemark());
beanTempTwo.setPartChange(null);
beanTempTwo.setPartChangeNum(null);
beanTempTwo.setCreateBy(loginUser.getUserid());
mapper.addPartSaveNew(beanTempTwo);
} }
} }

View File

@ -110,6 +110,7 @@
<if test="typeId != null and typeId != ''"> <if test="typeId != null and typeId != ''">
and lod.type_id = #{typeId} and lod.type_id = #{typeId}
</if> </if>
order by lod.create_time desc
</select> </select>
<select id="getCtList" resultType="com.bonus.sgzb.material.domain.MaWholeVo"> <select id="getCtList" resultType="com.bonus.sgzb.material.domain.MaWholeVo">

View File

@ -534,7 +534,7 @@
<select id="getDetail" resultType="com.bonus.sgzb.app.domain.TmTask"> <select id="getDetail" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT SELECT
id AS id id AS id,type_id AS typeId,parent_id AS parentId,ma_id as maId
FROM FROM
lease_out_details lease_out_details
WHERE WHERE
@ -548,15 +548,19 @@
create_time = #{updateTime} create_time = #{updateTime}
WHERE WHERE
parent_id = #{id} parent_id = #{id}
AND DATE(create_time) = DATE(#{preTime})
</update> </update>
<select id="getSlt" resultType="com.bonus.sgzb.app.domain.TmTask"> <select id="getSlt" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT SELECT
id AS id,back_id AS backId id AS id,back_id AS backId,type_id AS typeId,ma_id AS maId,lease_id AS leaseId
FROM FROM
slt_agreement_info slt_agreement_info
WHERE WHERE
lease_id = #{id} lease_id = #{parentId} and type_id = #{typeId}
<if test="maId != null">
AND ma_id = #{maId}
</if>
</select> </select>
<update id="updateOutTimeSlt"> <update id="updateOutTimeSlt">
@ -565,7 +569,13 @@
SET SET
start_time = #{updateTime} start_time = #{updateTime}
WHERE WHERE
lease_id = #{id} lease_id = #{leaseId}
<if test="typeId != null and typeId != ''">
AND type_id = #{typeId}
</if>
<if test="maId != null">
AND ma_id = #{maId}
</if>
</update> </update>
<select id="getSltFeeList" resultType="com.bonus.sgzb.app.domain.TmTask"> <select id="getSltFeeList" resultType="com.bonus.sgzb.app.domain.TmTask">
@ -578,9 +588,18 @@
FROM FROM
slt_agreement_info slt_agreement_info
WHERE WHERE
lease_id = #{id} lease_id = #{leaseId}
<if test="typeId != null and typeId != ''"> <if test="typeId != null and typeId != ''">
AND type_id = #{typeId} AND type_id = #{typeId}
</if> </if>
<if test="maId != null">
AND ma_id = #{maId}
</if>
</select>
<select id="checkUpdateRecords" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM lease_out_details
WHERE parent_id = #{id}
AND DATE(create_time) = DATE(#{preTime})
</select> </select>
</mapper> </mapper>

View File

@ -1037,6 +1037,7 @@
bui.unit_name AS unitName, bui.unit_name AS unitName,
lai.lease_person AS leasePerson, lai.lease_person AS leasePerson,
lai.phone AS leasePhone, lai.phone AS leasePhone,
lai.remark AS remarkLease,
tt.create_by AS applyFor, tt.create_by AS applyFor,
d.`name` AS taskName, d.`name` AS taskName,
lai.lease_type AS leaseType, lai.lease_type AS leaseType,
@ -1278,7 +1279,7 @@
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
group by lod.type_id -- group by lod.type_id
</select> </select>
<select id="getApplyNeedDetailsCq" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails"> <select id="getApplyNeedDetailsCq" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
@ -1339,6 +1340,7 @@
bui.unit_name AS unitName, bui.unit_name AS unitName,
lai.lease_person AS leasePerson, lai.lease_person AS leasePerson,
lai.phone AS leasePhone, lai.phone AS leasePhone,
lai.remark AS remarkLease,
tt.create_by AS applyFor, tt.create_by AS applyFor,
d.`name` AS taskName, d.`name` AS taskName,
lai.lease_type AS leaseType, lai.lease_type AS leaseType,

View File

@ -415,7 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and rar.create_time between #{params.beginTime} and #{params.endTime} and rar.create_time between #{params.beginTime} and #{params.endTime}
</if> </if>
group by rad.parent_id,rad.create_time,rad.type_id,su1.nick_name,rad.status,rad.audit_remark,mm.ma_code group by rad.parent_id,rad.create_time,rad.type_id,su1.nick_name,rad.status,rad.audit_remark,mm.ma_code
order by rar.create_time desc order by rad.create_time desc
<!-- <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">--> <!-- <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">-->
<!-- and tk.create_time between #{params.beginTime} and #{params.endTime}--> <!-- and tk.create_time between #{params.beginTime} and #{params.endTime}-->
<!-- </if>--> <!-- </if>-->
@ -640,7 +640,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN rap.part_id IS NOT NULL THEN CONCAT(mpt.pa_name, '','数量为',rap.part_num,' ', rap.repair_content) WHEN rap.part_id IS NOT NULL THEN CONCAT(mpt.pa_name, '','数量为',rap.part_num,' ', rap.repair_content)
-- 当 part_id 不存在但 part_name 存在时,直接使用 part_name -- 当 part_id 不存在但 part_name 存在时,直接使用 part_name
WHEN rap.part_name IS NOT NULL THEN CONCAT(rap.part_name, '','数量为',rap.part_num,' ', rap.repair_content) WHEN rap.part_name IS NOT NULL THEN CONCAT(rap.part_name, '','数量为',rap.part_num,' ', rap.repair_content)
-- 两者都不存在时,不显示该记录 -- 当不选择配件时
WHEN (rap.part_name IS NULL and rap.part_id IS NULL) THEN CONCAT( rap.repair_content)
ELSE NULL ELSE NULL
END END
SEPARATOR '; ' SEPARATOR '; '