修试入库
This commit is contained in:
parent
fad9414a7b
commit
92f726fee7
|
|
@ -74,9 +74,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
/*入库*/
|
/*入库*/
|
||||||
<if test="type == 2">
|
<if test="type == 2">
|
||||||
SELECT mir.input_num,
|
SELECT iad.input_num,
|
||||||
a.typeName
|
a.typeName
|
||||||
FROM ma_input_record mir
|
FROM input_apply_details iad
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT mt.type_id,mt4.type_name AS typeName
|
SELECT mt.type_id,mt4.type_name AS typeName
|
||||||
FROM ma_type mt
|
FROM ma_type mt
|
||||||
|
|
@ -84,8 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
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 mir.type_id = a.type_id
|
)a ON iad.type_id = a.type_id
|
||||||
WHERE mir.create_time BETWEEN CONCAT(#{startDate}, ' 00:00:00') AND CONCAT(#{endDate}, ' 23:59:59') AND mir.input_type = '1'
|
WHERE iad.create_time BETWEEN CONCAT(#{startDate}, ' 00:00:00') AND CONCAT(#{endDate}, ' 23:59:59') AND iad.input_type = '1'
|
||||||
<if test="maType!=null and maType == 1">
|
<if test="maType!=null and maType == 1">
|
||||||
AND a.typeName = #{maTypeName}
|
AND a.typeName = #{maTypeName}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,7 @@ public class RepairTestInputDto {
|
||||||
/** 关键字*/
|
/** 关键字*/
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
/** 状态*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import com.bonus.sgzb.material.domain.RepairTestWarehousingDto;
|
||||||
import com.bonus.sgzb.material.mapper.RepairTestInputMapper;
|
import com.bonus.sgzb.material.mapper.RepairTestInputMapper;
|
||||||
import com.bonus.sgzb.material.service.RepairTestInputService;
|
import com.bonus.sgzb.material.service.RepairTestInputService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
@ -52,6 +53,9 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
return AjaxResult.error(HttpStatus.ERROR, "参数类型不正确");
|
return AjaxResult.error(HttpStatus.ERROR, "参数类型不正确");
|
||||||
}
|
}
|
||||||
List<RepairTestWarehousingDto> list = JSONObject.parseArray(params, RepairTestWarehousingDto.class);
|
List<RepairTestWarehousingDto> list = JSONObject.parseArray(params, RepairTestWarehousingDto.class);
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
return AjaxResult.error(HttpStatus.ERROR, "参数类型不正确");
|
||||||
|
}
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||||
String updateTime = DateTimeHelper.getNowTime();
|
String updateTime = DateTimeHelper.getNowTime();
|
||||||
String updateBy = SecurityUtils.getLoginUser().getUsername();
|
String updateBy = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
|
@ -60,7 +64,7 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
dto.setUpdateTime(updateTime);
|
dto.setUpdateTime(updateTime);
|
||||||
dto.setUpdateBy(updateBy);
|
dto.setUpdateBy(updateBy);
|
||||||
if (Objects.equals("2", dto.getCheckType())) {
|
if (Objects.equals("2", dto.getCheckType())) {
|
||||||
// 审核不通过-入库数量修改为0
|
// 审核不通过-入库数量修改为 0
|
||||||
dto.setRepairNum("0");
|
dto.setRepairNum("0");
|
||||||
}
|
}
|
||||||
// 更新修试后入库数据
|
// 更新修试后入库数据
|
||||||
|
|
@ -80,10 +84,12 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
mapper.updateMaMachineStatus(dicId,dto.getMaId());
|
mapper.updateMaMachineStatus(dicId,dto.getMaId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RepairTestWarehousingDto dto = list.get(0);
|
||||||
// 查询修试后入库的状态是否全部更新、更新任务表状态
|
// 查询修试后入库的状态是否全部更新、更新任务表状态
|
||||||
Map<String, Object> numMap = mapper.getIsAllUpdate(dto);
|
Map<String, Object> numMap = mapper.getIsAllUpdate(dto);
|
||||||
// 总量、未审核数量、入库数量、驳回数量
|
// 总量、未审核数量、入库数量、驳回数量
|
||||||
int totalNum = Integer.parseInt(String.valueOf(numMap.get("num")));
|
int totalNum = Integer.parseInt(String.valueOf(numMap.get("totalNum")));
|
||||||
int noCheckNum = Integer.parseInt(String.valueOf(numMap.get("noCheckNum")));
|
int noCheckNum = Integer.parseInt(String.valueOf(numMap.get("noCheckNum")));
|
||||||
int passNum = Integer.parseInt(String.valueOf(numMap.get("passNum")));
|
int passNum = Integer.parseInt(String.valueOf(numMap.get("passNum")));
|
||||||
int noPassNum = Integer.parseInt(String.valueOf(numMap.get("noPassNum")));
|
int noPassNum = Integer.parseInt(String.valueOf(numMap.get("noPassNum")));
|
||||||
|
|
@ -94,7 +100,6 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
int dicId = mapper.getDicByMaStatusId("rk_task","入库驳回");
|
int dicId = mapper.getDicByMaStatusId("rk_task","入库驳回");
|
||||||
mapper.updateTmTaskStatus(dto,dicId);
|
mapper.updateTmTaskStatus(dto,dicId);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//手动回滚异常
|
//手动回滚异常
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
|
@ -118,7 +123,7 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
value = value.add(repairNumValue);
|
value = value.add(repairNumValue);
|
||||||
if (Objects.nonNull(num)) {
|
if (Objects.nonNull(num)) {
|
||||||
BigDecimal numValue = new BigDecimal(new Double(String.valueOf(num)).toString());
|
BigDecimal numValue = new BigDecimal(new Double(String.valueOf(num)).toString());
|
||||||
value.add(numValue);
|
value = value.add(numValue);
|
||||||
}
|
}
|
||||||
return value.doubleValue();
|
return value.doubleValue();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<set>
|
<set>
|
||||||
<if test="repairNum != null and repairNum != ''">input_num = #{repairNum},</if>
|
<if test="repairNum != null and repairNum != ''">input_num = #{repairNum},</if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null and updateTime != ''">update_time = #{status},</if>
|
<if test="updateTime != null and updateTime != ''">update_time = #{updateTime},</if>
|
||||||
<if test="checkType != null and checkType != ''">`status` = #{checkType},</if>
|
<if test="checkType != null and checkType != ''">`status` = #{checkType},</if>
|
||||||
<if test="remark != null and remark != ''">`remark` = #{remark}</if>
|
<if test="remark != null and remark != ''">`remark` = #{remark}</if>
|
||||||
</set>
|
</set>
|
||||||
|
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
<!--更新任务表状态-->
|
<!--更新任务表状态-->
|
||||||
<update id="updateTmTaskStatus">
|
<update id="updateTmTaskStatus">
|
||||||
UPDATE tm_task SET task_status = #{dictId} WHERE task_id = #{params.taskId}
|
UPDATE tm_task SET task_status = #{dictId},update_by = #{params.updateBy},update_time = #{params.updateTime} WHERE task_id = #{params.taskId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!--获取修试后入库列表-->
|
<!--获取修试后入库列表-->
|
||||||
|
|
@ -85,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY rid.task_id
|
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">
|
||||||
|
|
@ -117,6 +118,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
INSTR(a.typeName2,#{keyWord}) > 0
|
INSTR(a.typeName2,#{keyWord}) > 0
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="status!=null and status!=''">
|
||||||
|
AND rid.status = #{status}
|
||||||
|
</if>
|
||||||
|
ORDER BY rid.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
<!--查询机具类型-库存数量-->
|
<!--查询机具类型-库存数量-->
|
||||||
<select id="getMaTypeByNum" resultType="java.util.Map">
|
<select id="getMaTypeByNum" resultType="java.util.Map">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue