Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zhouxain01 2023-12-22 14:06:04 +08:00
commit 0ec118efb4
12 changed files with 101 additions and 52 deletions

View File

@ -75,6 +75,7 @@ public interface MaLabelBindMapper
*/ */
public int updateMaLabelBindByMaIds(Long id); public int updateMaLabelBindByMaIds(Long id);
public int updateMaLabelBindMaIds(MaLabelBindVO maLabelBindVO);
MaLabelBindVO selectMaMachineMaId(String maCode); MaLabelBindVO selectMaMachineMaId(String maCode);
int insertLabelBind(MaLabelBind maLabelBind); int insertLabelBind(MaLabelBind maLabelBind);

View File

@ -67,10 +67,14 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService
public int insertMaLabelBind(MaLabelBindVO maLabelBind) public int insertMaLabelBind(MaLabelBindVO maLabelBind)
{ {
int i = 0; int i = 0;
int b =0;
MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode()); MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode());
if(StringHelper.isNotEmpty(bean.getMaId())){ if(StringHelper.isNotEmpty(bean.getMaId())){
maLabelBind.setMaId(bean.getMaId()); maLabelBind.setMaId(bean.getMaId());
maLabelBind.setTypeId(bean.getTypeId());
maLabelBind.setStatus("1"); maLabelBind.setStatus("1");
maLabelBind.setIsBind("1");
b=maLabelBindMapper.updateMaLabelBindMaIds(maLabelBind);
i = maLabelBindMapper.insertMaLabelBindS(maLabelBind); i = maLabelBindMapper.insertMaLabelBindS(maLabelBind);
} }
return i ; return i ;

View File

@ -54,6 +54,7 @@ public class MaMachineLabelServiceImpl implements IMaMachineLabelService
code = format + "-000" + lableNum; code = format + "-000" + lableNum;
} }
lableNum++; lableNum++;
maMachineLabel.setIsBind("0");
maMachineLabel.setLabelCode(code); maMachineLabel.setLabelCode(code);
maMachineLabelMapper.insertMaMachineLabel(maMachineLabel); maMachineLabelMapper.insertMaMachineLabel(maMachineLabel);
} }

View File

@ -33,7 +33,7 @@
</sql> </sql>
<select id="selectMaLabelBindList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult"> <select id="selectMaLabelBindList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult">
SELECT b.label_id,a.id,b.label_code,a.bind_time,b.label_type,mt.type_id,mt.type_name, SELECT b.label_id,a.id,b.is_bind,b.label_code,a.bind_time,b.label_type,mt.type_id,mt.type_name,
mt2.type_id as modelId , mt2.type_name as modelName,mt3.type_name as wpName, mt2.type_id as modelId , mt2.type_name as modelName,mt3.type_name as wpName,
mt4.type_name as kindName ,a.status,a.binder,dic.name,ma.ma_code,user.user_name mt4.type_name as kindName ,a.status,a.binder,dic.name,ma.ma_code,user.user_name
FROM ma_machine_label b FROM ma_machine_label b
@ -55,7 +55,9 @@
<if test="companyId != null and companyId != ''"> and a.company_id = #{companyId}</if> <if test="companyId != null and companyId != ''"> and a.company_id = #{companyId}</if>
<if test="modelId != null and modelId != ''"> and mt2.type_id= #{modelId}</if> <if test="modelId != null and modelId != ''"> and mt2.type_id= #{modelId}</if>
<if test="wpName != null and wpName != ''"> and mt3.type_name = #{wpName}</if> <if test="wpName != null and wpName != ''"> and mt3.type_name = #{wpName}</if>
<if test="isBind != null and isBind != ''"> and b.is_bind = #{isBind}</if>
</where> </where>
ORDER BY b.is_bind ASC
</select> </select>
<select id="selecthistoryList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult"> <select id="selecthistoryList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult">
SELECT a.ma_id,a.label_code,a.bind_time,a.label_type,mt.type_id,mt.type_name, SELECT a.ma_id,a.label_code,a.bind_time,a.label_type,mt.type_id,mt.type_name,
@ -106,7 +108,7 @@
<if test="binder != null">#{binder},</if> <if test="binder != null">#{binder},</if>
<if test="labelType != null">#{labelType},</if> <if test="labelType != null">#{labelType},</if>
<if test="companyId != null">#{companyId},</if> <if test="companyId != null">#{companyId},</if>
<if test="isBind != null">#{binderTime},</if> <if test="bindTime != null">#{bindTime},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
</trim> </trim>
</insert> </insert>
@ -119,7 +121,7 @@
<if test="binder != null">binder,</if> <if test="binder != null">binder,</if>
<if test="labelType != null">label_type,</if> <if test="labelType != null">label_type,</if>
<if test="companyId != null">company_id,</if> <if test="companyId != null">company_id,</if>
<if test="isBind != null">binder_time,</if> <if test="bindTime != null">bind_time,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -129,7 +131,7 @@
<if test="binder != null">#{binder},</if> <if test="binder != null">#{binder},</if>
<if test="labelType != null">#{labelType},</if> <if test="labelType != null">#{labelType},</if>
<if test="companyId != null">#{companyId},</if> <if test="companyId != null">#{companyId},</if>
<if test="bindTime != null">#{binderTime},</if> <if test="bindTime != null">#{bindTime},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
</trim> </trim>
</insert> </insert>
@ -161,12 +163,17 @@
</delete> </delete>
<update id="updateMaLabelBindByMaIds" parameterType="Long"> <update id="updateMaLabelBindByMaIds" parameterType="Long">
update ma_label_bind set status = '0' where ma_id = #{id} update ma_label_bind set status = '0' where id = #{id}
</update> </update>
<select id="selectMaMachineMaId" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO"> <select id="selectMaMachineMaId" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO">
select ma_id as maId select ma_id as maId,type_id as typeId
from ma_machine from ma_machine
where ma_code = #{maCode} where ma_code = #{maCode}
</select> </select>
<update id="updateMaLabelBindMaIds" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO">
update ma_machine_label set
ma_id = #{maId},is_bind =#{isBind}
where label_id =#{labelId}
</update>
</mapper> </mapper>

View File

@ -13,7 +13,7 @@
<result property="companyId" column="company_id" /> <result property="companyId" column="company_id" />
</resultMap> </resultMap>
<sql id="selectMaMachineLabelVo"> <sql id="selectMaMachineLabelVo">
select label_id, label_code, type_id, is_bind, label_type, company_id select label_id, label_code, ma_id, is_bind, label_type, company_id
from ma_machine_label from ma_machine_label
</sql> </sql>
<select id="selectMaMachineLabelList" parameterType="com.bonus.sgzb.base.domain.MaMachineLabel" resultMap="MaMachineLabelResult"> <select id="selectMaMachineLabelList" parameterType="com.bonus.sgzb.base.domain.MaMachineLabel" resultMap="MaMachineLabelResult">

View File

@ -9,10 +9,7 @@ import com.bonus.sgzb.material.domain.RepairTestInputVo;
import com.bonus.sgzb.material.service.RepairTestInputService; import com.bonus.sgzb.material.service.RepairTestInputService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -29,16 +26,16 @@ public class RepairTestInputController extends BaseController {
private RepairTestInputService service; private RepairTestInputService service;
@ApiOperation(value = "获取修试后入库列表") @ApiOperation(value = "获取修试后入库列表")
@PostMapping("getRepairedList") @GetMapping("getRepairedList")
public TableDataInfo getRepairedList(@Validated @RequestBody RepairTestInputDto dto){ public TableDataInfo getRepairedList(RepairTestInputDto dto){
startPage(); startPage();
List<RepairTestInputVo> list = service.getRepairedList(dto); List<RepairTestInputVo> list = service.getRepairedList(dto);
return getDataTable(list); return getDataTable(list);
} }
@ApiOperation(value = "获取修试后入库列表-详情") @ApiOperation(value = "获取修试后入库列表-详情")
@PostMapping("getRepairedDetailList") @GetMapping("getRepairedDetailList")
public TableDataInfo getRepairedDetailList(@Validated @RequestBody RepairTestInputDto dto){ public TableDataInfo getRepairedDetailList(RepairTestInputDto dto){
startPage(); startPage();
List<RepairTestInputDetailVo> list = service.getRepairedDetailList(dto); List<RepairTestInputDetailVo> list = service.getRepairedDetailList(dto);
return getDataTable(list); return getDataTable(list);
@ -46,7 +43,7 @@ public class RepairTestInputController extends BaseController {
@ApiOperation(value = "修试后入库-入库操作") @ApiOperation(value = "修试后入库-入库操作")
@PostMapping("inputByType") @PostMapping("inputByType")
public AjaxResult inputByType(@Validated @RequestBody String params){ public AjaxResult inputByType(@RequestBody RepairTestInputDto dto){
return service.inputByType(params); return service.inputByType(dto);
} }
} }

View File

@ -155,4 +155,10 @@ public class BackApplyInfo extends BaseEntity {
@ApiModelProperty(value = "审核人") @ApiModelProperty(value = "审核人")
private String examineName; private String examineName;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
} }

View File

@ -7,7 +7,7 @@ import lombok.Data;
* 修试入库-前端传参 * 修试入库-前端传参
*/ */
@Data @Data
public class RepairTestInputDto { public class RepairTestInputDto{
/** 任务id*/ /** 任务id*/
private int taskId; private int taskId;
@ -18,4 +18,15 @@ public class RepairTestInputDto {
/** 状态*/ /** 状态*/
private String status; private String status;
/** 设备类型*/
private String deviceTypeId;
/** 规格型号*/
private String typeId;
/** 维修时间*/
private String wxTime;
private String params;
} }

View File

@ -37,5 +37,5 @@ public interface RepairTestInputService {
* @author cwchen * @author cwchen
* @date 2023/12/16 18:35 * @date 2023/12/16 18:35
*/ */
AjaxResult inputByType(String params); AjaxResult inputByType(RepairTestInputDto dto);
} }

View File

@ -47,12 +47,12 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult inputByType(String params) { public AjaxResult inputByType(RepairTestInputDto repairTestInputDto) {
try { try {
if (StringUtils.isEmpty(params)) { if (StringUtils.isEmpty(repairTestInputDto.getParams())) {
return AjaxResult.error(HttpStatus.ERROR, "参数不正确"); return AjaxResult.error(HttpStatus.ERROR, "参数不正确");
} }
List<RepairTestWarehousingDto> list = JSONObject.parseArray(params, RepairTestWarehousingDto.class); List<RepairTestWarehousingDto> list = JSONObject.parseArray(repairTestInputDto.getParams(), RepairTestWarehousingDto.class);
if(CollectionUtils.isEmpty(list)){ if(CollectionUtils.isEmpty(list)){
return AjaxResult.error(HttpStatus.ERROR, "参数不正确"); return AjaxResult.error(HttpStatus.ERROR, "参数不正确");
} }

View File

@ -324,6 +324,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="agreementCode != null and agreementCode != ''"> <if test="agreementCode != null and agreementCode != ''">
and bagi.agreement_code like concat('%', #{agreementCode}, '%') and bagi.agreement_code like concat('%', #{agreementCode}, '%')
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and bai.back_time >=#{startTime}
and #{endTime} >=bai.back_time
</if>
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
</select> </select>

View File

@ -58,34 +58,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--获取修试后入库列表--> <!--获取修试后入库列表-->
<select id="getRepairedList" resultType="com.bonus.sgzb.material.domain.RepairTestInputVo"> <select id="getRepairedList" resultType="com.bonus.sgzb.material.domain.RepairTestInputVo">
SELECT ANY_VALUE(rid.task_id) AS id, SELECT b.id,
ANY_VALUE(tt2.`code`) AS repairCode, b.repairCode,
ANY_VALUE(GROUP_CONCAT(a.typeName)) AS maTypeName, b.maTypeName,
ANY_VALUE(tt2.create_by) AS wxName, b.wxName,
ANY_VALUE(tt2.create_time) AS wxTime, b.wxTime,
ANY_VALUE(IFNULL(sd.`name`,'入库进行中')) AS taskStatus b.taskStatus
FROM repair_input_details rid FROM (
LEFT JOIN tm_task tt ON rid.task_id = tt.task_id SELECT ANY_VALUE(rid.task_id) AS id,
LEFT JOIN sys_dic sd ON tt.task_status = sd.id ANY_VALUE(tt2.`code`) AS repairCode,
LEFT JOIN tm_task tt2 ON rid.repair_id = tt2.task_id ANY_VALUE(GROUP_CONCAT(DISTINCT a.typeName2)) AS maTypeName,
LEFT JOIN ( ANY_VALUE(GROUP_CONCAT(DISTINCT a.typeId2)) AS typeId2,
SELECT mt.type_id,mt3.type_name AS typeName,mt.manage_type ANY_VALUE(tt2.create_by) AS wxName,
FROM ma_type mt ANY_VALUE(tt2.create_time) AS wxTime,
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3' ANY_VALUE(IFNULL(sd.`name`,'入库进行中')) AS taskStatus
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2' FROM repair_input_details rid
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1' LEFT JOIN tm_task tt ON rid.task_id = tt.task_id
WHERE mt.`level` = '4' LEFT JOIN sys_dic sd ON tt.task_status = sd.id
)a ON rid.type_id = a.type_id LEFT JOIN tm_task tt2 ON rid.repair_id = tt2.task_id
LEFT JOIN (
SELECT mt.type_id AS typeId,mt.type_name AS typeName,mt.manage_type,mt2.type_id AS typeId2,mt2.type_name AS typeName2
FROM ma_type mt
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1'
WHERE mt.`level` = '4'
)a ON rid.type_id = a.typeId
GROUP BY rid.task_id
ORDER BY tt.create_time DESC
) b
<where> <where>
<if test="deviceTypeId!=null and deviceTypeId!=''">
INSTR(b.typeId2,#{deviceTypeId}) > 0
</if>
<if test="wxTime!=null and wxTime!=''">
AND b.wxTime BETWEEN CONCAT(#{wxTime},' 00:00:00') AND CONCAT(#{wxTime},' 23:59:59')
</if>
<if test="keyWord!=null and keyWord!=''"> <if test="keyWord!=null and keyWord!=''">
( AND (
INSTR(tt.`code`,#{keyWord}) > 0 OR INSTR(b.repairCode,#{keyWord}) > 0 OR
INSTR(tt2.create_by,#{keyWord}) > 0 INSTR(b.wxName,#{keyWord}) > 0
) )
</if> </if>
</where> </where>
GROUP BY rid.task_id
ORDER BY tt.create_time DESC
</select> </select>
<!--获取修试后入库-详情列表--> <!--获取修试后入库-详情列表-->
<select id="getRepairedDetailList" resultType="com.bonus.sgzb.material.domain.RepairTestInputDetailVo"> <select id="getRepairedDetailList" resultType="com.bonus.sgzb.material.domain.RepairTestInputDetailVo">
@ -104,22 +119,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM repair_input_details rid FROM repair_input_details rid
LEFT JOIN ma_machine mm ON rid.ma_id = mm.ma_id LEFT JOIN ma_machine mm ON rid.ma_id = mm.ma_id
LEFT JOIN ( LEFT JOIN (
SELECT mt.type_id,mt.type_name AS typeName,mt2.type_name AS typeName2,mt.manage_type SELECT mt.type_id AS typeId,mt2.type_id AS typeId2,mt.type_name AS typeName,mt2.type_name AS typeName2,mt.manage_type
FROM ma_type mt FROM ma_type mt
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3' LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2' LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1' LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1'
WHERE mt.`level` = '4' WHERE mt.`level` = '4'
)a ON rid.type_id = a.type_id )a ON rid.type_id = a.typeId
WHERE rid.task_id = #{taskId} WHERE rid.task_id = #{taskId}
<if test="keyWord!=null and keyWord!=''"> <if test="keyWord!=null and keyWord!=''">
AND ( AND (
INSTR(a.typeName,#{keyWord}) > 0 OR INSTR(rid.update_by,#{keyWord}) > 0 OR
INSTR(a.typeName2,#{keyWord}) > 0 INSTR(mm.ma_code,#{keyWord}) > 0
) )
</if> </if>
<if test="status!=null and status!=''"> <if test="deviceTypeId!=null and deviceTypeId!=''">
AND rid.status = #{status} AND a.typeId2 = #{deviceTypeId}
</if>
<if test="typeId!=null and typeId!=''">
AND a.typeId = #{typeId}
</if> </if>
ORDER BY rid.create_time DESC ORDER BY rid.create_time DESC
</select> </select>