退料接收问题修复
This commit is contained in:
parent
54b97f181a
commit
7cd4c29ee5
|
|
@ -263,6 +263,30 @@ public class BackApplyInfoController extends BaseController {
|
|||
return backApplyInfoService.getMachine(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* app根据设备编码去检索领料详情
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "app编码检索第二种")
|
||||
// @RequiresPermissions("back:info:list")
|
||||
@GetMapping("/getMachineTwo")
|
||||
public AjaxResult getMachineTwo(BackApplyInfo dto){
|
||||
return backApplyInfoService.getMachineTwo(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* app根据设备编码去检索领料详情
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "app编码检索第二种下拉")
|
||||
// @RequiresPermissions("back:info:list")
|
||||
@GetMapping("/getMachineTwoList")
|
||||
public AjaxResult getMachineTwoList(BackApplyInfo dto){
|
||||
return backApplyInfoService.getMachineTwoList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* app根据设备编码去检索退料工程
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -583,4 +583,18 @@ public interface BackApplyInfoMapper {
|
|||
List<SltAgreementInfo> getXmInfoList(BackApplyInfo bean);
|
||||
|
||||
List<BackApplyQuery> selectBackApplyQueryList(BackApplyQuery backApplyQuery);
|
||||
|
||||
List<MaCodeVo> getMachineByMaCode(BackApplyInfo dto);
|
||||
|
||||
List<MaCodeVo> getMachineByMaId(BackApplyInfo dto);
|
||||
|
||||
List<MaCodeVo> getMachineByMaIdThree(BackApplyInfo dto);
|
||||
|
||||
List<MaCodeVo> getMachineByByMaIdFour(BackApplyInfo dto);
|
||||
|
||||
MaCodeVo getMachineProId(BackApplyInfo dto);
|
||||
|
||||
MaCodeVo getMachineByMaIdOne(BackApplyInfo dto);
|
||||
|
||||
MaCodeVo getMachineByQrCodeOne(BackApplyInfo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,20 @@ public interface IBackApplyInfoService {
|
|||
*/
|
||||
AjaxResult getMachine(BackApplyInfo dto);
|
||||
|
||||
/**
|
||||
* app编码检索
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getMachineTwo(BackApplyInfo dto);
|
||||
|
||||
/**
|
||||
* app编码检索
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getMachineTwoList(BackApplyInfo dto);
|
||||
|
||||
/**
|
||||
* app查询单个类型设备编码
|
||||
* @param backApplyInfo
|
||||
|
|
|
|||
|
|
@ -1890,6 +1890,142 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
return AjaxResult.error(HttpCodeEnum.SYSTEM_ERROR.getCode(), "检索为空或该设备非该单位和工程所领");
|
||||
}
|
||||
|
||||
/**
|
||||
* app编码检索
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getMachineTwo(BackApplyInfo dto) {
|
||||
//判断输入或者编码识别或者二维码识别是否为领料工程和单位对应
|
||||
List<MaCodeVo> list = new ArrayList<>();
|
||||
dto.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
if (dto.getMaCode() != null) {
|
||||
// 判断是否有这个设备编码
|
||||
List<MaCodeVo> listOneMaCode = backApplyInfoMapper.getMachineByMaCode(dto);
|
||||
if(CollectionUtils.isEmpty(listOneMaCode)){
|
||||
return AjaxResult.error("该设备编码不存在,请重新选择");
|
||||
}
|
||||
if(listOneMaCode.size()==1){
|
||||
dto.setMaId(listOneMaCode.get(0).getMaId());
|
||||
// 判断是否属于该工程
|
||||
MaCodeVo vo = backApplyInfoMapper.getMachineByMaIdOne(dto);
|
||||
if(vo!=null && !Objects.equals(vo.getProId(), dto.getProId())){
|
||||
return AjaxResult.error("该设备编码非该单位工程下的设备,单位:"+vo.getUnitName()+",工程:"+vo.getProName());
|
||||
}else if(vo == null){
|
||||
return AjaxResult.error("该设备编码不存在领用记录,请重新选择");
|
||||
}
|
||||
|
||||
|
||||
// 判断是否是在用状态
|
||||
List<MaCodeVo> listTwoMaCode = backApplyInfoMapper.getMachineByMaId(dto);
|
||||
if(CollectionUtils.isEmpty(listTwoMaCode)){
|
||||
return AjaxResult.error("该设备编码非在用状态,请重新选择");
|
||||
}
|
||||
// 判断是否是当前人负责的设备
|
||||
List<MaCodeVo> listThreeMaCode = backApplyInfoMapper.getMachineByMaIdThree(dto);
|
||||
if (CollectionUtils.isEmpty(listThreeMaCode)) {
|
||||
return AjaxResult.error("该设备编码非您负责的设备,请重新选择");
|
||||
}
|
||||
// 判断是否是当前协议下的设备
|
||||
list = backApplyInfoMapper.getMachineByByMaIdFour(dto);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return AjaxResult.error("该设备编码非当前协议下的设备,请重新选择");
|
||||
}
|
||||
|
||||
}else{
|
||||
list.addAll(listOneMaCode);
|
||||
}
|
||||
|
||||
} else if (dto.getQrCode() != null) {
|
||||
// 判断是否有这个二维码
|
||||
MaCodeVo voOne = backApplyInfoMapper.getMachineByQrCodeOne(dto);
|
||||
if(voOne ==null){
|
||||
return AjaxResult.error("该二维码不存在,请重新选择");
|
||||
}
|
||||
dto.setMaId(voOne.getMaId());
|
||||
// 判断是否属于该工程
|
||||
MaCodeVo vo = backApplyInfoMapper.getMachineByMaIdOne(dto);
|
||||
if(vo!=null && (!Objects.equals(vo.getProId(), dto.getProId()) || !Objects.equals(vo.getUnitId(), dto.getUnitId()))){
|
||||
return AjaxResult.error("该设备编码非该单位工程下的设备,单位:"+vo.getUnitName()+",工程:"+vo.getProName());
|
||||
}else if(vo == null){
|
||||
return AjaxResult.error("该设备编码不存在领用记录,请重新选择");
|
||||
}
|
||||
// 判断是否是在用状态
|
||||
List<MaCodeVo> listTwoMaCode = backApplyInfoMapper.getMachineByMaId(dto);
|
||||
if(CollectionUtils.isEmpty(listTwoMaCode)){
|
||||
return AjaxResult.error("该设备编码非在用状态,请重新选择");
|
||||
}
|
||||
// 判断是否是当前人负责的设备
|
||||
List<MaCodeVo> listThreeMaCode = backApplyInfoMapper.getMachineByMaIdThree(dto);
|
||||
if (CollectionUtils.isEmpty(listThreeMaCode)) {
|
||||
return AjaxResult.error("该设备编码非您负责的设备,请重新选择");
|
||||
}
|
||||
// 判断是否是当前协议下的设备
|
||||
list = backApplyInfoMapper.getMachineByByMaIdFour(dto);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return AjaxResult.error("该设备编码非当前协议下的设备,请重新选择");
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (MaCodeVo maCodeVo : list) {
|
||||
Map<String, String> maMachineMap = remoteConfig.getDictValue("ma_machine_status");
|
||||
String name = maMachineMap.get(maCodeVo.getMaStatus());
|
||||
maCodeVo.setMaStatusName(StringUtils.isBlank(name) ? "" : name);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
return AjaxResult.error(HttpCodeEnum.SYSTEM_ERROR.getCode(), "检索为空或该设备非该单位和工程所领");
|
||||
}
|
||||
|
||||
/**
|
||||
* app编码检索
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getMachineTwoList(BackApplyInfo dto) {
|
||||
//判断输入或者编码识别或者二维码识别是否为领料工程和单位对应
|
||||
List<MaCodeVo> list = new ArrayList<>();
|
||||
dto.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
if (dto.getMaId() != null) {
|
||||
// 判断是否属于该工程
|
||||
MaCodeVo vo = backApplyInfoMapper.getMachineByMaIdOne(dto);
|
||||
if(vo!=null && !Objects.equals(vo.getProId(), dto.getProId())){
|
||||
return AjaxResult.error("该设备编码非该工程下的设备,为"+vo.getProName()+"的设备");
|
||||
}else if(vo == null){
|
||||
return AjaxResult.error("该设备编码不存在领用记录,请重新选择");
|
||||
}
|
||||
|
||||
|
||||
// 判断是否是在用状态
|
||||
List<MaCodeVo> listTwoMaCode = backApplyInfoMapper.getMachineByMaId(dto);
|
||||
if(CollectionUtils.isEmpty(listTwoMaCode)){
|
||||
return AjaxResult.error("该设备编码非在用状态,请重新选择");
|
||||
}
|
||||
// 判断是否是当前人负责的设备
|
||||
List<MaCodeVo> listThreeMaCode = backApplyInfoMapper.getMachineByMaIdThree(dto);
|
||||
if (CollectionUtils.isEmpty(listThreeMaCode)) {
|
||||
return AjaxResult.error("该设备编码非您负责的设备,请重新选择");
|
||||
}
|
||||
// 判断是否是当前协议下的设备
|
||||
list = backApplyInfoMapper.getMachineByByMaIdFour(dto);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return AjaxResult.error("该设备编码非当前协议下的设备,请重新选择");
|
||||
}
|
||||
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (MaCodeVo maCodeVo : list) {
|
||||
Map<String, String> maMachineMap = remoteConfig.getDictValue("ma_machine_status");
|
||||
String name = maMachineMap.get(maCodeVo.getMaStatus());
|
||||
maCodeVo.setMaStatusName(StringUtils.isBlank(name) ? "" : name);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
return AjaxResult.error(HttpCodeEnum.SYSTEM_ERROR.getCode(), "检索为空或该设备非该单位和工程所领");
|
||||
}
|
||||
|
||||
/**
|
||||
* app查询单个类型设备编码
|
||||
* @param backApplyInfo
|
||||
|
|
|
|||
|
|
@ -2015,5 +2015,210 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
or mt.type_name like concat('%', #{keyWord} ,'%'))
|
||||
</if>
|
||||
</select>
|
||||
<select id="getMachineByMaCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
WHERE
|
||||
mm.ma_code = #{maCode}
|
||||
</select>
|
||||
<select id="getMachineByMaId" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType,
|
||||
ba.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
ba.project_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
ba.agreement_id AS agreementId
|
||||
FROM slt_agreement_info sai
|
||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
WHERE sai.`status`=0 and mm.ma_status = '2'
|
||||
and mm.ma_id = #{maId}
|
||||
</select>
|
||||
<select id="getMachineByMaIdThree" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType,
|
||||
ba.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
ba.project_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
ba.agreement_id AS agreementId
|
||||
FROM slt_agreement_info sai
|
||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
WHERE sai.`status`= 0
|
||||
and sai.is_slt = '0'
|
||||
and mm.ma_status = '2'
|
||||
and mtr.user_id = #{userId}
|
||||
and mm.ma_id = #{maId}
|
||||
</select>
|
||||
<select id="getMachineByByMaIdFour" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType,
|
||||
ba.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
ba.project_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
ba.agreement_id AS agreementId
|
||||
FROM slt_agreement_info sai
|
||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
WHERE sai.`status`= 0
|
||||
and sai.is_slt = '0'
|
||||
and mm.ma_status = '2'
|
||||
and mtr.user_id = #{userId}
|
||||
and mm.ma_id = #{maId}
|
||||
AND ba.unit_id = #{unitId}
|
||||
AND ba.project_id = #{proId}
|
||||
</select>
|
||||
<select id="getMachineProId" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType,
|
||||
ba.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
ba.project_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
ba.agreement_id AS agreementId
|
||||
FROM slt_agreement_info sai
|
||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
WHERE sai.`status`= 0
|
||||
and sai.is_slt = '0'
|
||||
and mm.ma_status = '2'
|
||||
and mm.ma_id = #{maId}
|
||||
</select>
|
||||
<select id="getMachineByMaIdOne" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType,
|
||||
ba.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
ba.project_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
ba.agreement_id AS agreementId
|
||||
FROM slt_agreement_info sai
|
||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
WHERE sai.`status`=0
|
||||
and mm.ma_id = #{maId}
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getMachineByQrCodeOne" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT mm.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_status AS maStatus,
|
||||
mt1.type_name AS typeName,
|
||||
mm.type_id AS typeId,
|
||||
mt.type_name AS materialName,
|
||||
mt2.type_name AS materialType
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||
AND mt2.del_flag = '0'
|
||||
|
||||
WHERE
|
||||
mm.qr_code = #{qrCode}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue