机具绑定成套后无法领料修改
This commit is contained in:
parent
c1f82de915
commit
5823ed3eaf
|
|
@ -57,5 +57,8 @@ public class MaWhole {
|
|||
/** 创建人 */
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Integer createBy;
|
||||
/** 是否是成套设备(1:是 ) */
|
||||
@ApiModelProperty(value = "是否是成套设备(1:是 )")
|
||||
private Integer isWholeSet;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public interface MaWholeSetMapper {
|
|||
* @return
|
||||
*/
|
||||
List<Integer> selectTypeId(@Param("id") Integer id);
|
||||
List<MaWhole> selectAllTypeId();
|
||||
|
||||
/**
|
||||
* 先根据id去查询物质类型树
|
||||
|
|
@ -79,4 +80,8 @@ public interface MaWholeSetMapper {
|
|||
int selectByWholeTypeName(MaWholeSetDto wholeTypeName);
|
||||
|
||||
List<LeaseApplyDetails> selectListByWholeTypeName(MaWholeSetDto wholeTypeName);
|
||||
|
||||
void updateMaType(MaWhole maWhole);
|
||||
|
||||
void updateMaType1();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 整套抱杆操作实现层
|
||||
*
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/15 17:17
|
||||
*/
|
||||
|
|
@ -30,6 +31,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 新增整套抱杆管理
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -57,6 +59,10 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
int res = 0;
|
||||
try {
|
||||
res = insertMaWholeSet(dto.getDeviceInfo());
|
||||
// 将机具类型标记为成套设备(无法领料)
|
||||
//先查出所有的typeId
|
||||
List<MaWhole> typeIdList = mapper.selectAllTypeId();
|
||||
updateMaType(typeIdList);
|
||||
if (res == 0) {
|
||||
log.error("insertMaWholeSet方法插入异常");
|
||||
throw new RuntimeException("insertMaWholeSet方法插入异常");
|
||||
|
|
@ -71,6 +77,14 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
}
|
||||
}
|
||||
|
||||
private void updateMaType(List<MaWhole> deviceInfo) {
|
||||
// 先全部置为null
|
||||
mapper.updateMaType1();
|
||||
for (MaWhole maWhole : deviceInfo) {
|
||||
mapper.updateMaType(maWhole);
|
||||
}
|
||||
}
|
||||
|
||||
private int selectByWholeTypeName(MaWholeSetDto wholeTypeName) {
|
||||
return mapper.selectByWholeTypeName(wholeTypeName);
|
||||
}
|
||||
|
|
@ -88,6 +102,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 查询整套抱杆明细
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -98,6 +113,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 根据id删除
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -110,6 +126,10 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
int res = 0;
|
||||
try {
|
||||
res = deleteMaWhole(dto);
|
||||
// 将机具类型标记为成套设备(无法领料)
|
||||
//先查出所有的typeId
|
||||
List<MaWhole> typeIdList = mapper.selectAllTypeId();
|
||||
updateMaType(typeIdList);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("删除失败");
|
||||
}
|
||||
|
|
@ -122,6 +142,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 根据id删除整套配件信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -131,6 +152,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 修改整套抱杆管理
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -150,6 +172,10 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
try {
|
||||
deleteMaWhole(dto);
|
||||
res = insertMaWholeSet(dto.getDeviceInfo());
|
||||
// 将机具类型标记为成套设备(无法领料)
|
||||
//先查出所有的typeId
|
||||
List<MaWhole> typeIdList = mapper.selectAllTypeId();
|
||||
updateMaType(typeIdList);
|
||||
if (res == 0) {
|
||||
log.error("insertMaWholeSet方法插入异常");
|
||||
throw new RuntimeException("insertMaWholeSet方法插入异常");
|
||||
|
|
@ -169,6 +195,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 修改时查询整套抱杆明细
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -205,6 +232,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
|
||||
/**
|
||||
* 根据parentId查询,去重
|
||||
*
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -45,6 +45,15 @@
|
|||
values(#{item.typeId},#{item.parentId},#{item.totalNum},#{item.wholeTypeName},#{item.createBy},#{item.ascriptionType}, now(),1)
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updateMaType">
|
||||
update ma_type
|
||||
set is_whole_set = 1
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateMaType1">
|
||||
update ma_type
|
||||
set is_whole_set = null
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from ma_whole_set
|
||||
where parent_id = #{id}
|
||||
|
|
@ -180,11 +189,12 @@
|
|||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_whole_set mws2 ON mws2.type_id = mt.type_id
|
||||
AND mws2.whole_type_name = #{wholeTypeName}
|
||||
AND mws2.company_id = #{companyId}
|
||||
WHERE
|
||||
mt.type_id IN ( SELECT mws.type_id FROM ma_whole_set mws WHERE mws.whole_type_name = #{wholeTypeName})
|
||||
AND mt.`status` = '0'
|
||||
AND mt.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectAllTypeId" resultType="com.bonus.sgzb.material.domain.MaWhole">
|
||||
select type_id from ma_whole_set
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
WHERE mm.ma_code is not null and mm.ma_status in (15)
|
||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||
WHERE mt.del_flag = '0'
|
||||
WHERE mt.del_flag = '0' and mt.is_whole_set IS NULL
|
||||
<if test="level!=null and level!=''">
|
||||
<if test="level == 2">
|
||||
AND mt.level IN ('1','2')
|
||||
|
|
|
|||
Loading…
Reference in New Issue