领料出库成套设备支持增减
This commit is contained in:
parent
bd20d10538
commit
07572859f7
|
|
@ -88,6 +88,31 @@ public class MaWholeSetController extends BaseController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询附件整套抱杆明细
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询附件整套抱杆明细")
|
||||
@GetMapping("/selectListByIdTwo")
|
||||
public AjaxResult selectListByIdTwo(@ApiParam(value = "查询信息") MaWholeSetDto dto) {
|
||||
List<MaWholeVo> list = maWholeSetService.selectListByIdTwo(dto);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看附件修改预领数量
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查看附件修改预领数量")
|
||||
@PostMapping("/updatePreNum")
|
||||
public AjaxResult updatePreNum(@ApiParam(value = "查看附件修改预领数量") @RequestBody List<MaWholeVo> list) {
|
||||
return maWholeSetService.updatePreNum(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改时查询整套抱杆明细
|
||||
*
|
||||
|
|
|
|||
|
|
@ -79,4 +79,11 @@ public class MaWholeVo {
|
|||
*/
|
||||
@ApiModelProperty(value = "第二级id")
|
||||
private Integer towId;
|
||||
|
||||
/**
|
||||
* 预领数量
|
||||
*/
|
||||
@ApiModelProperty(value = "预领数量")
|
||||
private Integer applyNum;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,21 @@ public interface MaWholeSetMapper {
|
|||
*/
|
||||
List<MaWholeVo> selectListById(MaWholeSetDto dto);
|
||||
|
||||
/**
|
||||
* 查询附件整套抱杆明细
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<MaWholeVo> selectListByIdTwo(MaWholeSetDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 查看附件修改预领数量
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
int updatePreNum(MaWholeVo dto);
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
* @param
|
||||
|
|
|
|||
|
|
@ -34,6 +34,20 @@ public interface MaWholeSetService {
|
|||
*/
|
||||
List<MaWholeVo> selectListById(MaWholeSetDto dto);
|
||||
|
||||
/**
|
||||
* 查询附件整套抱杆明细
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<MaWholeVo> selectListByIdTwo(MaWholeSetDto dto);
|
||||
|
||||
/**
|
||||
* 查看附件修改预领数量
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updatePreNum(List<MaWholeVo> list);
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -111,6 +111,45 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
|||
return mapper.selectListById(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询附件整套抱杆明细
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaWholeVo> selectListByIdTwo(MaWholeSetDto dto) {
|
||||
return mapper.selectListByIdTwo(dto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看附件修改预领数量
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult updatePreNum(List<MaWholeVo> list) {
|
||||
if (list == null) {
|
||||
return AjaxResult.error("附件内容为空,无法进行修改");
|
||||
}
|
||||
int res = 0;
|
||||
try {
|
||||
for (MaWholeVo maWholeVo : list) {
|
||||
res = mapper.updatePreNum(maWholeVo);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("修改失败");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("修改异常:{}", e.getMessage());
|
||||
return AjaxResult.error("修改异常:", e.getMessage());
|
||||
}
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
*
|
||||
|
|
|
|||
|
|
@ -32,9 +32,11 @@
|
|||
<select id="getByParentId" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from lease_apply_details
|
||||
where parennt_id = #{parentId}
|
||||
lad.id, lad.parennt_id, lad.type_id, lad.pre_num, lad.al_num, lad.`status`, lad.create_by, lad.create_time, lad.update_by,
|
||||
lad.update_time, lad.remark, lad.company_id
|
||||
from lease_apply_details lad
|
||||
left join ma_type mt on lad.type_id = mt.type_id
|
||||
where parennt_id = #{parentId} and mt.is_storage = 1
|
||||
</select>
|
||||
<select id="selectByTaskId" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
select lad.id from lease_apply_details lad left join lease_apply_info lai on lad.parennt_id = lai.id
|
||||
|
|
|
|||
|
|
@ -129,6 +129,41 @@
|
|||
mws.whole_type_name = #{wholeTypeName}
|
||||
</select>
|
||||
|
||||
<select id="selectListByIdTwo" resultType="com.bonus.sgzb.material.domain.MaWholeVo">
|
||||
select
|
||||
lad.id as id,
|
||||
mt.parent_id AS parentId,
|
||||
mt.type_id as deviceTypeId,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS deviceType,
|
||||
CASE mt.manage_type
|
||||
WHEN 0 THEN
|
||||
IFNULL(subquery0.num, 0)
|
||||
ELSE
|
||||
IFNULL(mt.num, 0)
|
||||
END as num,
|
||||
case when lad.update_num IS NOT NULL then lad.update_num else lad.pre_num * lad.sets_num end as applyNum,
|
||||
mt.is_storage AS isStorage
|
||||
from lease_apply_details lad
|
||||
left join ma_type mt on lad.type_id = mt.type_id
|
||||
left join ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
left join (SELECT mt.type_id,
|
||||
count(mm.ma_id) num
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_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
|
||||
lad.parennt_id = #{parentId}
|
||||
and lad.ct_parent_id = #{id}
|
||||
</select>
|
||||
|
||||
<update id="updatePreNum">
|
||||
update lease_apply_details
|
||||
set update_num = #{applyNum}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectTypeTree" resultType="com.bonus.sgzb.material.domain.TreeSelectId">
|
||||
SELECT
|
||||
mt4.type_id AS firstId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue