后台修试管理代码提交

This commit is contained in:
1539530615@qq.com 2024-01-12 17:11:47 +08:00
parent d53020f434
commit 1115686d36
8 changed files with 80 additions and 18 deletions

View File

@ -43,4 +43,6 @@ public interface LeaseApplyDetailsMapper {
int updateBatchSelective(List<LeaseApplyDetails> list);
int batchInsert(@Param("list") List<LeaseApplyDetails> list);
List<LeaseApplyDetails> getByParentId(Integer parentId);
}

View File

@ -46,4 +46,7 @@ public interface LeaseOutDetailsMapper {
*/
int insertAgreementInfo(@Param("record") LeaseOutDetails leaseOutDetails);
String getTaskId(Integer parentId);
int updateTaskStatus(@Param("taskId") String taskId,@Param("status")int status);
}

View File

@ -1,7 +1,9 @@
package com.bonus.sgzb.app.service.impl;
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
import com.bonus.sgzb.app.mapper.LeaseOutDetailsMapper;
import com.bonus.sgzb.app.service.LeaseOutDetailsService;
import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.mapper.MaMachineMapper;
@ -11,6 +13,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* Description: 领料出库详情接口实现类
@ -25,7 +28,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
@Resource
private LeaseOutDetailsMapper leaseOutDetailsMapper;
@Resource
private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
@Resource
private MaMachineMapper maMachineMapper;
@ -69,7 +73,20 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
if (updateMaTypeStockNum > 0) {
// if (updateMaMachineStatus > 0) {
// if (insertAgreementInfo > 0) {
return AjaxResult.success("领料出库成功!");
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId());
int i = 0;
for (LeaseApplyDetails bean : leaseApplyDetailsList){
if (Objects.equals(bean.getPreNum(), bean.getAlNum())){
i++;
}
}
String taskId = leaseOutDetailsMapper.getTaskId(record.getParentId());
if (i == leaseApplyDetailsList.size()){
leaseOutDetailsMapper.updateTaskStatus(taskId,35);
}else {
leaseOutDetailsMapper.updateTaskStatus(taskId,34);
}
return AjaxResult.success("领料出库成功!");
// }
// return AjaxResult.error("领料出库失败,插入任务协议信息错误!");
// }

View File

@ -29,8 +29,15 @@
from lease_apply_details
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getByParentId" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from lease_apply_details
where parennt_id = #{parentId}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from lease_apply_details
where id = #{id,jdbcType=INTEGER}
</delete>

View File

@ -14,6 +14,11 @@
</if>
</where>
</select>
<select id="getTaskId" resultType="java.lang.String">
select task_id
from lease_apply_info
where id = #{parentId}
</select>
<update id="updateLeaseApplyDetailsOutNum">
UPDATE
@ -121,6 +126,11 @@
</if>
</where>
</update>
<update id="updateTaskStatus">
update tm_task
set task_status = #{status}
where task_id = #{taskId}
</update>
<insert id="insertAgreementInfo">
insert into tm_task_agreement

View File

@ -174,7 +174,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsList) {
Long typeId = repairAuditDetails.getTypeId();
Long maId = repairAuditDetails.getMaId();
BigDecimal repairNum = repairAuditDetails.getRepairNum();
BigDecimal repairNum = repairAuditDetails.getRepairedNum();
BigDecimal b = new BigDecimal(0);
// 创建修饰后入库任务
if (repairNum.compareTo(b) > 0) {
@ -202,7 +202,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairInputDetails.setTaskId(task.getTaskId());
repairInputDetails.setAuditId(repairAuditDetails.getId());
repairInputDetails.setRepairId(repairAuditDetails.getRepairId());
repairInputDetails.setRepairNum(repairAuditDetails.getRepairNum());
repairInputDetails.setRepairNum(repairAuditDetails.getRepairedNum());
repairInputDetails.setTypeId(repairAuditDetails.getTypeId());
repairInputDetails.setMaId(repairAuditDetails.getMaId());
repairInputDetails.setStatus("0");

View File

@ -32,19 +32,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectScrapApplyDetailsList" parameterType="com.bonus.sgzb.material.domain.ScrapApplyDetails" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
select tk.code scrapNum,tk.task_status taskStatus, dic.name taskStatusName, bui.unit_name unitName,bpl.lot_name projectName,
tk.create_by createBy, tk.create_time createTime, tk.remark ,tk1.code repairNum,tk.task_id taskId
from tm_task tk
left join tm_task_agreement tta on tk.task_id = tta.task_id
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
left join bm_project_lot bpl on bai.project_id = bpl.lot_id
left join bm_unit_info bui on bai.unit_id = bui.unit_id
left join scrap_apply_details sad on tk.task_id = sad.task_id
left join tm_task tk1 on sad.parent_id = tk1.task_id
left join (select id,p_id,name from sys_dic where p_id in (select id from sys_dic where value = 'bf_task')) dic on tk.task_status = dic.id
left join ma_type mt on sad.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where sad.scrap_source in ('1','2') and tk.task_type = 57
SELECT
tk.CODE scrapNum,
tk.task_status taskStatus,
dic.NAME taskStatusName,
bui.unit_name unitName,
bpl.lot_name projectName,
tk.create_by createBy,
tk.create_time createTime,
tk.remark,
tk1.CODE repairNum,
tk.task_id taskId
FROM
tm_task tk
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
LEFT JOIN scrap_apply_details sad ON tk.task_id = sad.task_id
LEFT JOIN tm_task tk1 ON sad.parent_id = tk1.task_id
LEFT JOIN (
SELECT
id,
p_id,
NAME
FROM
sys_dic
WHERE
p_id IN ( SELECT id FROM sys_dic WHERE VALUE = 'bf_task' )) dic ON tk.task_status = dic.id
LEFT JOIN ma_type mt ON sad.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
WHERE
sad.scrap_source IN ( '1', '2' )
AND tk.task_type = 57
<if test="backUnit != null">
and bui.unit_id = #{backUnit}
</if>
@ -60,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="backCode != null">
and tk.code = #{backCode}
</if>
GROUP BY tk.CODE
order by tk.create_time desc
</select>

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" useGeneratedKeys="true" keyProperty="taskId">
insert into tm_task_agreement
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="task_id != null">task_id,</if>
<if test="agreementId != null">agreement_id,</if>
<if test="createBy != null">create_by,</if>
create_time,
@ -44,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="task_id != null">#{taskId},</if>
<if test="agreementId != null">#{agreementId},</if>
<if test="createBy != null">#{createBy},</if>
now(),