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 updateMaLabelBindMaIds(MaLabelBindVO maLabelBindVO);
MaLabelBindVO selectMaMachineMaId(String maCode);
int insertLabelBind(MaLabelBind maLabelBind);

View File

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

View File

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

View File

@ -33,7 +33,7 @@
</sql>
<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,
mt4.type_name as kindName ,a.status,a.binder,dic.name,ma.ma_code,user.user_name
FROM ma_machine_label b
@ -55,7 +55,9 @@
<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="wpName != null and wpName != ''"> and mt3.type_name = #{wpName}</if>
<if test="isBind != null and isBind != ''"> and b.is_bind = #{isBind}</if>
</where>
ORDER BY b.is_bind ASC
</select>
<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,
@ -106,7 +108,7 @@
<if test="binder != null">#{binder},</if>
<if test="labelType != null">#{labelType},</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>
</trim>
</insert>
@ -119,7 +121,7 @@
<if test="binder != null">binder,</if>
<if test="labelType != null">label_type,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -129,7 +131,7 @@
<if test="binder != null">#{binder},</if>
<if test="labelType != null">#{labelType},</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>
</trim>
</insert>
@ -161,12 +163,17 @@
</delete>
<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>
<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
where ma_code = #{maCode}
</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>

View File

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

View File

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

View File

@ -7,7 +7,7 @@ import lombok.Data;
* 修试入库-前端传参
*/
@Data
public class RepairTestInputDto {
public class RepairTestInputDto{
/** 任务id*/
private int taskId;
@ -18,4 +18,15 @@ public class RepairTestInputDto {
/** 状态*/
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
* @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
@Transactional(rollbackFor = Exception.class)
public AjaxResult inputByType(String params) {
public AjaxResult inputByType(RepairTestInputDto repairTestInputDto) {
try {
if (StringUtils.isEmpty(params)) {
if (StringUtils.isEmpty(repairTestInputDto.getParams())) {
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)){
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 != ''">
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
</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
</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 ANY_VALUE(rid.task_id) AS id,
ANY_VALUE(tt2.`code`) AS repairCode,
ANY_VALUE(GROUP_CONCAT(a.typeName)) AS maTypeName,
ANY_VALUE(tt2.create_by) AS wxName,
ANY_VALUE(tt2.create_time) AS wxTime,
ANY_VALUE(IFNULL(sd.`name`,'入库进行中')) AS taskStatus
FROM repair_input_details rid
LEFT JOIN tm_task tt ON rid.task_id = tt.task_id
LEFT JOIN sys_dic sd ON tt.task_status = sd.id
LEFT JOIN tm_task tt2 ON rid.repair_id = tt2.task_id
LEFT JOIN (
SELECT mt.type_id,mt3.type_name AS typeName,mt.manage_type
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.type_id
SELECT b.id,
b.repairCode,
b.maTypeName,
b.wxName,
b.wxTime,
b.taskStatus
FROM (
SELECT ANY_VALUE(rid.task_id) AS id,
ANY_VALUE(tt2.`code`) AS repairCode,
ANY_VALUE(GROUP_CONCAT(DISTINCT a.typeName2)) AS maTypeName,
ANY_VALUE(GROUP_CONCAT(DISTINCT a.typeId2)) AS typeId2,
ANY_VALUE(tt2.create_by) AS wxName,
ANY_VALUE(tt2.create_time) AS wxTime,
ANY_VALUE(IFNULL(sd.`name`,'入库进行中')) AS taskStatus
FROM repair_input_details rid
LEFT JOIN tm_task tt ON rid.task_id = tt.task_id
LEFT JOIN sys_dic sd ON tt.task_status = sd.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>
<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!=''">
(
INSTR(tt.`code`,#{keyWord}) > 0 OR
INSTR(tt2.create_by,#{keyWord}) > 0
)
AND (
INSTR(b.repairCode,#{keyWord}) > 0 OR
INSTR(b.wxName,#{keyWord}) > 0
)
</if>
</where>
GROUP BY rid.task_id
ORDER BY tt.create_time DESC
</select>
<!--获取修试后入库-详情列表-->
<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
LEFT JOIN ma_machine mm ON rid.ma_id = mm.ma_id
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
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.type_id
)a ON rid.type_id = a.typeId
WHERE rid.task_id = #{taskId}
<if test="keyWord!=null and keyWord!=''">
AND (
INSTR(a.typeName,#{keyWord}) > 0 OR
INSTR(a.typeName2,#{keyWord}) > 0
INSTR(rid.update_by,#{keyWord}) > 0 OR
INSTR(mm.ma_code,#{keyWord}) > 0
)
</if>
<if test="status!=null and status!=''">
AND rid.status = #{status}
<if test="deviceTypeId!=null and deviceTypeId!=''">
AND a.typeId2 = #{deviceTypeId}
</if>
<if test="typeId!=null and typeId!=''">
AND a.typeId = #{typeId}
</if>
ORDER BY rid.create_time DESC
</select>