Merge branch 'dev-cq' of http://192.168.0.56:3000/bonus/devicesmgt into dev-cq
This commit is contained in:
commit
a52ddce1ec
|
|
@ -186,6 +186,7 @@ public class SltAgreementInfo {
|
|||
private Integer codeNum;
|
||||
private Integer unitId;
|
||||
private Integer lotId;
|
||||
private Integer leaseType;
|
||||
private List<SltAgreementInfo> node;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
MachinePart machinePart = tmTaskMapper.getMachineParts(typeId);
|
||||
machinePart.setParentId(record.getId().intValue());
|
||||
int countMachineByPidAndTid = tmTaskMapper.getCountMachineByPidAndTid(machinePart);
|
||||
Double machinePartNum = typeId.getPartNum() * Double.parseDouble(backApplyInfo.getPreNum());
|
||||
Double machinePartNum = typeId.getPartNum() * Double.parseDouble(backApplyInfo.getAuditNum());
|
||||
count1 += machinePartNum;
|
||||
count2 += countMachineByPidAndTid;
|
||||
machinePart.setPartNum(machinePartNum - countMachineByPidAndTid);
|
||||
|
|
@ -65,7 +65,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (count1 == count2) {
|
||||
backApplyInfo.setPartNum(0);
|
||||
} else {
|
||||
backApplyInfo.setPartNum((int) Double.parseDouble(backApplyInfo.getPreNum()));
|
||||
backApplyInfo.setPartNum((int) Double.parseDouble(backApplyInfo.getAuditNum()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import com.bonus.sgzb.base.domain.MaPartType;
|
||||
import com.bonus.sgzb.base.domain.MapType;
|
||||
import com.bonus.sgzb.base.service.ExcelService;
|
||||
import com.bonus.sgzb.base.service.IPartTypeService;
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
|
|
@ -103,7 +104,7 @@ public class MaPartTypeController extends BaseController {
|
|||
// 保存文件
|
||||
file.transferTo(filePath.toFile());
|
||||
|
||||
Map<String, Map<String, List<String>>> stringMapMap = excelService.readExcelFile(filePath.toString());
|
||||
Map<String, Map<String, List<MapType>>> stringMapMap = excelService.readExcelFile(filePath.toString());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 配件类型管理ma_part_type(MaPartType)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-27 16:44:09
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class MapType extends BaseEntity {
|
||||
|
||||
//类型名称
|
||||
@Excel(name = "类型名称")
|
||||
private String paName;
|
||||
|
||||
//计量单位ID
|
||||
@Excel(name = "计量单位ID")
|
||||
private String unitId;
|
||||
|
||||
//原值
|
||||
@Excel(name = "原值")
|
||||
private String buyPrice;
|
||||
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
MapType mapType = (MapType) o;
|
||||
return Objects.equals(paName, mapType.paName) &&
|
||||
Objects.equals(unitId, mapType.unitId) &&
|
||||
Objects.equals(buyPrice, mapType.buyPrice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(paName, unitId, buyPrice);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -4,16 +4,41 @@ import com.bonus.sgzb.base.domain.MaPartType;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ExcelMapper {
|
||||
MaPartType selectMa(@Param("name") String name,@Param("id") long id);
|
||||
|
||||
void insertPaName(MaPartType maPartType);
|
||||
|
||||
String selectPaName(@Param("firstLevel") String firstLevel);
|
||||
|
||||
|
||||
int insertPaName(MaPartType firstLevel);
|
||||
|
||||
void insertPaTwoName(MaPartType maPartType);
|
||||
|
||||
void insertPaThreeName(MaPartType maPartType);
|
||||
//
|
||||
// String selectPaName(@Param("firstLevel") String firstLevel);
|
||||
//
|
||||
//
|
||||
// int insertPaName(MaPartType firstLevel);
|
||||
//
|
||||
// void insertPaTwoName(MaPartType maPartType);
|
||||
//
|
||||
// void insertPaThreeName(MaPartType maPartType);
|
||||
//
|
||||
// int selectThreeName(String secondLevel);
|
||||
//
|
||||
// int selectTwoName(String entry2);
|
||||
//
|
||||
// String selectPaNameAndpaId(String value, String o);
|
||||
//
|
||||
//
|
||||
// List selectListParentid(String firstLevel);
|
||||
//
|
||||
// String selectName(String parentId2);
|
||||
//
|
||||
//
|
||||
// void updateLevelStatus(String parentId);
|
||||
//
|
||||
// String selectStatus(String pId);
|
||||
//
|
||||
// MaPartType selectTwoPaName(@Param("secondLevel") String secondLevel,@Param("id") Long id);
|
||||
//
|
||||
// String selectThreePaName(@Param("value") String value,@Param("paId") Long paId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.sgzb.base.domain.MapType;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface ExcelService {
|
||||
Map<String, Map<String, List<String>>> readExcelFile(String filePath);
|
||||
Map<String, Map<String, List<MapType>>> readExcelFile(String filePath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package com.bonus.sgzb.base.service.impl;// ExcelServiceImpl.java
|
||||
import com.bonus.sgzb.base.domain.MaPartType;
|
||||
import com.bonus.sgzb.base.domain.MapType;
|
||||
import com.bonus.sgzb.base.mapper.ExcelMapper;
|
||||
import com.bonus.sgzb.base.service.ExcelService;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -22,10 +22,10 @@ public class ExcelServiceImpl implements ExcelService {
|
|||
|
||||
|
||||
/*
|
||||
* 将读取的excel文件转为
|
||||
* */
|
||||
* 将读取的excel文件转为
|
||||
* */
|
||||
@Override
|
||||
public Map<String, Map<String, List<String>>> readExcelFile(String filePath) {
|
||||
public Map<String, Map<String, List<MapType>>> readExcelFile(String filePath) {
|
||||
|
||||
FileInputStream excelFile = null;
|
||||
Workbook workbook = null;
|
||||
|
|
@ -34,10 +34,8 @@ public class ExcelServiceImpl implements ExcelService {
|
|||
workbook = new XSSFWorkbook(excelFile);
|
||||
Sheet datatypeSheet = workbook.getSheetAt(0);
|
||||
Iterator<Row> iterator = datatypeSheet.iterator();
|
||||
String fourthLevel = "";
|
||||
String fifthLevel ="";
|
||||
Long id = null;
|
||||
Map<String, Map<String, List<String>>> level3Relation = new HashMap<>();
|
||||
|
||||
Map<String, Map<String, List<MapType>>> level3Relation = new HashMap<>();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Row currentRow = iterator.next();
|
||||
|
|
@ -51,72 +49,46 @@ public class ExcelServiceImpl implements ExcelService {
|
|||
Cell thirdLevelCell = currentRow.getCell(3);
|
||||
Cell fourthLevelCell = currentRow.getCell(4);
|
||||
Cell fifthLevelCell = currentRow.getCell(5);
|
||||
|
||||
Cell sixthLevelCell = currentRow.getCell(6);
|
||||
if (sixthLevelCell != null){
|
||||
throw new RuntimeException("导入模板不正确");
|
||||
}
|
||||
|
||||
String firstLevel = getCellValueAsString(firstLevelCell);
|
||||
String secondLevel = getCellValueAsString(secondLevelCell);
|
||||
String thirdLevel = getCellValueAsString(thirdLevelCell);
|
||||
fourthLevel = getCellValueAsString(fourthLevelCell);
|
||||
fifthLevel = getCellValueAsString(fifthLevelCell);
|
||||
|
||||
level3Relation.computeIfAbsent(firstLevel, k -> new HashMap<>())
|
||||
.computeIfAbsent(secondLevel, k -> new ArrayList<>())
|
||||
.add(thirdLevel);
|
||||
}
|
||||
|
||||
// 遍历外层Map
|
||||
for (Map.Entry<String, Map<String, List<String>>> entry1 : level3Relation.entrySet()) {
|
||||
String firstLevel = entry1.getKey(); // 获取第一层级的键
|
||||
String parentId = excelMapper.selectPaName(firstLevel);
|
||||
|
||||
//产生返回值并且进行判断是否是pa_name列已经有的,并且返回对应的pa_id
|
||||
if(parentId == null || parentId == ""){
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(firstLevel);
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id
|
||||
id = maPartType.getPaId();
|
||||
MapType thirdLevel = new MapType();
|
||||
thirdLevel.setPaName(getCellValueAsString(thirdLevelCell));
|
||||
thirdLevel.setUnitId(getCellValueAsString(fourthLevelCell));
|
||||
thirdLevel.setBuyPrice(getCellValueAsString(fifthLevelCell));
|
||||
|
||||
// 检查是否所有三个级别都是空白
|
||||
if (firstLevel.isEmpty() || secondLevel.isEmpty() || thirdLevel == null) {
|
||||
continue; // 跳过这一行
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
|
||||
Map<String, List<String>> secondLevelMap = entry1.getValue(); // 获取对应于第一层级键的内层Map
|
||||
|
||||
// 遍历内层Map
|
||||
for (Map.Entry<String, List<String>> entry2 : secondLevelMap.entrySet()) {
|
||||
String secondLevel = entry2.getKey(); // 获取第二层级的键
|
||||
String parentIdTwo = excelMapper.selectPaName(secondLevel);
|
||||
|
||||
//产生返回值并且进行判断是否是pa_name列已经有的,并且返回对应的pa_id
|
||||
if(parentIdTwo == null || parentIdTwo == ""){
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(secondLevel);
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
maPartType.setParentId(id);
|
||||
excelMapper.insertPaTwoName(maPartType);//第二层在数据库中查询不到则插入数据,则插入时候设置关联关系
|
||||
id = maPartType.getPaId();
|
||||
// 检查是否已经存在相同的组合
|
||||
boolean isDuplicate = false;
|
||||
for (String key : level3Relation.keySet()) {
|
||||
Map<String, List<MapType>> secondLevelMap = level3Relation.get(key);
|
||||
for (String key2 : secondLevelMap.keySet()) {
|
||||
List<MapType> thirdLevelList = secondLevelMap.get(key2);
|
||||
if (key.equals(firstLevel) && key2.equals(secondLevel) && thirdLevelList.contains(thirdLevel)) {
|
||||
isDuplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isDuplicate) break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//从数据库中查询
|
||||
String thirdLevel = entry2.getValue().get(0); // 获取对应于第二层级键的值,即第三层级的列表
|
||||
|
||||
|
||||
String parentThreeId = excelMapper.selectPaName(thirdLevel);
|
||||
if(parentThreeId == null || parentThreeId == ""){
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(thirdLevel);
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
maPartType.setUnitId(fourthLevel);
|
||||
maPartType.setBuyPrice(fifthLevel);
|
||||
maPartType.setParentId(id);
|
||||
excelMapper.insertPaThreeName(maPartType);//第二层在数据库中查询不到则插入数据,则插入时候设置关联关系
|
||||
}
|
||||
if (!isDuplicate) {
|
||||
// 如果不是重复项,则添加到映射中
|
||||
Map<String, List<MapType>> secondLevelMap = level3Relation.computeIfAbsent(firstLevel, k -> new HashMap<>());
|
||||
List<MapType> thirdLevelList = secondLevelMap.computeIfAbsent(secondLevel, k -> new ArrayList<>());
|
||||
thirdLevelList.add(thirdLevel);
|
||||
}
|
||||
}
|
||||
printLevel3Relation(level3Relation);
|
||||
|
||||
return level3Relation;
|
||||
} catch (IOException e) {
|
||||
|
|
@ -160,5 +132,83 @@ public class ExcelServiceImpl implements ExcelService {
|
|||
}
|
||||
|
||||
|
||||
private void printLevel3Relation(Map<String, Map<String, List<MapType>>> level3Relation) {
|
||||
for (Map.Entry<String, Map<String, List<MapType>>> firstLevel : level3Relation.entrySet()) {
|
||||
boolean outExist = true;
|
||||
System.out.println("level_1: " + firstLevel.getKey());
|
||||
//TODO, sql查询:是否有此名字 + parentId=0, select * from ma_part_type where name=? and parent_id=0;
|
||||
MaPartType maPartType_level1 = excelMapper.selectMa(firstLevel.getKey(),0);
|
||||
//TODO, 以上返回 maPartType_level1
|
||||
if (Objects.nonNull(maPartType_level1)) {
|
||||
loopInner(firstLevel, outExist,maPartType_level1.getPaId());
|
||||
} else {
|
||||
//TODO, insert firstLevel, get id
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(firstLevel.getKey());
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
maPartType.setParentId(0L);
|
||||
maPartType.setLevel("1");
|
||||
excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id
|
||||
outExist = outExist && false;
|
||||
loopInner(firstLevel, outExist, maPartType.getPaId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void loopInner(Map.Entry<String, Map<String, List<MapType>>> firstLevel, boolean outExist, long firstLevelId) {
|
||||
for (Map.Entry<String, List<MapType>> secondLevel : firstLevel.getValue().entrySet()) {
|
||||
System.out.println("\tlevel_2: " + secondLevel.getKey());
|
||||
//TODO, sql查询:是否有此名字 + parentId=firstLevelId, select * from ma_part_type where name=? and parent_id = firstLevelId;
|
||||
MaPartType maPartType_level2 = excelMapper.selectMa(firstLevel.getKey(),firstLevelId);
|
||||
//TODO, 以上返回 maPartType_level2
|
||||
if (Objects.nonNull(maPartType_level2)) {
|
||||
looplevel3(secondLevel, outExist, maPartType_level2.getPaId());
|
||||
} else {
|
||||
//TODO, insert firstLevel, get id
|
||||
if (!outExist) {
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(secondLevel.getKey());
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
maPartType.setParentId(firstLevelId);
|
||||
maPartType.setLevel("2");
|
||||
excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id
|
||||
outExist = outExist && false;
|
||||
looplevel3(secondLevel, outExist, maPartType.getPaId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void looplevel3(Map.Entry<String, List<MapType>> secondLevel, boolean outExist, long secondLevelId) {
|
||||
for (MapType thirdLevel : secondLevel.getValue()) {
|
||||
System.out.println("\t\tlevel_3: " + thirdLevel);
|
||||
//TODO, sql查询:是否有此名字 + parentId=secondLevelId, select * from ma_part_type where name=? and parent_id = secondLevelId;
|
||||
MaPartType maPartType_level3 = excelMapper.selectMa(thirdLevel.getPaName(),secondLevelId);
|
||||
//TODO, 以上返回 maPartType_level3
|
||||
if (Objects.nonNull(maPartType_level3)) {
|
||||
if (!outExist) {
|
||||
//TODO insert
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(thirdLevel.getPaName());
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
maPartType.setUnitId(thirdLevel.getUnitId());
|
||||
maPartType.setBuyPrice(thirdLevel.getBuyPrice());
|
||||
maPartType.setParentId(secondLevelId);
|
||||
maPartType.setLevel("3");
|
||||
excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id
|
||||
}
|
||||
} else {
|
||||
//TODO insert
|
||||
MaPartType maPartType = new MaPartType();
|
||||
maPartType.setPaName(thirdLevel.getPaName());
|
||||
maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
maPartType.setUnitId(thirdLevel.getUnitId());
|
||||
maPartType.setBuyPrice(thirdLevel.getBuyPrice());
|
||||
maPartType.setParentId(secondLevelId);
|
||||
maPartType.setLevel("3");
|
||||
excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -542,8 +542,8 @@
|
|||
)
|
||||
</insert>
|
||||
<insert id="insStlInfoTwo">
|
||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id)
|
||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId});
|
||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type)
|
||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId},#{info.leaseType});
|
||||
</insert>
|
||||
|
||||
|
||||
|
|
@ -664,7 +664,8 @@
|
|||
mt.type_name as typeCode,
|
||||
mt.unit_name as unitName,
|
||||
mt2.type_name AS typeName,
|
||||
bad.audit_num as preNum,
|
||||
bad.pre_num as preNum,
|
||||
bad.audit_num as auditNum,
|
||||
bad.status as status,
|
||||
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
|
||||
mt.manage_type as manageType,
|
||||
|
|
@ -860,6 +861,7 @@
|
|||
end_time AS endTime,
|
||||
status AS status,
|
||||
lease_id AS leaseId,
|
||||
lease_type AS leaseType,
|
||||
back_id AS backId,
|
||||
lease_price AS leasePrice,
|
||||
buy_price AS buyPrice,
|
||||
|
|
|
|||
|
|
@ -3,27 +3,64 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.base.mapper.ExcelMapper">
|
||||
<insert id="insertPaName" keyProperty="paId" useGeneratedKeys="true">
|
||||
<insert id="insertPaName" parameterType="com.bonus.sgzb.base.domain.MaPartType" keyProperty="paId" useGeneratedKeys="true">
|
||||
insert into ma_part_type
|
||||
(pa_name, status,level,del_flag,create_by,create_time,year)
|
||||
(pa_name, parent_id, status,level,del_flag,unit_id,buy_price,create_by,create_time,year)
|
||||
VALUES
|
||||
(#{paName}, 0 , 1, 0, #{createBy}, now(),year(now()))
|
||||
</insert>
|
||||
<insert id="insertPaTwoName" keyProperty="paId" useGeneratedKeys="true">
|
||||
insert into ma_part_type
|
||||
(pa_name, parent_id, status,level,del_flag,create_by,create_time,year)
|
||||
VALUES
|
||||
(#{paName}, #{parentId},0 , 2, 0, #{createBy}, now(),year(now()))
|
||||
</insert>
|
||||
<insert id="insertPaThreeName">
|
||||
insert into ma_part_type
|
||||
(pa_name, parent_id, status,level,del_flag,unit_id,buy_price,create_by,create_time,year)
|
||||
VALUES
|
||||
(#{paName}, #{parentId},0 , 3, 0, #{unitId}, #{buyPrice}, #{createBy}, now(),year(now()))
|
||||
(#{paName}, #{parentId},0 , #{level}, 0, #{unitId}, #{buyPrice}, #{createBy}, now(),year(now()))
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectPaName" resultType="java.lang.String">
|
||||
SELECT pa_id FROM ma_part_type WHERE pa_name = #{firstLevel}
|
||||
</select>
|
||||
<!-- <insert id="insertPaName" keyProperty="paId" useGeneratedKeys="true">-->
|
||||
<!-- insert into ma_part_type-->
|
||||
<!-- (pa_name, status,level,del_flag,create_by,create_time,year)-->
|
||||
<!-- VALUES-->
|
||||
<!-- (#{paName}, 0 , 1, 0, #{createBy}, now(),year(now()))-->
|
||||
<!-- </insert>-->
|
||||
<!-- <insert id="insertPaTwoName" keyProperty="paId" useGeneratedKeys="true">-->
|
||||
<!-- insert into ma_part_type-->
|
||||
<!-- (pa_name, parent_id, status,level,del_flag,unit_id,buy_price,create_by,create_time,year)-->
|
||||
<!-- VALUES-->
|
||||
<!-- (#{paName}, #{parentId},0 , 2, 0, #{unitId}, #{buyPrice}, #{createBy}, now(),year(now()))-->
|
||||
<!-- </insert>-->
|
||||
<!-- <insert id="insertPaThreeName">-->
|
||||
<!-- insert into ma_part_type-->
|
||||
<!-- (pa_name, parent_id, status,level,del_flag,unit_id,buy_price,create_by,create_time,year)-->
|
||||
<!-- VALUES-->
|
||||
<!-- (#{paName}, #{parentId},0 , 3, 0, #{unitId}, #{buyPrice}, #{createBy}, now(),year(now()))-->
|
||||
<!-- </insert>-->
|
||||
<!-- <update id="updateLevelStatus" parameterType="java.lang.String">-->
|
||||
<!-- update ma_part_type set level_status = 1 where pa_id = #{parentId}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<!-- <select id="selectPaName" resultType="java.lang.String">-->
|
||||
<!-- SELECT pa_id FROM ma_part_type WHERE pa_name = #{firstLevel}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="selectThreeName" resultType="java.lang.Integer" parameterType="java.lang.String">-->
|
||||
<!-- SELECT count(*) FROM ma_part_type WHERE pa_name = #{firstLevel} and level = 3-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectTwoName" resultType="java.lang.Integer" parameterType="java.lang.String">-->
|
||||
<!-- SELECT count(*) FROM ma_part_type WHERE pa_name = #{secondLevel} and level = 2-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectPaNameAndpaId" resultType="java.lang.String" parameterType="java.lang.String">-->
|
||||
<!-- SELECT parent_id FROM ma_part_type WHERE pa_name = #{value} and pa_id = #{o}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectListParentid" resultType="java.util.List" parameterType="java.lang.String">-->
|
||||
<!-- SELECT parent_id FROM ma_part_type WHERE pa_name = #{firstLevel} and level = 2-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectName" resultType="java.lang.String" parameterType="java.lang.String">-->
|
||||
<!-- SELECT pa_name FROM ma_part_type WHERE pa_name = #{parentId2}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectStatus" resultType="java.lang.String">-->
|
||||
<!-- select level_status from ma_part_type where pa_id = #{pId}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectTwoPaName" resultType="com.bonus.sgzb.base.domain.MaPartType">-->
|
||||
<!-- select * from ma_part_type where pa_name = #{secondLevel} and parent_id = #{id}-->
|
||||
<!-- </select>-->
|
||||
<select id="selectMa" resultType="com.bonus.sgzb.base.domain.MaPartType">
|
||||
select * from ma_part_type where pa_name = #{name} and parent_id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<delete id="deletePaById">
|
||||
update ma_part_type set del_flag = '2' where pa_id = #{paId}
|
||||
delete from ma_part_type where pa_id = #{paId}
|
||||
</delete>
|
||||
|
||||
<select id="checkPartNameUnique" resultMap="MaPartTypeResult">
|
||||
|
|
|
|||
|
|
@ -124,6 +124,16 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
private String userId;
|
||||
|
||||
/** 审核员用户id */
|
||||
@ApiModelProperty(value = "审核员用户id")
|
||||
private List<String> userIds;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfoList = purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
|
||||
//判断有没有绑定固定资产
|
||||
if (purchaseMacodeInfoList.size() > 0 && purchaseMacodeInfoList.get(0).getFixCode()!=null){
|
||||
if (purchaseMacodeInfoList.size() > 0/* && purchaseMacodeInfoList.get(0).getFixCode()!=null*/){
|
||||
Map<Object,Long> groupCounts = purchaseMacodeInfoList.stream().map(PurchaseMacodeInfo::getTypeId).collect(Collectors.groupingBy(String::valueOf, Collectors.counting()));
|
||||
// 根据 typeId 进行去重
|
||||
purchaseMacodeInfoList = purchaseMacodeInfoList.stream()
|
||||
|
|
@ -433,12 +433,14 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
*/
|
||||
@Override
|
||||
public List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
purchaseMacodeInfo.setUserId(userid.toString());
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfos = purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo);
|
||||
for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
|
||||
/* for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
|
||||
List<String> userIds = purchaseMacodeInfoMapper.selectKeepUser(macodeInfo.getTypeId().intValue());
|
||||
userIds.add("1");
|
||||
macodeInfo.setUserIds(userIds);
|
||||
}
|
||||
}*/
|
||||
return purchaseMacodeInfos;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -351,18 +351,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</select>
|
||||
<select id="selectPutinDetails" resultType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo">
|
||||
select pcd.production_time productionTime,
|
||||
mt.type_name specificationType,
|
||||
mt1.type_name typeName,
|
||||
select pcd.production_time as productionTime,
|
||||
mt.type_name as specificationType,
|
||||
mt1.type_name as typeName,
|
||||
mt.manage_type as manageType,
|
||||
pmi.ma_code maCode,
|
||||
mm.assets_code assetsCode,
|
||||
pmi.fix_code fixCode,
|
||||
pcd.type_id typeId,
|
||||
pcd.task_id taskId,
|
||||
mt.code specsCode,
|
||||
mt.num num,
|
||||
mt1.code typeCode,
|
||||
pmi.ma_code as maCode,
|
||||
mm.assets_code as assetsCode,
|
||||
pmi.fix_code as fixCode,
|
||||
pcd.type_id as typeId,
|
||||
pcd.task_id as taskId,
|
||||
mt.code as specsCode,
|
||||
mt.num as num,
|
||||
mt1.code as typeCode,
|
||||
CASE
|
||||
WHEN pmi.ma_code is null THEN
|
||||
CASE
|
||||
|
|
@ -371,17 +371,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ELSE 0
|
||||
END
|
||||
ELSE pmi.status
|
||||
END AS status,
|
||||
mm.qr_code qrCode,
|
||||
mm.ma_id maId,
|
||||
END AS status,
|
||||
mm.qr_code as qrCode,
|
||||
mm.ma_id as maId,
|
||||
if(pmi.ma_code is not null, 1, pcd.check_num) checkNum
|
||||
from purchase_check_details pcd
|
||||
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.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_type_keeper mtk on pcd.type_id = mtk.type_id
|
||||
left join ma_machine mm on pmi.ma_code = mm.ma_code
|
||||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where pcd.task_id = #{taskId}
|
||||
and pcd.`status`!=3 and pcd.`status`!=7
|
||||
<if test="userId != 1">
|
||||
and mtk.user_id = #{userId}
|
||||
</if>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
and (mt.type_name like concat('%',#{dictName},'%') or
|
||||
mt1.type_name like concat('%',#{dictName},'%'))
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and sd2.`name` like concat('%', #{keyWord}, '%') or
|
||||
us.user_name like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
ORDER BY tt.create_time desc
|
||||
</select>
|
||||
<select id="getTaskType" resultType="com.bonus.sgzb.material.domain.ToDoBean">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@
|
|||
>新建</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- :disabled="single" -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
|
|
@ -57,7 +56,7 @@
|
|||
@click="handlePeople"
|
||||
>人员配置</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
|
|
|||
|
|
@ -363,20 +363,14 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
v-if="
|
||||
scope.row.status == '0' &&
|
||||
scope.row.userIds.includes(userId)
|
||||
"
|
||||
v-if="scope.row.status == '0'"
|
||||
@click="pass(scope.row)"
|
||||
>通过</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
v-if="
|
||||
scope.row.status == '0' &&
|
||||
scope.row.userIds.includes(userId)
|
||||
"
|
||||
v-if="scope.row.status == '0'"
|
||||
@click="refused(scope.row)"
|
||||
>不通过</el-button
|
||||
>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ module.exports = {
|
|||
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
|
||||
// target: `https://z.csgmall.com.cn`,
|
||||
|
||||
target: `http://192.168.2.151:39080`, //超
|
||||
target: `http://192.168.2.154:39080`, //超
|
||||
// target: `http://10.40.92.81:8080`, //韩/
|
||||
// target: `http://10.40.92.74:8080`,//旭/
|
||||
// target: `http://10.40.92.138:28080`, //帅
|
||||
|
|
|
|||
Loading…
Reference in New Issue