问题修复
This commit is contained in:
parent
abcb019b70
commit
122630d711
|
|
@ -351,7 +351,10 @@ public class TmTask implements Serializable {
|
|||
private Date outTime;
|
||||
|
||||
@ApiModelProperty(value = "修改前时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date preTime;
|
||||
|
||||
private BigDecimal leaseFee;
|
||||
private int costType;
|
||||
private long days;
|
||||
|
|
@ -362,6 +365,13 @@ public class TmTask implements Serializable {
|
|||
@ApiModelProperty(value = "领料id")
|
||||
private Integer leaseId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Excel(name = "备注", sort = 11)
|
||||
private String remarkLease;
|
||||
|
||||
public void setLeaseFee(BigDecimal leaseFee) {
|
||||
this.leaseFee = leaseFee;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,9 +118,11 @@ public interface LeaseOutDetailsMapper {
|
|||
|
||||
int updateOutTimeDetails(TmTask bean);
|
||||
|
||||
List<TmTask> getSlt(TmTask bean);
|
||||
TmTask getSlt(TmTask bean);
|
||||
|
||||
int updateOutTimeSlt(TmTask bean);
|
||||
|
||||
List<TmTask> getSltFeeList(TmTask bean);
|
||||
|
||||
int checkUpdateRecords(TmTask bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,17 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
public TmTask getLeaseOutOrder(String parentId, String typeId) {
|
||||
TmTask orderHead = leaseApplyDetailsMapper.getOrderHead(parentId);
|
||||
List<LeaseOutDetailRecord> list = leaseApplyDetailsMapper.getOrderBody(parentId, typeId);
|
||||
|
||||
Set<String> processedTypeIds = new HashSet<>();
|
||||
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);
|
||||
if (CollUtil.isNotEmpty(maWholeVoList)) {
|
||||
record.setOutNum(String.valueOf(maWholeVoList.get(0).getSetsNum()));
|
||||
|
|
@ -241,18 +251,31 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
return AjaxResult.error("出库时间修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
List<TmTask> sltList = leaseOutDetailsMapper.getSlt(bean);
|
||||
if(!sltList.isEmpty()){
|
||||
int k = leaseOutDetailsMapper.updateOutTimeSlt(bean);
|
||||
if (k == 0) {
|
||||
return AjaxResult.error("出库时间修改失败");
|
||||
List<TmTask> sltList = new ArrayList<>();
|
||||
for(TmTask tmTask : detailList){
|
||||
TmTask sltDetail = leaseOutDetailsMapper.getSlt(tmTask);
|
||||
if(sltDetail != null){
|
||||
sltList.add(sltDetail);
|
||||
}
|
||||
}
|
||||
if(!sltList.isEmpty()){
|
||||
for(TmTask tmTaskThree : sltList){
|
||||
tmTaskThree.setUpdateTime(bean.getUpdateTime());
|
||||
int k = leaseOutDetailsMapper.updateOutTimeSlt(tmTaskThree);
|
||||
if (k == 0) {
|
||||
return AjaxResult.error("出库时间修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否有退料记录
|
||||
boolean hasBackRecord = sltList.stream().anyMatch(task -> task.getBackId() != null);
|
||||
if (!hasBackRecord) {
|
||||
//冲减帐
|
||||
int l = updateTimeAccount(bean);
|
||||
for(TmTask tmTaskTwo : sltList){
|
||||
tmTaskTwo.setOutTime(bean.getOutTime());
|
||||
tmTaskTwo.setPreTime(bean.getPreTime());
|
||||
//冲减帐
|
||||
int l = updateTimeAccount(tmTaskTwo);
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.success("出库时间修改成功,但该领料单存在已退料情况,无法冲减账单");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class RepairApplyRecord implements Serializable {
|
|||
|
||||
private String partChange;
|
||||
|
||||
private int partChangeNum;
|
||||
private Integer partChangeNum;
|
||||
|
||||
private int parentId;
|
||||
|
||||
|
|
|
|||
|
|
@ -443,6 +443,26 @@ public class RepairServiceImpl implements RepairService {
|
|||
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);
|
||||
}
|
||||
}
|
||||
}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);
|
||||
}
|
||||
}
|
||||
}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);
|
||||
}
|
||||
}
|
||||
}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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@
|
|||
<if test="typeId != null and typeId != ''">
|
||||
and lod.type_id = #{typeId}
|
||||
</if>
|
||||
order by lod.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getCtList" resultType="com.bonus.sgzb.material.domain.MaWholeVo">
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@
|
|||
|
||||
<select id="getDetail" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||
SELECT
|
||||
id AS id
|
||||
id AS id,type_id AS typeId,parent_id AS parentId,ma_id as maId
|
||||
FROM
|
||||
lease_out_details
|
||||
WHERE
|
||||
|
|
@ -548,15 +548,19 @@
|
|||
create_time = #{updateTime}
|
||||
WHERE
|
||||
parent_id = #{id}
|
||||
AND DATE(create_time) = DATE(#{preTime})
|
||||
</update>
|
||||
|
||||
<select id="getSlt" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||
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
|
||||
slt_agreement_info
|
||||
WHERE
|
||||
lease_id = #{id}
|
||||
lease_id = #{parentId} and type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
AND ma_id = #{maId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="updateOutTimeSlt">
|
||||
|
|
@ -565,7 +569,13 @@
|
|||
SET
|
||||
start_time = #{updateTime}
|
||||
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>
|
||||
|
||||
<select id="getSltFeeList" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||
|
|
@ -578,9 +588,18 @@
|
|||
FROM
|
||||
slt_agreement_info
|
||||
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>
|
||||
</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>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1037,6 +1037,7 @@
|
|||
bui.unit_name AS unitName,
|
||||
lai.lease_person AS leasePerson,
|
||||
lai.phone AS leasePhone,
|
||||
lai.remark AS remarkLease,
|
||||
tt.create_by AS applyFor,
|
||||
d.`name` AS taskName,
|
||||
lai.lease_type AS leaseType,
|
||||
|
|
@ -1278,7 +1279,7 @@
|
|||
<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')
|
||||
</if>
|
||||
group by lod.type_id
|
||||
-- group by lod.type_id
|
||||
</select>
|
||||
|
||||
<select id="getApplyNeedDetailsCq" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
|
|
@ -1339,6 +1340,7 @@
|
|||
bui.unit_name AS unitName,
|
||||
lai.lease_person AS leasePerson,
|
||||
lai.phone AS leasePhone,
|
||||
lai.remark AS remarkLease,
|
||||
tt.create_by AS applyFor,
|
||||
d.`name` AS taskName,
|
||||
lai.lease_type AS leaseType,
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and rar.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
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 != ''">-->
|
||||
<!-- and tk.create_time between #{params.beginTime} and #{params.endTime}-->
|
||||
<!-- </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)
|
||||
-- 当 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 NULL and rap.part_id IS NULL) THEN CONCAT( rap.repair_content)
|
||||
ELSE NULL
|
||||
END
|
||||
SEPARATOR '; '
|
||||
|
|
|
|||
Loading…
Reference in New Issue