Compare commits

...

2 Commits

6 changed files with 26 additions and 11 deletions

View File

@ -729,6 +729,7 @@
company_audit_by = #{record.companyAuditBy}, company_audit_by = #{record.companyAuditBy},
company_audit_time = now(), company_audit_time = now(),
company_audit_remark = #{record.companyAuditRemark}, company_audit_remark = #{record.companyAuditRemark},
status = #{record.status},
</if> </if>
<if test="record.examineStatusId == 31 and record.examineStatusId == '31'"> <if test="record.examineStatusId == 31 and record.examineStatusId == '31'">
dept_audit_by = #{record.companyAuditBy}, dept_audit_by = #{record.companyAuditBy},

View File

@ -20,6 +20,9 @@ public class BackApplyInfo extends BaseEntity {
/** 退料ID */ /** 退料ID */
@ApiModelProperty(value = "退料ID") @ApiModelProperty(value = "退料ID")
private Long id; private Long id;
/** 退料ID */
@ApiModelProperty(value = "预报废列表审核旧taskId")
private Long oldTaskId;
@ApiModelProperty(value="工程id") @ApiModelProperty(value="工程id")
private Long projectId; private Long projectId;

View File

@ -192,7 +192,7 @@ public interface ScrapApplyDetailsMapper {
int updateMaStatus(@Param("maId") int maId, @Param("maStatus") String maStatus); int updateMaStatus(@Param("maId") int maId, @Param("maStatus") String maStatus);
int selectNumByTypeId(@Param("parentId") String parentId, @Param("typeId") String typeId); int selectNumByTypeId(@Param("parentId") String parentId, @Param("typeId") String typeId, @Param("taskId") Integer taskId);
int selectCodeByMaIdAndTaskId(@Param("maId") Integer maId, @Param("taskId") Integer taskId); int selectCodeByMaIdAndTaskId(@Param("maId") Integer maId, @Param("taskId") Integer taskId);

View File

@ -486,7 +486,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
if (arr.length > 0) { if (arr.length > 0) {
for (int i = 0; i < arr.length; i++) { for (int i = 0; i < arr.length; i++) {
//判断是否超出审核数量 //判断是否超出审核数量
int re = scrapApplyDetailsMapper.selectNumByTypeId(arr[i].getParentId(), arr[i].getTypeId()); int re = scrapApplyDetailsMapper.selectNumByTypeId(arr[i].getParentId(), arr[i].getTypeId(),record.getTaskId());
if (re <= 0) { if (re <= 0) {
res = -2; res = -2;
break; break;
@ -564,7 +564,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
} }
@Override @Override
// @Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int endback(ScrapAudit scrapAudit) { public int endback(ScrapAudit scrapAudit) {
int res = 0; int res = 0;
//参数校验 后期可以考虑写一个校验的工具类 //参数校验 后期可以考虑写一个校验的工具类
@ -821,6 +821,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
BackApplyInfo[] arr = record.getArr(); BackApplyInfo[] arr = record.getArr();
if (arr.length > 0) { if (arr.length > 0) {
for (int i = 0; i < arr.length; i++) { for (int i = 0; i < arr.length; i++) {
arr[i].setTaskId(record.getTaskId());
res = scrapApplyDetailsMapper.insertCheckDetails(arr[i]); res = scrapApplyDetailsMapper.insertCheckDetails(arr[i]);
String manageType = arr[i].getManageType(); String manageType = arr[i].getManageType();
if ("0".equals(manageType)) { if ("0".equals(manageType)) {

View File

@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPutInListList" resultMap="PurchaseCheckInfoResult"> <select id="selectPutInListList" resultMap="PurchaseCheckInfoResult">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_time, pci.update_by, select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_time, pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.nick_name purchaserName, pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,us.nick_name purchaserName,
tk.create_by, tk.create_by,
CASE tk.task_status CASE tk.task_status
WHEN 28 THEN WHEN 28 THEN

View File

@ -281,6 +281,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null"> <if test="companyId != null">
company_id, company_id,
</if> </if>
<if test="taskId != null">
old_task_id,
</if>
create_time create_time
) )
values ( values (
@ -321,6 +324,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null"> <if test="companyId != null">
#{companyId}, #{companyId},
</if> </if>
<if test="taskId != null">
#{taskId},
</if>
NOW() NOW()
) )
</insert> </insert>
@ -595,7 +601,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteCheckDetails"> <delete id="deleteCheckDetails">
delete from scrap_check_details where parent_id = #{parentId} and type_id = #{typeId} delete from scrap_check_details where parent_id = #{parentId} and type_id = #{typeId} and old_task_id = #{taskId}
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
and ma_id = #{maId} and ma_id = #{maId}
</if> </if>
@ -935,7 +941,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM FROM
scrap_check_details scd1 scrap_check_details scd1
LEFT JOIN scrap_apply_details sad1 ON scd1.parent_id = sad1.parent_id LEFT JOIN scrap_apply_details sad1 ON scd1.parent_id = sad1.parent_id
AND scd1.type_id = sad1.type_id AND scd1.type_id = sad1.type_id and scd1.old_task_id = sad1.task_id
WHERE sad1.task_id = #{taskId} WHERE sad1.task_id = #{taskId}
GROUP BY GROUP BY
scd1.parent_id, sad1.type_id scd1.parent_id, sad1.type_id
@ -967,7 +973,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
sad.task_id = #{taskId} sad.task_id = #{taskId}
AND sad.type_id = #{typeId} AND sad.type_id = #{typeId}
AND mma.ma_status = 20
ORDER BY ORDER BY
sad.create_time DESC sad.create_time DESC
</select> </select>
@ -983,7 +988,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
scrap_apply_details bad scrap_apply_details bad
WHERE WHERE
bad.parent_id = #{parentId} bad.parent_id = #{parentId}
AND bad.type_id = #{typeId} UNION AND bad.type_id = #{typeId} and bad.task_id = #{taskId} UNION
SELECT SELECT
0 AS auditNum, 0 AS auditNum,
SUM( SUM(
@ -992,7 +997,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
scrap_check_details bcd scrap_check_details bcd
WHERE WHERE
bcd.parent_id = #{parentId} bcd.parent_id = #{parentId}
AND bcd.type_id = #{typeId} AND bcd.type_id = #{typeId} and bcd.old_task_id = #{taskId}
) res ) res
HAVING backNum > -1 HAVING backNum > -1
</select> </select>
@ -1001,7 +1006,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
COUNT(*) COUNT(*)
FROM FROM
scrap_check_details bcd scrap_check_details bcd
LEFT JOIN scrap_apply_details sad ON bcd.parent_id = sad.parent_id LEFT JOIN scrap_apply_details sad ON bcd.parent_id = sad.parent_id and bcd.old_task_id = sad.task_id
WHERE WHERE
bcd.ma_id = #{maId} bcd.ma_id = #{maId}
AND sad.task_id = #{taskId} AND sad.task_id = #{taskId}
@ -1029,6 +1034,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
scd.parent_id = #{parentId} scd.parent_id = #{parentId}
AND scd.type_id = #{typeId} AND scd.type_id = #{typeId}
AND scd.old_task_id = #{taskId}
GROUP BY GROUP BY
scd.type_id scd.type_id
ORDER BY ORDER BY
@ -1051,6 +1057,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
scd.parent_id = #{parentId} scd.parent_id = #{parentId}
AND scd.type_id = #{typeId} AND scd.type_id = #{typeId}
AND scd.old_task_id = #{taskId}
<if test="maCode != null and maCode != ''"> <if test="maCode != null and maCode != ''">
and mm.ma_code like concat('%', #{maCode}, '%') and mm.ma_code like concat('%', #{maCode}, '%')
</if> </if>
@ -1077,7 +1084,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM FROM
scrap_check_details scd1 scrap_check_details scd1
LEFT JOIN scrap_apply_details sad1 ON scd1.parent_id = sad1.parent_id LEFT JOIN scrap_apply_details sad1 ON scd1.parent_id = sad1.parent_id
AND scd1.type_id = sad1.type_id AND scd1.type_id = sad1.type_id and scd1.old_task_id = sad1.task_id
WHERE sad1.task_id = #{taskId} WHERE sad1.task_id = #{taskId}
GROUP BY GROUP BY
scd1.parent_id, scd1.parent_id,
@ -1114,6 +1121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
WHERE WHERE
bai.task_id = #{taskId} bai.task_id = #{taskId}
AND bcd.old_task_id = bai.task_id
AND bcd.back_status = '1' AND bcd.back_status = '1'
</select> </select>
<select id="getWxList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo"> <select id="getWxList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
@ -1134,6 +1142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
WHERE WHERE
bai.task_id = #{taskId} bai.task_id = #{taskId}
AND bcd.old_task_id = bai.task_id
AND bcd.back_status = '2' AND bcd.back_status = '2'
</select> </select>
<select id="getBfList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo"> <select id="getBfList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
@ -1156,6 +1165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
WHERE WHERE
bai.task_id = #{taskId} bai.task_id = #{taskId}
AND bcd.old_task_id = bai.task_id
AND bcd.back_status = '3' AND bcd.back_status = '3'
</select> </select>
<select id="selectTaskNumByMonthWx" resultType="java.lang.Integer"> <select id="selectTaskNumByMonthWx" resultType="java.lang.Integer">