代码提交
This commit is contained in:
parent
cf63ffa3a5
commit
9f93af7b13
|
|
@ -209,6 +209,8 @@ public class LeaseApplyDetails implements Serializable {
|
||||||
private Integer ctParentId;
|
private Integer ctParentId;
|
||||||
@ApiModelProperty(value="是否是成套机具(0是 1否)")
|
@ApiModelProperty(value="是否是成套机具(0是 1否)")
|
||||||
private Integer isCt;
|
private Integer isCt;
|
||||||
|
@ApiModelProperty(value="套数")
|
||||||
|
private Integer setsNum;
|
||||||
@ApiModelProperty(value="默认1,0不是库存管理")
|
@ApiModelProperty(value="默认1,0不是库存管理")
|
||||||
private String isStorage;
|
private String isStorage;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ public class TmTask implements Serializable {
|
||||||
private Integer taskType;
|
private Integer taskType;
|
||||||
private List<TmTask> outboundType;
|
private List<TmTask> outboundType;
|
||||||
private List<Integer> wholeTypeName;
|
private List<Integer> wholeTypeName;
|
||||||
|
private String wholeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务状态(定义数据字典)
|
* 任务状态(定义数据字典)
|
||||||
|
|
@ -170,8 +171,7 @@ public class TmTask implements Serializable {
|
||||||
@ApiModelProperty(value = "领料任务详情集合")
|
@ApiModelProperty(value = "领料任务详情集合")
|
||||||
private List<LeaseApplyDetails> leaseApplyDetails;
|
private List<LeaseApplyDetails> leaseApplyDetails;
|
||||||
/** 机具规格详情列表 */
|
/** 机具规格详情列表 */
|
||||||
@ApiModelProperty(value = "成套机具规格详情列表")
|
private Map<String, List<LeaseApplyDetails>> ctLeaseApplyDetails;
|
||||||
Map<String, List<LeaseApplyDetails>> ctLeaseApplyDetails;
|
|
||||||
private List<LeaseOutDetailRecord> leaseOutDetailRecord;
|
private List<LeaseOutDetailRecord> leaseOutDetailRecord;
|
||||||
|
|
||||||
@ApiModelProperty(value = "协议id")
|
@ApiModelProperty(value = "协议id")
|
||||||
|
|
@ -337,8 +337,12 @@ public class TmTask implements Serializable {
|
||||||
private String maTypeUserName;
|
private String maTypeUserName;
|
||||||
@ApiModelProperty(value = "成套机具三级typeId")
|
@ApiModelProperty(value = "成套机具三级typeId")
|
||||||
private Integer ctParentId;
|
private Integer ctParentId;
|
||||||
@ApiModelProperty(value = "是否成套设备")
|
@ApiModelProperty(value = "是否成套设备(0是 1不是)")
|
||||||
private Integer isCt;
|
private Integer isCt;
|
||||||
|
@ApiModelProperty(value = "套数")
|
||||||
|
private Integer setsNum;
|
||||||
|
@ApiModelProperty(value = "是否是主体设备")
|
||||||
|
private boolean isMain;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,4 +158,8 @@ public interface TmTaskMapper {
|
||||||
List<PreNumInUse> getPreNumInUse(PreNumInUse typeId);
|
List<PreNumInUse> getPreNumInUse(PreNumInUse typeId);
|
||||||
|
|
||||||
List<TmTask> getLeaseOutList(TmTask task);
|
List<TmTask> getLeaseOutList(TmTask task);
|
||||||
|
|
||||||
|
String getParentNameById(Integer ctParentId);
|
||||||
|
|
||||||
|
String getAscriptionTypeByTypeId(TmTask tmTask);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
@ -258,6 +259,18 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
@Override
|
@Override
|
||||||
public List<TmTask> getLeaseAuditListByOne(TmTask record) {
|
public List<TmTask> getLeaseAuditListByOne(TmTask record) {
|
||||||
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
|
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
|
||||||
|
// 查询成套设备中哪个是主设备
|
||||||
|
for (TmTask tmTask : leaseDetailByParentId) {
|
||||||
|
if (tmTask.getIsCt() == 0) {
|
||||||
|
String wholeTypeName = tmTaskMapper.getAscriptionTypeByTypeId(tmTask);
|
||||||
|
if (StringUtils.isNotBlank(wholeTypeName)) {
|
||||||
|
tmTask.setWholeName(wholeTypeName);
|
||||||
|
tmTask.setMain(true);
|
||||||
|
} else {
|
||||||
|
tmTask.setMain(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/* for (TmTask tmTask : leaseDetailByParentId) {
|
/* for (TmTask tmTask : leaseDetailByParentId) {
|
||||||
if ("2".equals(tmTask.getManageType())) {
|
if ("2".equals(tmTask.getManageType())) {
|
||||||
List<TmTask> manageTypeByTypeId = tmTaskMapper.getManageTypeByTypeId(tmTask);
|
List<TmTask> manageTypeByTypeId = tmTaskMapper.getManageTypeByTypeId(tmTask);
|
||||||
|
|
@ -578,8 +591,27 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Map<Integer, List<LeaseApplyDetails>> map = listLeaseDetails.stream()
|
||||||
|
.filter(detail -> detail.getIsCt() == 0)
|
||||||
|
.filter(detail -> detail.getCtParentId() != null)
|
||||||
|
.collect(Collectors.groupingBy(LeaseApplyDetails::getCtParentId));
|
||||||
|
Map<String, List<LeaseApplyDetails>> transformedMap = map.entrySet().stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
entry -> {
|
||||||
|
Integer ctParentId = entry.getKey();
|
||||||
|
String typeName = getParentNameById(ctParentId);
|
||||||
|
return typeName;
|
||||||
|
},
|
||||||
|
Map.Entry::getValue // 获取分组后的LeaseApplyDetails列表
|
||||||
|
));
|
||||||
|
List<LeaseApplyDetails> collect = listLeaseDetails.stream()
|
||||||
|
.filter(detail -> detail.getIsCt() == 1)
|
||||||
|
.filter(detail -> detail.getCtParentId() == null)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
tmTask.setCtLeaseApplyDetails(transformedMap);
|
||||||
|
tmTask.setLeaseApplyDetails(collect);
|
||||||
// 塞入领料任务详情的集合中
|
// 塞入领料任务详情的集合中
|
||||||
tmTask.setLeaseApplyDetails(listLeaseDetails);
|
// tmTask.setLeaseApplyDetails(listLeaseDetails);
|
||||||
}
|
}
|
||||||
tmTaskList.add(tmTask);
|
tmTaskList.add(tmTask);
|
||||||
return tmTaskList;
|
return tmTaskList;
|
||||||
|
|
@ -1388,19 +1420,24 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
tmTask.setWholeTypeName(wholeTypeName);
|
tmTask.setWholeTypeName(wholeTypeName);
|
||||||
Map<String, List<LeaseApplyDetails>> list = leaseApplyDetails.stream()
|
Map<Integer, List<LeaseApplyDetails>> map = leaseApplyDetails.stream()
|
||||||
.filter(detail -> detail.getIsCt() == 0)
|
.filter(detail -> detail.getIsCt() == 0)
|
||||||
.filter(detail -> detail.getCtParentId() != null)
|
.filter(detail -> detail.getCtParentId() != null)
|
||||||
.collect(Collectors.groupingBy(LeaseApplyDetails::getTypeName));
|
.collect(Collectors.groupingBy(LeaseApplyDetails::getCtParentId));
|
||||||
/* for (LeaseApplyDetails applyDetails : list) {
|
Map<String, List<LeaseApplyDetails>> transformedMap = map.entrySet().stream()
|
||||||
String parentName = tmTaskMapper.getCtParentName(applyDetails);
|
.collect(Collectors.toMap(
|
||||||
applyDetails.setp
|
entry -> {
|
||||||
}*/
|
Integer ctParentId = entry.getKey();
|
||||||
|
String typeName = getParentNameById(ctParentId);
|
||||||
|
return typeName;
|
||||||
|
},
|
||||||
|
Map.Entry::getValue // 获取分组后的LeaseApplyDetails列表
|
||||||
|
));
|
||||||
List<LeaseApplyDetails> collect = leaseApplyDetails.stream()
|
List<LeaseApplyDetails> collect = leaseApplyDetails.stream()
|
||||||
.filter(detail -> detail.getIsCt() == 1)
|
.filter(detail -> detail.getIsCt() == 1)
|
||||||
.filter(detail -> detail.getCtParentId() == null)
|
.filter(detail -> detail.getCtParentId() == null)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
tmTask.setCtLeaseApplyDetails(list);
|
tmTask.setCtLeaseApplyDetails(transformedMap);
|
||||||
tmTask.setLeaseApplyDetails(collect);
|
tmTask.setLeaseApplyDetails(collect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1411,6 +1448,11 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
return tmTaskList;
|
return tmTaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getParentNameById(Integer ctParentId) {
|
||||||
|
String parentName = tmTaskMapper.getParentNameById(ctParentId);
|
||||||
|
return parentName;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateLeaseInfo(LeaseApplyInfo task) {
|
public void updateLeaseInfo(LeaseApplyInfo task) {
|
||||||
tmTaskMapper.updateLeaseInfo(task);
|
tmTaskMapper.updateLeaseInfo(task);
|
||||||
|
|
@ -1467,6 +1509,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询库管员下拉信息
|
* 查询库管员下拉信息
|
||||||
|
*
|
||||||
* @param leaseApplyDetails
|
* @param leaseApplyDetails
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ public class TreeNode {
|
||||||
private float num;
|
private float num;
|
||||||
|
|
||||||
private String modelCode;
|
private String modelCode;
|
||||||
|
private String isStorage;
|
||||||
|
|
||||||
private String manageType;
|
private String manageType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,11 @@
|
||||||
insert into lease_apply_details (parennt_id, type_id, pre_num,
|
insert into lease_apply_details (parennt_id, type_id, pre_num,
|
||||||
al_num, `status`, create_by,
|
al_num, `status`, create_by,
|
||||||
create_time, update_by, update_time,
|
create_time, update_by, update_time,
|
||||||
remark, company_id,type_name,model_name,lease_price,replace_type_id)
|
remark, company_id,type_name,model_name,lease_price,replace_type_id,ct_parent_id,is_ct,sets_num)
|
||||||
values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT},
|
values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT},
|
||||||
#{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
|
#{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
|
||||||
NOW(), #{updateBy,jdbcType=VARCHAR}, NOW(),
|
NOW(), #{updateBy,jdbcType=VARCHAR}, NOW(),
|
||||||
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},#{typeName},#{maModel},#{leasePrice},#{replaceTypeId})
|
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},#{typeName},#{maModel},#{leasePrice},#{replaceTypeId},#{ctParentId},#{isCt},#{setsNum})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.app.domain.LeaseApplyDetails" useGeneratedKeys="true">
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.app.domain.LeaseApplyDetails" useGeneratedKeys="true">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
|
|
@ -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,ct_parent_id,is_ct)
|
update_time, remark, company_id,ct_parent_id,is_ct,sets_num)
|
||||||
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.ctParentId,jdbcType=INTEGER}, IFNULL(#{item.isCt}, '1'))
|
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.ctParentId,jdbcType=INTEGER}, IFNULL(#{item.isCt}, '1'),#{item.setsNum,jdbcType=INTEGER})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1092,6 +1092,7 @@
|
||||||
lad.ct_parent_id as ctParentId,
|
lad.ct_parent_id as ctParentId,
|
||||||
lad.is_ct as isCt,
|
lad.is_ct as isCt,
|
||||||
lad.replace_type_id as replaceTypeId,
|
lad.replace_type_id as replaceTypeId,
|
||||||
|
lad.sets_num as setsNum,
|
||||||
lad.lease_price as leasePrice
|
lad.lease_price as leasePrice
|
||||||
FROM
|
FROM
|
||||||
lease_apply_details lad
|
lease_apply_details lad
|
||||||
|
|
@ -1327,4 +1328,10 @@
|
||||||
GROUP BY lai.id
|
GROUP BY lai.id
|
||||||
ORDER BY tt.task_status,tt.create_time desc
|
ORDER BY tt.task_status,tt.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getParentNameById" resultType="java.lang.String">
|
||||||
|
select whole_type_name from ma_whole_set where parent_id = #{ctParentId} limit 1
|
||||||
|
</select>
|
||||||
|
<select id="getAscriptionTypeByTypeId" resultType="java.lang.String">
|
||||||
|
select whole_type_name from ma_whole_set where parent_id = #{typeId} and ascription_type = 1 limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
END as num,
|
END as num,
|
||||||
mt.model_code AS modelCode,
|
mt.model_code AS modelCode,
|
||||||
mt.manage_type AS manageType,
|
mt.manage_type AS manageType,
|
||||||
mt.is_replace as isReplace
|
mt.is_replace as isReplace,
|
||||||
|
mt.is_storage as isStorage
|
||||||
FROM ma_type mt
|
FROM ma_type mt
|
||||||
left join (SELECT mt.type_id,
|
left join (SELECT mt.type_id,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue