This commit is contained in:
parent
39f0b41bbb
commit
84da3532fc
|
|
@ -286,7 +286,7 @@ public class MaterialMachineController extends BaseController {
|
|||
}
|
||||
ExcelUtil<SafeMaterialEquipmentInfo> util = new ExcelUtil<>(SafeMaterialEquipmentInfo.class);
|
||||
// 获取当前年月日导出时间,用括号拼接在后面
|
||||
String title = "工器具预警记录" + "(导出时间:" + DateUtils.getTime() + ")";
|
||||
String title = "预警管理" + "(导出时间:" + DateUtils.getTime() + ")";
|
||||
util.exportExcel(response, list, fileName, title);
|
||||
}
|
||||
|
||||
|
|
@ -597,9 +597,10 @@ public class MaterialMachineController extends BaseController {
|
|||
@ApiOperation(value = "综合查询--材料站供应需求平衡数据在用二级页面查询")
|
||||
@GetMapping("/getUseDemandAndSupply")
|
||||
public AjaxResult getUseDemandAndSupply(MaterialRetainedEquipmentInfo bean) {
|
||||
startPage();
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<MaterialSecondInfo> list = materialMachineService.getUseDemandAndSupply(bean);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.clz.domain.direct;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
|
|
@ -21,7 +22,11 @@ public class WorkflowEvent {
|
|||
*/
|
||||
private final String backTeamId;
|
||||
|
||||
public WorkflowEvent(int taskId, String taskCode, int taskType, String projectName, int backAgreementId, String leaseMan, String backTeamId) {
|
||||
@ApiModelProperty(value = "领料工程id")
|
||||
private final String leaseProId;
|
||||
|
||||
public WorkflowEvent(int taskId, String taskCode, int taskType, String projectName, int backAgreementId, String leaseMan, String backTeamId,
|
||||
String leaseProId) {
|
||||
this.taskId = taskId;
|
||||
this.taskCode = taskCode;
|
||||
this.taskType = taskType;
|
||||
|
|
@ -29,6 +34,7 @@ public class WorkflowEvent {
|
|||
this.backAgreementId = backAgreementId;
|
||||
this.leaseMan = leaseMan;
|
||||
this.backTeamId = backTeamId;
|
||||
this.leaseProId = leaseProId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,4 +98,10 @@ public class MaterialStorageInfo {
|
|||
|
||||
@ApiModelProperty(value = "编码ID")
|
||||
private String maId;
|
||||
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private String manageType;
|
||||
|
||||
@ApiModelProperty(value = "是否分包直领标志(0 是 1 否)")
|
||||
private String subFlag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,4 +270,7 @@ public class MaterialRetainedEquipmentInfo {
|
|||
private String agreementIds;
|
||||
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty(value = "是否班组标志(0 是 1 否)")
|
||||
private String bzFlag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,4 +306,25 @@ public interface MaterialMachineMapper {
|
|||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getSubInfoList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 获取分包商需求量
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialSecondInfo> getSubDemandAndSupply(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 获取协议ID
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialProvideNumInfo> getSubAgreementIds(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 获取分包商库存量
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialStorageInfo> getSubList(MaterialStorageInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ public class ClzDirectServiceImpl implements ClzDirectService {
|
|||
}
|
||||
if (clzDirectApplyInfoVo.getDirectApplyInfo().getIsSubmit() != null && clzDirectApplyInfoVo.getDirectApplyInfo().getIsSubmit() == 1) {
|
||||
if (id != null && StringUtils.isNotBlank(leaseAgreementId) && StringUtils.isNotBlank(backAgreementId)) {
|
||||
addSysWorkflowRecord(new WorkflowEvent(id, code, TM_TASK_ZN_DIRECT.getTaskTypeId(), clzDirectApplyInfoVo.getDirectApplyInfo().getBackProName(), Integer.parseInt(clzDirectApplyInfoVo.getDirectApplyInfo().getBackAgreementIds()), leaseMan, clzDirectApplyInfoVo.getDirectApplyInfo().getBackTeamId()));
|
||||
addSysWorkflowRecord(new WorkflowEvent(id, code, TM_TASK_ZN_DIRECT.getTaskTypeId(), clzDirectApplyInfoVo.getDirectApplyInfo().getBackProName(), Integer.parseInt(clzDirectApplyInfoVo.getDirectApplyInfo().getBackAgreementIds()), leaseMan, clzDirectApplyInfoVo.getDirectApplyInfo().getBackTeamId(), clzDirectApplyInfoVo.getDirectApplyInfo().getLeaseProId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -392,7 +392,7 @@ public class ClzDirectServiceImpl implements ClzDirectService {
|
|||
|
||||
if (clzDirectApplyInfoVo.getDirectApplyInfo().getIsSubmit() != null && clzDirectApplyInfoVo.getDirectApplyInfo().getIsSubmit() == 1) {
|
||||
if (clzDirectApplyInfoVo.getDirectApplyInfo().getId() != null && StringUtils.isNotBlank(leaseAgreementId) && StringUtils.isNotBlank(backAgreementId)) {
|
||||
updateSysWorkflowRecord(new WorkflowEvent(clzDirectApplyInfoVo.getDirectApplyInfo().getId(), clzDirectApplyInfoVo.getDirectApplyInfo().getCode(), TM_TASK_ZN_DIRECT.getTaskTypeId(), clzDirectApplyInfoVo.getDirectApplyInfo().getBackProName(), Integer.parseInt(clzDirectApplyInfoVo.getDirectApplyInfo().getBackAgreementIds()), null, clzDirectApplyInfoVo.getDirectApplyInfo().getBackTeamId()));
|
||||
updateSysWorkflowRecord(new WorkflowEvent(clzDirectApplyInfoVo.getDirectApplyInfo().getId(), clzDirectApplyInfoVo.getDirectApplyInfo().getCode(), TM_TASK_ZN_DIRECT.getTaskTypeId(), clzDirectApplyInfoVo.getDirectApplyInfo().getBackProName(), Integer.parseInt(clzDirectApplyInfoVo.getDirectApplyInfo().getBackAgreementIds()), null, clzDirectApplyInfoVo.getDirectApplyInfo().getBackTeamId(), clzDirectApplyInfoVo.getDirectApplyInfo().getLeaseProId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -453,7 +453,7 @@ public class ClzDirectServiceImpl implements ClzDirectService {
|
|||
sysWorkflowRecordHistory.setIsAccept(1);
|
||||
sysWorkflowRecordHistory.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
sysWorkflowRecordHistory.setCreateTime(DateUtils.getNowDate());
|
||||
//根据单位id获取退料班组长身份证号
|
||||
/*//根据单位id获取退料班组长身份证号
|
||||
List<WorkPeopleInfo> userList = directAuditMapper.getProjectId(event.getBackTeamId());
|
||||
if (CollectionUtils.isNotEmpty(userList)) {
|
||||
String userIds = userList.stream().map(WorkPeopleInfo::getUserId).map(String::valueOf).collect(Collectors.joining(","));
|
||||
|
|
@ -461,6 +461,25 @@ public class ClzDirectServiceImpl implements ClzDirectService {
|
|||
} else {
|
||||
directAuditMapper.deleteWorkflowRecord(newId);
|
||||
log.info("退料班组的班组长账号不存在");
|
||||
}*/
|
||||
//根据project_id获取external_id
|
||||
List<WorkPeopleInfo> userList = new ArrayList<>();
|
||||
String externalId = directAuditMapper.getExternalId(Integer.parseInt(event.getLeaseProId()));
|
||||
if (externalId != null && !externalId.isEmpty()) {
|
||||
//获取项目总工id
|
||||
String leaderId = directAuditMapper.getDeptId(externalId);
|
||||
//获取项目总工账号
|
||||
String leaderAccount = directAuditMapper.getUserNameById(leaderId);
|
||||
if (leaderAccount != null && !leaderAccount.isEmpty()) {
|
||||
userList = directAuditMapper.getUserIdByUserName(leaderAccount);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(userList)) {
|
||||
String userIds = userList.stream().map(WorkPeopleInfo::getUserId).map(String::valueOf).collect(Collectors.joining(","));
|
||||
sysWorkflowRecordHistory.setDirectUserIds(userIds);
|
||||
} else {
|
||||
directAuditMapper.deleteWorkflowRecord(newId);
|
||||
log.info("项目总工账号不存在");
|
||||
}
|
||||
}
|
||||
// 先根据id查询该数据是否已经存在
|
||||
if (recordInfo != null) {
|
||||
|
|
@ -734,24 +753,14 @@ public class ClzDirectServiceImpl implements ClzDirectService {
|
|||
sysWorkflowNodeList.get(i).setNextNodeId(null);
|
||||
sysWorkflowNodeList.get(i).setNextRoleIds(null);
|
||||
}
|
||||
//根据领料单位id获取退料班组长身份证号
|
||||
//根据领料单位id获取转出班组长身份证号
|
||||
if (history.getNextNodeId() != null && history.getNextNodeId() == 43) {
|
||||
userList = directAuditMapper.getProjectId(directApplyInfo.getBackTeamId());
|
||||
}
|
||||
// 转入方班组长审核
|
||||
if (history.getNextNodeId() != null && history.getNextNodeId() == 44) {
|
||||
userList = directAuditMapper.getProjectId(directApplyInfo.getLeaseTeamId());
|
||||
}
|
||||
// 项目经理审核
|
||||
/*if (history.getNextNodeId() != null && history.getNextNodeId() == 44) {
|
||||
//根据project_id获取external_id
|
||||
String externalId = directAuditMapper.getExternalId(Integer.parseInt(directApplyInfo.getLeaseProId()));
|
||||
if (externalId != null && !externalId.isEmpty()) {
|
||||
//获取项目经理id
|
||||
String leaderId = directAuditMapper.getDeptId(externalId);
|
||||
//获取项目经理账号
|
||||
String leaderAccount = directAuditMapper.getUserNameById(leaderId);
|
||||
if (leaderAccount != null && !leaderAccount.isEmpty()) {
|
||||
userList = directAuditMapper.getUserIdByUserName(leaderAccount);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
String userIds = userList.stream().map(WorkPeopleInfo::getUserId).map(String::valueOf).collect(Collectors.joining(","));
|
||||
history.setDirectUserIds(userIds);
|
||||
history.setRemark(directApplyInfo.getRemark());
|
||||
|
|
@ -1221,11 +1230,27 @@ public class ClzDirectServiceImpl implements ClzDirectService {
|
|||
sysWorkflowRecordHistory.setIsAccept(1);
|
||||
sysWorkflowRecordHistory.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
sysWorkflowRecordHistory.setCreateTime(DateUtils.getNowDate());
|
||||
//根据单位id获取退料班组长身份证号
|
||||
/*//根据单位id获取退料班组长身份证号
|
||||
List<WorkPeopleInfo> userList = directAuditMapper.getProjectId(event.getBackTeamId());
|
||||
if (CollectionUtils.isNotEmpty(userList)) {
|
||||
String userIds = userList.stream().map(WorkPeopleInfo::getUserId).map(String::valueOf).collect(Collectors.joining(","));
|
||||
sysWorkflowRecordHistory.setDirectUserIds(userIds);
|
||||
}*/
|
||||
//根据project_id获取external_id
|
||||
List<WorkPeopleInfo> userList = new ArrayList<>();
|
||||
String externalId = directAuditMapper.getExternalId(Integer.parseInt(event.getLeaseProId()));
|
||||
if (externalId != null && !externalId.isEmpty()) {
|
||||
//获取项目总工id
|
||||
String leaderId = directAuditMapper.getDeptId(externalId);
|
||||
//获取项目总工账号
|
||||
String leaderAccount = directAuditMapper.getUserNameById(leaderId);
|
||||
if (leaderAccount != null && !leaderAccount.isEmpty()) {
|
||||
userList = directAuditMapper.getUserIdByUserName(leaderAccount);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(userList)) {
|
||||
String userIds = userList.stream().map(WorkPeopleInfo::getUserId).map(String::valueOf).collect(Collectors.joining(","));
|
||||
sysWorkflowRecordHistory.setDirectUserIds(userIds);
|
||||
}
|
||||
}
|
||||
sysWorkflowRecordHistoryMapper.addSysWorkflowRecordHistory(sysWorkflowRecordHistory);
|
||||
|
||||
|
|
|
|||
|
|
@ -262,15 +262,29 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.isNotBlank(bean.getSubFlag()) && "0".equals(bean.getSubFlag())) {
|
||||
list = materialMachineMapper.getSubList(bean);
|
||||
for (MaterialStorageInfo useStorageInfo : list) {
|
||||
// 查询出库信息
|
||||
if (useStorageInfo.getLeaseId() != null) {
|
||||
MaterialStorageInfo dto = materialMachineMapper.selectInFo(useStorageInfo);
|
||||
if (dto != null) {
|
||||
useStorageInfo.setInputUser(dto.getInputUser());
|
||||
useStorageInfo.setInputTime(dto.getInputTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
list = materialMachineMapper.getMaCodeList(bean);
|
||||
List<MaterialStorageInfo> useList = materialMachineMapper.getMaCodeDetails(bean);
|
||||
if (CollectionUtils.isNotEmpty(useList)) {
|
||||
if ("0".equals(bean.getManageType())) {
|
||||
if (CollectionUtils.isNotEmpty(list) && CollectionUtils.isNotEmpty(useList)) {
|
||||
// 将list中存在于useList中的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> useList.stream().noneMatch(useItem -> useItem.getMaId().equals(item.getMaId())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
for (MaterialStorageInfo useStorageInfo : list) {
|
||||
// 查询出库信息
|
||||
if (useStorageInfo.getLeaseId() != null) {
|
||||
|
|
@ -1366,6 +1380,17 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (CollectionUtils.isEmpty(recordList)) {
|
||||
return recordList;
|
||||
}
|
||||
// 获取所有领料未结算协议id
|
||||
List<MaterialProvideNumInfo> subAgreementIds = materialMachineMapper.getSubAgreementIds(bean);
|
||||
|
||||
// 查询分包商领用数据,不作为库存,作为再用数据
|
||||
List<MaterialRetainedEquipmentInfo> subList = materialMachineMapper.getSubInfoList(bean);
|
||||
// 根据工程id获取分包的在用数量,存储在map集合中
|
||||
Map<String, BigDecimal> subMap = new HashMap<>();
|
||||
subList.forEach(info -> {
|
||||
String key = getCompositeKey(info.getProId(), info.getTypeId());
|
||||
subMap.putIfAbsent(key, info.getAllNum());
|
||||
});
|
||||
|
||||
// 1. 过滤数据(并行流加速大集合过滤)
|
||||
if (teamData != null) {
|
||||
|
|
@ -1375,7 +1400,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}
|
||||
|
||||
// 2. 转换参数:将agreementIds(逗号字符串)转为List<String>
|
||||
List<Map<String, Object>> queryParams = recordList.stream()
|
||||
List<Map<String, Object>> queryParams = subAgreementIds.stream()
|
||||
.map(record -> {
|
||||
Map<String, Object> param = new HashMap<>(3);
|
||||
param.put("proId", record.getProId());
|
||||
|
|
@ -1407,7 +1432,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
List<Map<String, Object>> subParams = queryParams.subList(start, end);
|
||||
|
||||
// 分批查询
|
||||
// 领料需求量
|
||||
List<MaterialProvideNumInfo> batchResult = materialMachineMapper.batchQueryLeaseDemand(subParams);
|
||||
// 领用需求量
|
||||
List<MaterialProvideNumInfo> useDemandList = materialMachineMapper.batchQueryUseDemand(subParams);
|
||||
// 合并两个集合(顺序:先使用需求,再租赁需求,与原逻辑保持一致)
|
||||
List<MaterialProvideNumInfo> mergedList = new ArrayList<>(batchResult);
|
||||
|
|
@ -1416,11 +1443,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
// 统一处理合并后的集合,按原逻辑存入Map(保留第一个出现的key)
|
||||
mergedList.forEach(info -> {
|
||||
String key = getCompositeKey(info.getProId(), info.getTypeId());
|
||||
leaseBusinessMap.putIfAbsent(key, info.getBusinessNum());
|
||||
// 存在则累加后放入(注意处理可能的null,这里假设info.getBusinessNum()不为null)
|
||||
leaseBusinessMap.merge(key, info.getBusinessNum(), BigDecimal::add);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 4. 并行流处理大集合,计算总和并设置record的businessNum(内存操作并行化)
|
||||
// 用数组存储四个总和(比对象更高效,减少gc)
|
||||
BigDecimal[] totals = new BigDecimal[4];
|
||||
|
|
@ -1430,6 +1457,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
String key = getCompositeKey(record.getProId(), record.getTypeId());
|
||||
// 从Map获取数据(默认0,避免null)
|
||||
BigDecimal businessNum = leaseBusinessMap.getOrDefault(key, BigDecimal.ZERO);
|
||||
// 从subMap获取在用数量
|
||||
BigDecimal useNum = subMap.getOrDefault(key, BigDecimal.ZERO);
|
||||
// 追加在用数量给实际供应数量和已有在用数量
|
||||
record.setSupplyNum(record.getSupplyNum().add(useNum));
|
||||
record.setUseNum(record.getUseNum().add(useNum));
|
||||
|
||||
// 设置record的businessNum(原逻辑保留)
|
||||
record.setBusinessNum(businessNum);
|
||||
|
|
@ -1478,7 +1510,14 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
*/
|
||||
@Override
|
||||
public List<MaterialSecondInfo> getUseDemandAndSupply(MaterialRetainedEquipmentInfo bean) {
|
||||
return materialMachineMapper.getUseDemandAndSupply(bean);
|
||||
ArrayList<MaterialSecondInfo> totalList = new ArrayList<>();
|
||||
// 材料站供需求平衡数据在用二级页面查询
|
||||
List<MaterialSecondInfo> clzUseList = materialMachineMapper.getUseDemandAndSupply(bean);
|
||||
// 获取分包领退数据
|
||||
List<MaterialSecondInfo> subList = materialMachineMapper.getSubDemandAndSupply(bean);
|
||||
totalList.addAll(clzUseList);
|
||||
totalList.addAll(subList);
|
||||
return totalList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -915,7 +915,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 in (32, 36)
|
||||
bu.type_id = 36
|
||||
AND bp.pro_id = #{proId}
|
||||
AND sai.`status` = '0' and mm.qr_code = #{qrCode}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
|
|
@ -1448,7 +1448,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 in (32, 36)
|
||||
bu.type_id = 36
|
||||
AND bp.pro_id = #{proId}
|
||||
AND sai.`status` = '0'
|
||||
<if test="maCode != null and maCode != ''">
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt.lease_price AS buyPrice,
|
||||
sai.num AS storeNum,
|
||||
SUM(IFNULL( sai.num, 0 )) AS storeNum,
|
||||
mm.ma_code AS maCode,
|
||||
bt.unit_name AS teamName,
|
||||
sai.lease_id AS leaseId,
|
||||
|
|
@ -250,12 +250,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sai.status = '0'
|
||||
AND sai.end_time IS NULL
|
||||
AND sai.back_id IS NULL
|
||||
AND bt.type_id = 36
|
||||
<if test="typeId != null">
|
||||
AND sai.type_id = #{typeId}
|
||||
</if>
|
||||
<if test="proId != null and proId != ''">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
GROUP BY
|
||||
sai.type_id,
|
||||
sai.ma_id
|
||||
</select>
|
||||
|
||||
<select id="selectInFo" resultType="com.bonus.material.clz.domain.machine.MaterialStorageInfo">
|
||||
|
|
@ -1286,7 +1290,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
'安全工器具'
|
||||
ELSE
|
||||
'施工机具'
|
||||
END jiJuType
|
||||
END jiJuType,
|
||||
'1' as bzFlag
|
||||
FROM ma_type mt
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
|
|
@ -1470,7 +1475,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
CASE mt.manage_type WHEN 0 THEN '编码' ELSE '数量' END manageType,
|
||||
mt.unit_value AS unitValue,
|
||||
bz.ssfbdw AS subUnitName,
|
||||
CASE mt.jiju_type WHEN 2 THEN '安全工器具' ELSE '施工机具' END jiJuType
|
||||
CASE mt.jiju_type WHEN 2 THEN '安全工器具' ELSE '施工机具' END jiJuType,
|
||||
'0' as bzFlag
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
|
|
@ -1530,7 +1536,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt.lease_price AS buyPrice,
|
||||
sai.num AS storeNum,
|
||||
SUM(IFNULL( sai.num, 0 )) AS storeNum,
|
||||
mm.ma_code AS maCode,
|
||||
bt.unit_name AS teamName,
|
||||
sai.lease_id AS leaseId,
|
||||
|
|
@ -1558,6 +1564,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="teamId !=null ">
|
||||
AND bt.unit_id = #{teamId}
|
||||
</if>
|
||||
GROUP BY
|
||||
sai.type_id,
|
||||
sai.ma_id
|
||||
</select>
|
||||
|
||||
<select id="getImpUnitNameList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
|
|
@ -2146,9 +2155,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE mt.`level` = 4 and mt.del_flag = '0'
|
||||
AND subquery1.proName IS NOT NULL
|
||||
GROUP BY
|
||||
mt.type_id,
|
||||
subquery1.proId
|
||||
|
||||
subquery1.proId,
|
||||
mt.type_id
|
||||
</select>
|
||||
|
||||
<select id="getLeaseDemandNum" resultType="com.bonus.material.clz.domain.vo.MaterialProvideNumInfo">
|
||||
|
|
@ -2313,7 +2321,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
'安全工器具'
|
||||
ELSE
|
||||
'施工机具'
|
||||
END jiJuType
|
||||
END jiJuType,
|
||||
'1' as bzFlag,
|
||||
CASE mt.manage_type
|
||||
WHEN 0 THEN
|
||||
'编码'
|
||||
ELSE
|
||||
'数量'
|
||||
END manageType
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
|
|
@ -2491,4 +2506,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY mt.type_id,
|
||||
bp.pro_id
|
||||
</select>
|
||||
|
||||
<select id="getSubList" resultType="com.bonus.material.clz.domain.machine.MaterialStorageInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt.lease_price AS buyPrice,
|
||||
SUM(IFNULL( sai.num, 0 )) AS storeNum,
|
||||
mm.ma_code AS maCode,
|
||||
bt.unit_name AS teamName,
|
||||
sai.lease_id AS leaseId,
|
||||
sai.type_id AS typeId,
|
||||
lai.code AS code,
|
||||
sai.ma_id AS maId,
|
||||
bp.pro_name AS proName
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
||||
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id
|
||||
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
WHERE
|
||||
sai.status = '0'
|
||||
AND sai.end_time IS NULL
|
||||
AND sai.back_id IS NULL
|
||||
AND bt.type_id in (32,33)
|
||||
<if test="typeId != null">
|
||||
AND sai.type_id = #{typeId}
|
||||
</if>
|
||||
<if test="proId != null and proId != ''">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
GROUP BY
|
||||
sai.type_id,
|
||||
sai.ma_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -497,6 +497,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
|
||||
WHERE
|
||||
bp.del_flag = '0'
|
||||
-- 剔除已结算工程
|
||||
AND bp.pro_id IN (SELECT project_id FROM bm_agreement_info WHERE is_slt = 0)
|
||||
<if test="impUnit != null and impUnit != ''">
|
||||
and bp.imp_unit = #{impUnit}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@
|
|||
|
||||
<select id="getDeptId" resultType="java.lang.String">
|
||||
select
|
||||
project_leader_id as leaderId
|
||||
project_engineer_id as leaderId
|
||||
from
|
||||
data_center.dx_fb_son
|
||||
where
|
||||
|
|
|
|||
Loading…
Reference in New Issue