功能优化
This commit is contained in:
parent
0e7e6dc5b0
commit
5c540d2cf1
|
|
@ -245,6 +245,17 @@ public class MaterialLeaseInfoController extends BaseController {
|
|||
return materialLeaseInfoService.getInfoByQrcode(bmQrcodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* OCR出库:根据code查询在库机具信息
|
||||
* @param bmQrcodeInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "根据code查询在库机具信息")
|
||||
@GetMapping("/getInfoByCode")
|
||||
public AjaxResult getInfoByCode(BmQrcodeInfo bmQrcodeInfo) {
|
||||
return materialLeaseInfoService.getInfoByCode(bmQrcodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* app领料出库提交
|
||||
* @param leaseApplyDetails
|
||||
|
|
|
|||
|
|
@ -357,4 +357,18 @@ public interface MaterialLeaseInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
List<Long> getTaskIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* ocr出库:根据code查询在库机具信息
|
||||
* @param bmQrcodeInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOutDetails> getMaCodeList(BmQrcodeInfo bmQrcodeInfo);
|
||||
|
||||
/**
|
||||
* ocr出库:根据code查询在库机具信息
|
||||
* @param bmQrcodeInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOutDetails> getInfoByCode(BmQrcodeInfo bmQrcodeInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,4 +152,10 @@ public interface MaterialLeaseInfoService {
|
|||
*/
|
||||
AjaxResult getPickList(MaterialLeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* OCR出库:根据code查询在库机具信息
|
||||
* @param bmQrcodeInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getInfoByCode(BmQrcodeInfo bmQrcodeInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -204,7 +204,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -572,7 +572,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -231,7 +231,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getAllProjectList(departId);
|
||||
if (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -784,7 +784,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -1232,7 +1232,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -1607,6 +1607,35 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OCR出库:根据code查询在库机具信息
|
||||
* @param bmQrcodeInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getInfoByCode(BmQrcodeInfo bmQrcodeInfo) {
|
||||
if (StringUtils.isBlank(bmQrcodeInfo.getMaCode())) {
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "设备编码不能为空");
|
||||
}
|
||||
// 根据Code查询数据
|
||||
List<LeaseOutDetails> clzList = materialLeaseInfoMapper.getMaCodeList(bmQrcodeInfo);
|
||||
List<LeaseOutDetails> recordList = materialLeaseInfoMapper.getInfoByCode(bmQrcodeInfo);
|
||||
// 判断是否符合出库条件(假设业务规则是:clzList为空且recordList不为空)
|
||||
boolean isValid = CollectionUtil.isEmpty(clzList) && CollectionUtil.isNotEmpty(recordList);
|
||||
// 构建结果消息
|
||||
String msg = isValid
|
||||
? "监测到" + bmQrcodeInfo.getQrCode() + "符合出库条件,请确认是否出库!"
|
||||
: "监测到" + bmQrcodeInfo.getQrCode() + "编码不符合出库条件,请检查后重新提交!";
|
||||
if (!isValid) {
|
||||
recordList = new ArrayList<>();
|
||||
}
|
||||
// 返回包含设备列表和消息的结果
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
result.put("recordList", recordList);
|
||||
result.put("msg", msg);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入领料任务
|
||||
* @param createBy
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -155,7 +155,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -306,7 +306,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -381,7 +381,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
@ -464,8 +464,8 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
if (StringUtils.isBlank(departId)) {
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
if (CollectionUtils.isEmpty(departId)) {
|
||||
return new MaterialRetainedEquipmentInfo();
|
||||
}
|
||||
// 根据项目部id查询工程信息
|
||||
|
|
@ -619,10 +619,10 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
public List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<MaterialRetainedTeamTotalVo> teamNumList = materialMachineMapper.getTeamNumList(bean);
|
||||
if (StringUtils.isNotBlank(departId)) {
|
||||
if (CollectionUtils.isEmpty(departId)) {
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
List<BmProject> list = mapper.getProjectInfo(new BmProject());
|
||||
if (CollectionUtils.isNotEmpty(list) && CollectionUtils.isNotEmpty(projectIdList)) {
|
||||
|
|
@ -723,8 +723,8 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
public AjaxResult getAgreementId(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
if (StringUtils.isBlank(departId)) {
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
if (CollectionUtils.isEmpty(departId)) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
// 根据项目部id查询工程信息
|
||||
|
|
@ -769,7 +769,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.bonus.material.common.domain.dto.SelectDto;
|
|||
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||
import com.bonus.material.common.domain.vo.SelectVo;
|
||||
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -247,14 +248,14 @@ public interface SelectMapper {
|
|||
* @param username
|
||||
* @return
|
||||
*/
|
||||
String getDepartId(String username);
|
||||
List<String> getDepartId(String username);
|
||||
|
||||
/**
|
||||
* 根据项目部id查询工程信息
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
List<String> getProjectId(String departId);
|
||||
List<String> getProjectId(@Param("list") List<String> departId);
|
||||
|
||||
/**
|
||||
* 获取材料站退料往来单位id和标段工程id获取协议信息
|
||||
|
|
@ -321,12 +322,12 @@ public interface SelectMapper {
|
|||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
List<String> getAllProjectList(String departId);
|
||||
List<String> getAllProjectList(@Param("list") List<String> departId);
|
||||
|
||||
/**
|
||||
* 获取在建工程信息
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
List<String> getInProject(String departId);
|
||||
List<String> getInProject(@Param("list") List<String> departId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ public class SelectServiceImpl implements SelectService {
|
|||
public AjaxResult getProjectInfo(BmProject bmProject) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
List<String> departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
List<BmProject> list = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
try {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = selectMapper.getDepartId(username);
|
||||
List<String> departId = selectMapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
if (StringUtils.isNotBlank(departId)) {
|
||||
if (!CollectionUtils.isEmpty(departId)) {
|
||||
List<String> projectIdList = selectMapper.getAllProjectList(departId);
|
||||
if (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
leaseApplyInfo.setProjectIdList(projectIdList);
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
where
|
||||
bu.type_id = '36'
|
||||
bu.type_id in (32, 36)
|
||||
AND bp.pro_id = #{proId}
|
||||
AND sai.`status` = '0' and mm.qr_code = #{qrCode}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
|
|
@ -1211,4 +1211,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getMaCodeList" resultType="com.bonus.common.biz.domain.lease.LeaseOutDetails">
|
||||
SELECT
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
mm.type_id as typeId,
|
||||
mm.qr_code as qrCode,
|
||||
mt.manage_type as manageType
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN clz_slt_agreement_info sai ON mm.ma_id = sai.ma_id
|
||||
and mm.type_id = sai.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'
|
||||
where
|
||||
sai.status = '0'
|
||||
AND mm.ma_code = #{maCode}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND mt.type_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getInfoByCode" resultType="com.bonus.common.biz.domain.lease.LeaseOutDetails">
|
||||
SELECT
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
mm.type_id as typeId,
|
||||
'1' as maStatus,
|
||||
mm.qr_code as qrCode,
|
||||
'在库' as statusName,
|
||||
mt.manage_type as manageType
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN slt_agreement_info sai ON mm.ma_id = sai.ma_id
|
||||
AND mm.type_id = sai.type_id
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_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'
|
||||
where
|
||||
bu.type_id in (32, 36)
|
||||
AND bp.pro_id = #{proId}
|
||||
AND sai.`status` = '0'
|
||||
AND mm.ma_code like concat('%',#{maCode},'%')
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND mt.type_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -606,9 +606,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
`data_center`.dx_fb_son
|
||||
WHERE
|
||||
project_status in ('在建', '开工准备')
|
||||
<if test="departId != null and departId != ''">
|
||||
AND project_dept_id = #{departId}
|
||||
</if>
|
||||
<if test="list != null and list.size > 0">
|
||||
AND project_dept_id IN
|
||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getAgreementInfoByIdBack" resultType="com.bonus.material.common.domain.vo.AgreementVo">
|
||||
|
|
@ -1016,8 +1019,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
`data_center`.dx_fb_son
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="departId != null and departId != ''">
|
||||
AND project_dept_id = #{departId}
|
||||
<if test="list != null and list.size > 0">
|
||||
AND project_dept_id IN
|
||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getInProject" resultType="java.lang.String">
|
||||
|
|
@ -1027,8 +1033,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
`data_center`.dx_fb_son
|
||||
WHERE
|
||||
project_status in ('在建')
|
||||
<if test="departId != null and departId != ''">
|
||||
AND project_dept_id = #{departId}
|
||||
<if test="list != null and list.size > 0">
|
||||
AND project_dept_id IN
|
||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue