Merge branch 'dev-nx' of http://192.168.0.56:3000/bonus/devicesmgt into dev-nx
This commit is contained in:
commit
782d2c645a
|
|
@ -35,8 +35,8 @@ public class SysFileController
|
|||
// 上传并返回访问地址
|
||||
String url = sysFileService.uploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
sysFile.setFileName(FileUtils.getName(url));
|
||||
sysFile.setFileUrl(url);
|
||||
return R.ok(sysFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ public class PurchaseMacodeInfoController extends BaseController {
|
|||
@ApiOperation(value = "查询单个新购验收编号管理列表详情")
|
||||
@GetMapping("/details")
|
||||
public AjaxResult details(PurchaseMacodeInfo purchaseMacodeInfo) throws Exception {
|
||||
if (purchaseMacodeInfo.getTaskId() == null || purchaseMacodeInfo.getTaskId() == 0) {
|
||||
throw new Exception("任务taskId为空!!!");
|
||||
if (purchaseMacodeInfo.getTaskId() == null || purchaseMacodeInfo.getTaskId() == 0
|
||||
|| purchaseMacodeInfo.getTypeId() == null || purchaseMacodeInfo.getTypeId() == 0) {
|
||||
throw new Exception("任务taskId或者类型typeId为空!!!");
|
||||
}
|
||||
List<PurchaseMacodeInfo> list = purchaseMacodeInfoService.selectPurchaseMacodeInfoListDetails(purchaseMacodeInfo);
|
||||
return AjaxResult.success(list);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ package com.bonus.sgzb.material.service.impl;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
|
@ -75,20 +72,31 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
*/
|
||||
@Override
|
||||
public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfoList = purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
|
||||
//判断有没有绑定固定资产
|
||||
if (purchaseMacodeInfoList.size() > 0 && purchaseMacodeInfoList.get(0).getFixCode()!=null) {
|
||||
Map<Object, Long> groupCounts = purchaseMacodeInfoList.stream().map(PurchaseMacodeInfo::getFixCode).collect(Collectors.groupingBy(String::valueOf, Collectors.counting()));
|
||||
//去重
|
||||
purchaseMacodeInfoList = purchaseMacodeInfoList.stream().distinct().collect(Collectors.toList());
|
||||
for (PurchaseMacodeInfo purchaseMacodeInfo1 : purchaseMacodeInfoList) {
|
||||
groupCounts.forEach((fixCode, count) -> {
|
||||
if (purchaseMacodeInfo1.getFixCode().equals(fixCode)) {
|
||||
purchaseMacodeInfo1.setBindNum(count.intValue());
|
||||
}
|
||||
Map<Object,Long> groupCounts = purchaseMacodeInfoList.stream().map(PurchaseMacodeInfo::getTypeId).collect(Collectors.groupingBy(String::valueOf, Collectors.counting()));
|
||||
// 根据 typeId 进行去重
|
||||
purchaseMacodeInfoList = purchaseMacodeInfoList.stream()
|
||||
// 指定键为 typeId
|
||||
.collect(Collectors.toMap(PurchaseMacodeInfo::getTypeId,
|
||||
// 指定值为对象本身
|
||||
maCodeInfo -> maCodeInfo,
|
||||
// 如果存在重复的 typeId,则保留已存在的对象
|
||||
(existing, replacement) -> existing))
|
||||
.values().stream().collect(Collectors.toList());
|
||||
//遍历purchaseMaCodeInfoList集合,非空判断取值
|
||||
purchaseMacodeInfoList.stream()
|
||||
.forEach(purchaseMaCodeInfo1 -> {
|
||||
Optional.ofNullable(groupCounts.get(String.valueOf(purchaseMaCodeInfo1.getFixCode())))
|
||||
.ifPresent(count -> purchaseMaCodeInfo1.setBindNum(count.intValue()));
|
||||
});
|
||||
}
|
||||
//根据fixCode固定资产编号判断是否绑定,未绑定,绑定数量设置为0
|
||||
for (PurchaseMacodeInfo maCodeInfo : purchaseMacodeInfoList) {
|
||||
if (maCodeInfo.getFixCode() == null) {
|
||||
maCodeInfo.setBindNum(0);
|
||||
}
|
||||
}
|
||||
return purchaseMacodeInfoList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
where bai.status = '1'
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bai.contract_code like concat('%', #{keyWord}, '%') or
|
||||
and (bai.agreement_code like concat('%', #{keyWord}, '%') or
|
||||
bai.contract_code like concat('%', #{keyWord}, '%') or
|
||||
auth_person like concat('%', #{keyWord}, '%') or
|
||||
bp.lot_name like concat('%', #{keyWord}, '%') or
|
||||
bui.unit_name like concat('%', #{keyWord}, '%') or
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="codeType != null and codeType != ''"> and pmi.code_type = #{codeType}</if>
|
||||
<if test="status != null and status != ''"> and pmi.status = #{status}</if>
|
||||
<if test="companyId != null "> and pmi.company_id = #{companyId}</if>
|
||||
GROUP BY pcd.type_id
|
||||
</select>
|
||||
|
||||
<select id="selectPurchaseMacodeInfoByTaskId" parameterType="Long" resultMap="PurchaseMacodeInfoResult">
|
||||
|
|
@ -522,11 +521,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN purchase_macode_info pmi ON pmi.task_id = pcd.task_id
|
||||
and pmi.type_id = pcd.type_id
|
||||
LEFT JOIN ma_machine mm on mm.ma_code = pmi.ma_code
|
||||
AND pmi.type_id = pcd.type_id
|
||||
LEFT JOIN purchase_check_info pt ON pcd.task_id = pt.task_id
|
||||
WHERE
|
||||
pcd.task_id = #{taskId}
|
||||
AND pcd.type_id = #{typeId}
|
||||
AND mt.manage_type = '0'
|
||||
AND pcd.`status` != 3
|
||||
AND pcd.`status` != 5
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="采购状态" prop="taskState">
|
||||
<el-form-item label="采购状态" prop="taskStatus">
|
||||
<el-select
|
||||
v-model="queryParams.taskStatus"
|
||||
placeholder="请选择采购状态"
|
||||
|
|
@ -631,6 +631,12 @@ export default {
|
|||
],
|
||||
},
|
||||
userId: sessionStorage.getItem('userId'),
|
||||
statusList: [
|
||||
{ taskStatus: 28, label: '已全部入库' },
|
||||
{ taskStatus: 105, label: '入库审核中' },
|
||||
{ taskStatus: 107, label: '入库审核未通过' },
|
||||
{ taskStatus: 123, label: '部分已入库' },
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue