宁夏试运行问题修改
This commit is contained in:
parent
f23f39483f
commit
3be3330714
|
|
@ -46,6 +46,11 @@ public class LeaseApplyDetails implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@ApiModelProperty(value = "领料出库状态")
|
||||
private String statusName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
|
|
|
|||
|
|
@ -103,4 +103,8 @@ public interface LeaseOutDetailsMapper {
|
|||
int getmaChineByCt(LeaseOutDetails record);
|
||||
|
||||
void updateMaTypeNum(LeaseApplyDetails leaseApplyDetails);
|
||||
|
||||
LeaseApplyDetails getLeaseApplyDetails(@Param("record") LeaseOutDetails record);
|
||||
|
||||
int updateLeaseApplyDetails(@Param("record") LeaseOutDetails record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,30 +202,34 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
int res = 0;
|
||||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
res = leaseOutDetailsMapper.updateLeaseApplyDetailsOutNum(record);
|
||||
if (res > 0) {
|
||||
// 插入领料出库明细表(lease_out_details)
|
||||
res = leaseOutDetailsMapper.insertSelective(record);
|
||||
if (res > 0) {
|
||||
if (record.getManageType() == 2) {
|
||||
// 成套机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||
// 成套机具减少 (ma_type 设备规格表)配件的库存数量
|
||||
List<TmTask> typeIds = leaseOutDetailsMapper.getMaTypeDetails(record);
|
||||
typeIds.removeIf(item -> item == null);
|
||||
for (TmTask typeId : typeIds) {
|
||||
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
||||
machinePart.setPartNum((typeId.getPartNum() * record.getOutNum()));
|
||||
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
||||
}
|
||||
} else {
|
||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||
}
|
||||
// 更新 (ma_machine 设备表)的状态
|
||||
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
||||
}
|
||||
LeaseApplyDetails leaseApplyDetails = leaseOutDetailsMapper.getLeaseApplyDetails(record);
|
||||
if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())){
|
||||
leaseOutDetailsMapper.updateLeaseApplyDetails(record);
|
||||
}
|
||||
if (res > 0) {
|
||||
// 插入领料出库明细表(lease_out_details)
|
||||
res = leaseOutDetailsMapper.insertSelective(record);
|
||||
if (res > 0) {
|
||||
if (record.getManageType() == 2) {
|
||||
// 成套机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||
// 成套机具减少 (ma_type 设备规格表)配件的库存数量
|
||||
List<TmTask> typeIds = leaseOutDetailsMapper.getMaTypeDetails(record);
|
||||
typeIds.removeIf(item -> item == null);
|
||||
for (TmTask typeId : typeIds) {
|
||||
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
||||
machinePart.setPartNum((typeId.getPartNum() * record.getOutNum()));
|
||||
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
||||
}
|
||||
} else {
|
||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||
}
|
||||
// 更新 (ma_machine 设备表)的状态
|
||||
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@
|
|||
update_by = #{record.updateBy},
|
||||
</if>
|
||||
update_time = now(),
|
||||
status = '2'
|
||||
status = '1'
|
||||
WHERE
|
||||
parennt_id = #{record.parentId} and type_id = #{record.typeId}
|
||||
</update>
|
||||
|
|
@ -315,6 +315,14 @@
|
|||
WHERE
|
||||
type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateLeaseApplyDetails">
|
||||
UPDATE
|
||||
lease_apply_details
|
||||
SET
|
||||
status = '2'
|
||||
WHERE
|
||||
parennt_id = #{record.parentId} and type_id = #{record.typeId}
|
||||
</update>
|
||||
|
||||
<insert id="insertAgreementInfo">
|
||||
insert into tm_task_agreement
|
||||
|
|
@ -431,4 +439,15 @@
|
|||
<select id="getmaChineByCt" resultType="java.lang.Integer">
|
||||
select num from ma_type WHERE type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
ifnull( pre_num, 0 ) AS preNum,
|
||||
ifnull( audit_num, 0 ) AS auditNum,
|
||||
ifnull( al_num, 0 ) AS alNum
|
||||
FROM
|
||||
lease_apply_details
|
||||
WHERE
|
||||
parennt_id = #{record.parentId}
|
||||
AND type_id = #{record.typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -606,16 +606,33 @@
|
|||
|
||||
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
|
||||
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
||||
mt.num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode
|
||||
lad.*,
|
||||
CASE
|
||||
WHEN lad.`status` = 0 THEN
|
||||
'待出库'
|
||||
WHEN lad.`status` = 1 THEN
|
||||
'出库进行中'
|
||||
WHEN lad.`status` = 2 THEN
|
||||
'已出库'
|
||||
END statusName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt1.type_name AS typeName,
|
||||
mt.unit_name AS unitName,
|
||||
mt.manage_type AS manageType,
|
||||
CASE
|
||||
WHEN mt.manage_type = '0' THEN
|
||||
'编号' ELSE '计数'
|
||||
END manageTypeName,
|
||||
mt.num,
|
||||
(lad.pre_num -IF( lad.al_num IS NULL, '0', lad.al_num )) AS outNum,
|
||||
mm.ma_code AS maCode
|
||||
FROM
|
||||
lease_apply_details lad
|
||||
lease_apply_details lad
|
||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id
|
||||
WHERE
|
||||
lad.parennt_id = #{record.id}
|
||||
lad.parennt_id = #{record.id}
|
||||
GROUP BY
|
||||
lad.id
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue