Merge remote-tracking branch 'origin/master'

This commit is contained in:
mashuai 2025-03-20 15:53:24 +08:00
commit 00d19721a4
26 changed files with 430 additions and 72 deletions

View File

@ -209,6 +209,8 @@ public class LeaseApplyDetails implements Serializable {
private Integer ctParentId;
@ApiModelProperty(value="是否是成套机具0是 1否")
private Integer isCt;
@ApiModelProperty(value="套数")
private Integer setsNum;
@ApiModelProperty(value="默认1,0不是库存管理")
private String isStorage;
}

View File

@ -44,6 +44,7 @@ public class TmTask implements Serializable {
private Integer taskType;
private List<TmTask> outboundType;
private List<Integer> wholeTypeName;
private String wholeName;
/**
* 任务状态(定义数据字典)
@ -170,8 +171,7 @@ public class TmTask implements Serializable {
@ApiModelProperty(value = "领料任务详情集合")
private List<LeaseApplyDetails> leaseApplyDetails;
/** 机具规格详情列表 */
@ApiModelProperty(value = "成套机具规格详情列表")
Map<String, List<LeaseApplyDetails>> ctLeaseApplyDetails;
private Map<String, List<LeaseApplyDetails>> ctLeaseApplyDetails;
private List<LeaseOutDetailRecord> leaseOutDetailRecord;
@ApiModelProperty(value = "协议id")
@ -337,8 +337,12 @@ public class TmTask implements Serializable {
private String maTypeUserName;
@ApiModelProperty(value = "成套机具三级typeId")
private Integer ctParentId;
@ApiModelProperty(value = "是否成套设备")
@ApiModelProperty(value = "是否成套设备(0是 1不是)")
private Integer isCt;
@ApiModelProperty(value = "套数")
private Integer setsNum;
@ApiModelProperty(value = "是否是主体设备")
private boolean isMain;
@ApiModelProperty(value = "出库时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")

View File

@ -156,4 +156,10 @@ public interface TmTaskMapper {
String getCtParentName(LeaseApplyDetails applyDetails);
List<PreNumInUse> getPreNumInUse(PreNumInUse typeId);
List<TmTask> getLeaseOutList(TmTask task);
String getParentNameById(Integer ctParentId);
String getAscriptionTypeByTypeId(TmTask tmTask);
}

View File

@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
@ -258,6 +259,18 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public List<TmTask> getLeaseAuditListByOne(TmTask record) {
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
// 查询成套设备中哪个是主设备
for (TmTask tmTask : leaseDetailByParentId) {
if (tmTask.getIsCt() == 0) {
String wholeTypeName = tmTaskMapper.getAscriptionTypeByTypeId(tmTask);
if (StringUtils.isNotBlank(wholeTypeName)) {
tmTask.setWholeName(wholeTypeName);
tmTask.setMain(true);
} else {
tmTask.setMain(false);
}
}
}
/* for (TmTask tmTask : leaseDetailByParentId) {
if ("2".equals(tmTask.getManageType())) {
List<TmTask> manageTypeByTypeId = tmTaskMapper.getManageTypeByTypeId(tmTask);
@ -449,8 +462,8 @@ public class TmTaskServiceImpl implements TmTaskService {
if (roles.contains(STRING_ADMIN)) {
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(record);
} else {
String username = SecurityUtils.getLoginUser().getUsername();
record.setCreateBy(username);
long username = SecurityUtils.getLoginUser().getUserid();
record.setCreateBy(username + "");
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(record);
}
for (TmTask tmTask : tmTaskList) {
@ -539,7 +552,7 @@ public class TmTaskServiceImpl implements TmTaskService {
List<LeaseApplyDetails> arrayList = new ArrayList<>();
if (leaseApplyDetails.size() > 0) {
//查询同规格下预出库量
if(leaseApplyDetails != null){
if (leaseApplyDetails != null) {
for (LeaseApplyDetails detail : leaseApplyDetails) {
LeaseApplyDetails needDetails = tmTaskMapper.getApplyNeedDetailsCq(detail);
@ -578,8 +591,27 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
}
Map<Integer, List<LeaseApplyDetails>> map = listLeaseDetails.stream()
.filter(detail -> detail.getIsCt() == 0)
.filter(detail -> detail.getCtParentId() != null)
.collect(Collectors.groupingBy(LeaseApplyDetails::getCtParentId));
Map<String, List<LeaseApplyDetails>> transformedMap = map.entrySet().stream()
.collect(Collectors.toMap(
entry -> {
Integer ctParentId = entry.getKey();
String typeName = getParentNameById(ctParentId);
return typeName;
},
Map.Entry::getValue // 获取分组后的LeaseApplyDetails列表
));
List<LeaseApplyDetails> collect = listLeaseDetails.stream()
.filter(detail -> detail.getIsCt() == 1)
.filter(detail -> detail.getCtParentId() == null)
.collect(Collectors.toList());
tmTask.setCtLeaseApplyDetails(transformedMap);
tmTask.setLeaseApplyDetails(collect);
// 塞入领料任务详情的集合中
tmTask.setLeaseApplyDetails(listLeaseDetails);
// tmTask.setLeaseApplyDetails(listLeaseDetails);
}
tmTaskList.add(tmTask);
return tmTaskList;
@ -587,7 +619,16 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public List<TmTask> getLeaseOutListByUser(TmTask task) {
return tmTaskMapper.getLeaseOutListByUser(task);
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
List<TmTask> tmTaskList;
if (roles.contains(STRING_ADMIN)) {
tmTaskList = tmTaskMapper.getLeaseOutList(task);
} else {
tmTaskList = tmTaskMapper.getLeaseOutListByUser(task);
}
return tmTaskList;
}
@Override
@ -1379,19 +1420,24 @@ public class TmTaskServiceImpl implements TmTaskService {
.distinct()
.collect(Collectors.toList());
tmTask.setWholeTypeName(wholeTypeName);
Map<String, List<LeaseApplyDetails>> list = leaseApplyDetails.stream()
Map<Integer, List<LeaseApplyDetails>> map = leaseApplyDetails.stream()
.filter(detail -> detail.getIsCt() == 0)
.filter(detail -> detail.getCtParentId() != null)
.collect(Collectors.groupingBy(LeaseApplyDetails::getTypeName));
/* for (LeaseApplyDetails applyDetails : list) {
String parentName = tmTaskMapper.getCtParentName(applyDetails);
applyDetails.setp
}*/
.collect(Collectors.groupingBy(LeaseApplyDetails::getCtParentId));
Map<String, List<LeaseApplyDetails>> transformedMap = map.entrySet().stream()
.collect(Collectors.toMap(
entry -> {
Integer ctParentId = entry.getKey();
String typeName = getParentNameById(ctParentId);
return typeName;
},
Map.Entry::getValue // 获取分组后的LeaseApplyDetails列表
));
List<LeaseApplyDetails> collect = leaseApplyDetails.stream()
.filter(detail -> detail.getIsCt() == 1)
.filter(detail -> detail.getCtParentId() == null)
.collect(Collectors.toList());
tmTask.setCtLeaseApplyDetails(list);
tmTask.setCtLeaseApplyDetails(transformedMap);
tmTask.setLeaseApplyDetails(collect);
}
}
@ -1402,6 +1448,11 @@ public class TmTaskServiceImpl implements TmTaskService {
return tmTaskList;
}
public String getParentNameById(Integer ctParentId) {
String parentName = tmTaskMapper.getParentNameById(ctParentId);
return parentName;
}
@Override
public void updateLeaseInfo(LeaseApplyInfo task) {
tmTaskMapper.updateLeaseInfo(task);
@ -1419,10 +1470,10 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public AjaxResult pushToIntelligentProject(List<TmTask> tmTasks) {
log.info("MaMachineServiceImpl pushNotifications 开始处理设备到智慧工程的推送逻辑==={}",tmTasks);
log.info("MaMachineServiceImpl pushNotifications 开始处理设备到智慧工程的推送逻辑==={}", tmTasks);
List<MaMachineIntelligentVO> intelVOList = new ArrayList<>();
if (CollectionUtils.isEmpty(tmTasks)){
throw new ServiceException(String.format(ExceptionDict.PARAM_IS_NULL_ERROR_MSG,"maMachineList"), ExceptionDict.PARAM_IS_NULL_ERROR);
if (CollectionUtils.isEmpty(tmTasks)) {
throw new ServiceException(String.format(ExceptionDict.PARAM_IS_NULL_ERROR_MSG, "maMachineList"), ExceptionDict.PARAM_IS_NULL_ERROR);
} else {
//组装请求报文
makeIntelligentVOList(tmTasks, intelVOList);
@ -1438,7 +1489,7 @@ public class TmTaskServiceImpl implements TmTaskService {
log.info("token-=========:" + token);
//调用推送的方法
String intelligentUrl = configService.selectConfigByKey("intelligentUrl");
String data = HttpHelper.sendHttpPost(intelligentUrl, token,content,intelligentAppKey);
String data = HttpHelper.sendHttpPost(intelligentUrl, token, content, intelligentAppKey);
log.info("dataString-=========:" + data);
resultDataHandler(data);
} catch (Exception e) {
@ -1446,7 +1497,7 @@ public class TmTaskServiceImpl implements TmTaskService {
return AjaxResult.error("推送失败!");
}
//更改推送的状态
for (TmTask tmTask:tmTasks) {
for (TmTask tmTask : tmTasks) {
LeaseRecord leaseRecord = new LeaseRecord();
leaseRecord.setId(Integer.valueOf(tmTask.getId()));
leaseRecordMapper.updateLeaseRecord(leaseRecord);
@ -1458,6 +1509,7 @@ public class TmTaskServiceImpl implements TmTaskService {
/**
* 查询库管员下拉信息
*
* @param leaseApplyDetails
* @return
*/
@ -1527,9 +1579,9 @@ public class TmTaskServiceImpl implements TmTaskService {
for (TmTask subTask : subTasks) {
MaMachineIntelligentVO intelVO = new MaMachineIntelligentVO();
//getIntelligentCode 值为例A101 获取门类码
intelVO.setCategoryCode(subTask.getIntelligentCode().substring(0,1));
intelVO.setCategoryCode(subTask.getIntelligentCode().substring(0, 1));
//获取分类码
intelVO.setClassifyCode(subTask.getIntelligentCode().substring(1,2));
intelVO.setClassifyCode(subTask.getIntelligentCode().substring(1, 2));
//获取机具码
intelVO.setMachineryCode(subTask.getIntelligentCode().substring(2));
intelVO.setInspectorUnitName("123");
@ -1543,7 +1595,7 @@ public class TmTaskServiceImpl implements TmTaskService {
intelVO.setValidityDate(DateUtils.getDate());
//每个设备不同点的设置
String ownerCode = loginUser.getSysUser().getDept().getEnterpriseOwnershipCode();
if (StringUtils.isEmpty(ownerCode)){
if (StringUtils.isEmpty(ownerCode)) {
ownerCode = "CSG";
}
intelVO.setDeviceCode(StringUtils.getDeviceCode(ownerCode, subTask.getIntelligentCode(), subTask.getCreateTime(), subTask.getMaId()));
@ -1562,7 +1614,7 @@ public class TmTaskServiceImpl implements TmTaskService {
Integer status = BigDecimal.ZERO.intValue();
if (status.equals(code)) {
String dataResultString = object.getString("result");
return dataResultString;
return dataResultString;
}
throw new Exception("推送失败");
}

View File

@ -59,6 +59,11 @@ public class BmProjectLot {
@Excel(name = "所属工程")
@ApiModelProperty(value = "所属工程")
private String ownPro;
/**
* 所属工程
*/
@ApiModelProperty(value = "所属工程")
private String proName;
/**
* 所属上级
*/

View File

@ -0,0 +1,14 @@
package com.bonus.sgzb.base.domain;
import lombok.Data;
/**
* @Authorliang.chao
* @Date2025/3/11 - 13:26
*/
@Data
public class RepairContent {
private String repairRemark;
private String repairContent;
}

View File

@ -33,6 +33,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* @author c liu
@ -67,13 +68,23 @@ public class RepairServiceImpl implements RepairService {
BigDecimal cost = partPrice.multiply(new BigDecimal(bean.getPartNum())).setScale(2, RoundingMode.HALF_UP);
return cost;
}
private final static String STRING_ADMIN = "admin";
@Override
public List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean) {
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
bean.setCompanyId(companyId);
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
List<RepairTaskDetails> repairMaTypeList = mapper.getRepairMaTypeList(bean);
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
List<RepairTaskDetails> repairMaTypeList = new ArrayList<>();
if (roles.contains(STRING_ADMIN)) {
repairMaTypeList = mapper.getRepairMaTypeList(bean);
}else{
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
bean.setCompanyId(companyId);
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
repairMaTypeList = mapper.getRepairMaTypeList(bean);
}
if (!CollectionUtils.isEmpty(repairMaTypeList)) {
for (RepairTaskDetails repairTaskDetails : repairMaTypeList) {
// 根据合格数量和报废数量对数据状态status重新定值完成状态,考虑维修查看页面的展示

View File

@ -88,6 +88,15 @@ public class RepairAuditDetailsController extends BaseController {
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
return getDataTable(list);
}
/**
* 查看保养记录表
*/
@ApiOperation("查看修饰审核任务详细列表")
@GetMapping("/getMaintenanceRecords")
public AjaxResult getMaintenanceRecords(RepairAuditDetails repairAuditDetails) {
ScrapApplyDetailsVO vo = repairAuditDetailsService.getMaintenanceRecords(repairAuditDetails);
return AjaxResult.success(vo);
}
/**
* 查看维修记录

View File

@ -65,6 +65,11 @@ public class AgreementInfo extends BaseEntity {
*/
@ApiModelProperty(value = "工程标段ID")
private Long projectId;
/**
* 工程标段ID
*/
@ApiModelProperty(value = "工程标段ID")
private Long[] projectIds;
/**
* 工程标段

View File

@ -7,15 +7,17 @@ import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.sgzb.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 新购验收任务详细purchase_check_details对象 purchase_check_details
*
*
* @author bonus
* @date 2023-12-10
*/
@Data
public class PurchaseCheckDetails extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -116,21 +118,27 @@ public class PurchaseCheckDetails extends BaseEntity
@ApiModelProperty(value = "关键字筛选")
private String keyWord;
public void setTaskId(Long taskId)
@ApiModelProperty(value = "制造厂家id")
private Long purveyorId;
@ApiModelProperty(value = "制造厂家名称")
private String purveyorName;
public void setTaskId(Long taskId)
{
this.taskId = taskId;
}
public Long getTaskId()
public Long getTaskId()
{
return taskId;
}
public void setTypeId(Long typeId)
public void setTypeId(Long typeId)
{
this.typeId = typeId;
}
public Long getTypeId()
public Long getTypeId()
{
return typeId;
}
@ -152,30 +160,30 @@ public class PurchaseCheckDetails extends BaseEntity
{
return purchaseNum;
}
public void setSupplierId(Long supplierId)
public void setSupplierId(Long supplierId)
{
this.supplierId = supplierId;
}
public Long getSupplierId()
public Long getSupplierId()
{
return supplierId;
}
public void setProductionTime(Date productionTime)
public void setProductionTime(Date productionTime)
{
this.productionTime = productionTime;
}
public Date getProductionTime()
public Date getProductionTime()
{
return productionTime;
}
public void setCompanyId(Long companyId)
public void setCompanyId(Long companyId)
{
this.companyId = companyId;
}
public Long getCompanyId()
public Long getCompanyId()
{
return companyId;
}

View File

@ -2,7 +2,9 @@ package com.bonus.sgzb.material.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.bonus.sgzb.base.api.domain.FileInfo;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.sgzb.common.core.annotation.Excel;
@ -99,6 +101,9 @@ public class RepairAuditDetails extends BaseEntity
private String keyword;
private String typeName;
@ApiModelProperty(value = "维修审核附件上传")
private List<FileInfo> fileList;
public void setId(Long id)
{
this.id = id;

View File

@ -33,6 +33,7 @@ public class TreeNode {
private float num;
private String modelCode;
private String isStorage;
private String manageType;

View File

@ -1,5 +1,8 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.api.domain.FileInfo;
import com.bonus.sgzb.base.domain.RepairApplyRecord;
import com.bonus.sgzb.base.domain.RepairContent;
import com.bonus.sgzb.material.domain.RepairAuditDetails;
import com.bonus.sgzb.material.domain.RepairPart;
import com.bonus.sgzb.material.domain.RepairRecord;
@ -149,4 +152,10 @@ public interface RepairAuditDetailsMapper
List<String> getRepairApplyRecordId(Long repairId);
void updateRecodeStatus(String id);
ScrapApplyDetailsVO getMaintenanceRecords(RepairAuditDetails repairAuditDetails);
List<RepairContent> getRepairContent(ScrapApplyDetailsVO scrapApplyDetailsVO);
List<FileInfo> getfileList(RepairAuditDetails auditDetails);
}

View File

@ -97,5 +97,7 @@ public interface IRepairAuditDetailsService
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails);
ScrapApplyDetailsVO getMaintenanceRecords(RepairAuditDetails repairAuditDetails);
}

View File

@ -160,7 +160,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
TmTask task = new TmTask();
// 暂定的状态字典表
task.setTaskType(23);
task.setTaskStatus(24);
task.setTaskStatus(26);
// 采购单号
task.setCode(purchaseCodeRule());
task.setCreateTime(DateUtils.getNowDate());
@ -176,7 +176,12 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
if (checkDetailsList != null) {
for (PurchaseCheckDetails purchaseCheckDetails : checkDetailsList) {
purchaseCheckDetails.setTaskId(task.getTaskId());
purchaseCheckDetails.setStatus(2);
purchaseCheckDetails.setStatus(1);
//新购通知验收合并为一步
purchaseCheckDetails.setCheckNum(purchaseCheckDetails.getPurchaseNum());
if ("1".equals(purchaseCheckDetails.getManageType())){
purchaseCheckDetails.setBindNum(purchaseCheckDetails.getPurchaseNum());
}
}
purchaseCheckDetailsMapper.insertPurchaseCheckDetailsList(checkDetailsList);
}

View File

@ -5,7 +5,12 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
import com.bonus.sgzb.base.api.domain.FileInfo;
import com.bonus.sgzb.base.domain.RepairApplyRecord;
import com.bonus.sgzb.base.domain.RepairContent;
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
@ -20,6 +25,7 @@ import com.bonus.sgzb.material.vo.GlobalContants;
import com.bonus.sgzb.material.vo.RepairAuditDetailsVO;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -49,6 +55,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
@Resource
private RepairTestInputMapper repairTestInputMapper;
@Resource
private BackReceiveMapper backReceiveMapper;
/**
* 查询修试审核详细repair_apply_details
@ -154,6 +163,26 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
return list;
}
@Override
public ScrapApplyDetailsVO getMaintenanceRecords(RepairAuditDetails repairAuditDetails) {
ScrapApplyDetailsVO scrapApplyDetailsVO = repairAuditDetailsMapper.getMaintenanceRecords(repairAuditDetails);
if (scrapApplyDetailsVO != null) {
// 查询技术鉴定情况和维修处理情况
if (StringUtils.isNotBlank(scrapApplyDetailsVO.getMaId())) {
List<RepairContent> records = new ArrayList<>();
for (String s : scrapApplyDetailsVO.getMaId().split(",")) {
scrapApplyDetailsVO.setMaId(s);
records.addAll(repairAuditDetailsMapper.getRepairContent(scrapApplyDetailsVO));
}
scrapApplyDetailsVO.setRecords(records);
} else {
List<RepairContent> repairContent = repairAuditDetailsMapper.getRepairContent(scrapApplyDetailsVO);
scrapApplyDetailsVO.setRecords(repairContent);
}
}
return scrapApplyDetailsVO;
}
/**
* @param repairAuditDetails
* @return
@ -161,6 +190,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
@Override
public List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails) {
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
for (RepairAuditDetails auditDetails : repairAuditDetailsList) {
List<FileInfo> fileList= repairAuditDetailsMapper.getfileList(auditDetails);
auditDetails.setFileList(fileList);
}
return repairAuditDetailsList;
}
@ -175,6 +208,22 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
public int auditRepair(ScrapAudit scrapAudit) throws Exception {
String checkResult = scrapAudit.getCheckResult();
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
for (RepairAuditDetails repairAuditDetails : auditDetailList) {
// 添加附件
List<FileInfo> fileList = repairAuditDetails.getFileList();
if (fileList != null) {
for (FileInfo fileInfo : fileList) {
fileInfo.setModelId(repairAuditDetails.getTaskId());
fileInfo.setTypeId(fileInfo.getTypeId());
if (fileInfo.getMaId() != null) {
fileInfo.setMaId(fileInfo.getMaId());
}
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
fileInfo.setCreateTime(DateUtils.getNowDate());
backReceiveMapper.insertBmFileInfo(fileInfo);
}
}
}
List<Long> taskIdList = scrapAudit.getTaskIdList();
Integer b = 0;
for (Long taskId : taskIdList) {
@ -206,6 +255,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
}
}
} else {
// 批量审核
// 获取维修列表
repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
//获取维修报废列表
scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
@ -221,8 +272,6 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
taskType = 50;
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
for (RepairAuditDetails inputDetails : repairInputList) {
Long typeId = inputDetails.getTypeId();
Long maId = inputDetails.getMaId();
Integer repairNum = inputDetails.getRepairedNum();
// 创建修饰后入库任务
if (repairNum.compareTo(b) > 0) {
@ -240,7 +289,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairInputDetails.setCompanyId((long) companyId);
repairTestInputMapper.insertRepairInputDetails(repairInputDetails);
}
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
repairAuditDetailsMapper.updateRepairCost(inputDetails, status);
// 根据repairId找到taskId和 typeId maid
List<String> repairApplyRecordId = repairAuditDetailsMapper.getRepairApplyRecordId(inputDetails.getRepairId());
// 再去repair_apply_record 中查并给一个标识表示审核完成
@ -266,7 +315,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
// 创建报废任务
Integer scrapNum = scrapDetails.getScrapNum();
if (scrapNum.compareTo(b) > 0) {
for (RepairRecord bean : repairRecord){
for (RepairRecord bean : repairRecord) {
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
scrapApplyDetails.setTaskId(scrapTaskId);
scrapApplyDetails.setTypeId(typeId);
@ -316,7 +365,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
for (RepairAuditDetails inputDetails : repairDetailList) {
Long backId = repairAuditDetailsMapper.getBackId(inputDetails.getRepairId());
/* 添加驳回后维修详细表数据*/
/* 添加驳回后维修详细表数据*/
RepairTaskDetails repairTaskDetails = new RepairTaskDetails();
repairTaskDetails.setTaskId(String.valueOf(inputTaskId));
repairTaskDetails.setMaId(inputDetails.getMaId());
@ -329,7 +378,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairTaskDetails.setBackId(backId);
repairAuditDetailsMapper.insertRepairDetails(repairTaskDetails);
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
repairAuditDetailsMapper.updateRepairCost(inputDetails, status);
}
}
// 修饰审核任务不通过时
@ -392,20 +441,22 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
}
/**采购单号编码生成规则*/
/**
* 采购单号编码生成规则
*/
private String purchaseCodeRule(String code, Integer taskType) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
if (StringHelper.isNotEmpty(taskNum)){
if (StringHelper.isNotEmpty(taskNum)) {
// 将字符串转换为整数
int num = Integer.parseInt(taskNum);
// 执行加一操作
num++;
// 将结果转换回字符串格式并确保结果是四位数不足四位则在前面补0
taskNum = String.format("%04d", num);
}else {
} else {
taskNum = "0001";
}
String codeNum = code + format + "-" + taskNum;

View File

@ -1,9 +1,12 @@
package com.bonus.sgzb.material.vo;
import com.bonus.sgzb.base.domain.RepairContent;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.bonus.sgzb.material.domain.ScrapAuditorSet;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.List;
@ -19,6 +22,12 @@ public class ScrapApplyDetailsVO {
* 任务id
*/
private Long taskId;
private Integer typeId;
private String maId;
/**
* 维修任务id
*/
private Long repairTaskId;
/**
* 报废审核单号
@ -31,6 +40,10 @@ public class ScrapApplyDetailsVO {
*/
@Excel(name = "单位名称",sort = 2)
private String unitName;
/**
* 单位名称
*/
private String checkMan;
/**
* 工程名称
@ -59,6 +72,10 @@ public class ScrapApplyDetailsVO {
*/
@Excel(name = "维修单号",sort = 6)
private String repairNum;
/**
* 维修前备注
*/
private String repairRemark;
/**
* 审核状态
@ -118,6 +135,14 @@ public class ScrapApplyDetailsVO {
* 处置
*/
private Integer disposition;
/**
* 维修合格数量
*/
private Integer repairedNum;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private String auditTime;
/**
* 文件地址
@ -128,4 +153,8 @@ public class ScrapApplyDetailsVO {
* 文件名称
*/
private String dispositionFileName;
/**
* 维修记录文档备注
*/
private List<RepairContent> records;
}

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.vo;
import com.bonus.sgzb.base.api.domain.FileInfo;
import com.bonus.sgzb.material.domain.RepairAuditDetails;
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import io.swagger.annotations.ApiModelProperty;

View File

@ -123,11 +123,11 @@
insert into lease_apply_details (parennt_id, type_id, pre_num,
al_num, `status`, create_by,
create_time, update_by, update_time,
remark, company_id,type_name,model_name,lease_price,replace_type_id)
remark, company_id,type_name,model_name,lease_price,replace_type_id,ct_parent_id,is_ct,sets_num)
values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT},
#{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
NOW(), #{updateBy,jdbcType=VARCHAR}, NOW(),
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},#{typeName},#{maModel},#{leasePrice},#{replaceTypeId})
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},#{typeName},#{maModel},#{leasePrice},#{replaceTypeId},#{ctParentId},#{isCt},#{setsNum})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.app.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
@ -404,13 +404,13 @@
<!--@mbg.generated-->
insert into lease_apply_details
(parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id,ct_parent_id,is_ct)
update_time, remark, company_id,ct_parent_id,is_ct,sets_num)
values
<foreach collection="list" item="item" separator=",">
(#{item.parenntId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=INTEGER},
#{item.alNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
NOW(), #{item.updateBy,jdbcType=VARCHAR}, NOW(),
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.ctParentId,jdbcType=INTEGER}, IFNULL(#{item.isCt}, '1'))
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.ctParentId,jdbcType=INTEGER}, IFNULL(#{item.isCt}, '1'),#{item.setsNum,jdbcType=INTEGER})
</foreach>
</insert>

View File

@ -1092,6 +1092,7 @@
lad.ct_parent_id as ctParentId,
lad.is_ct as isCt,
lad.replace_type_id as replaceTypeId,
lad.sets_num as setsNum,
lad.lease_price as leasePrice
FROM
lease_apply_details lad
@ -1102,6 +1103,7 @@
LEFT JOIN sys_user su on mtk.user_id = su.user_id
WHERE
lad.parennt_id = #{id}
and mt.is_storage = 1
<if test="userId != 1">
and mtk.user_id = #{userId}
</if>
@ -1277,4 +1279,59 @@
tt.code
</select>
<select id="getLeaseOutList" resultMap="BaseResultMap">
SELECT
tt.*,
lai.id AS id,
bpl.lot_id AS proId,
bpl.lot_name AS proName,
bui.unit_id AS unitId,
bui.unit_name AS unitName,
lai.lease_person AS leasePerson,
lai.phone AS leasePhone,
tt.create_by AS applyFor,
d.`name` AS taskName,
lai.lease_type AS leaseType,
d.id AS examineStatusId,
bai.agreement_code AS agreementCode,
tt.create_time AS createTimes,
IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum,
tt.update_time AS updateTimes
from
lease_apply_info lai
LEFT JOIN tm_task tt on lai.task_id = tt.task_id
LEFT JOIN sys_dic d ON d.id = tt.task_status
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN lease_apply_details lad on lai.id = lad.parennt_id
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
WHERE tt.task_status in(33,34,35)
<if test="userId != 1">
and mtk.user_id = #{userId}
</if>
<if test="code != null and code != ''">
and tt.code like concat('%', #{code}, '%')
</if>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="proId != null">
and bpl.lot_id = #{proId}
</if>
<if test="taskStatus != null">
and tt.task_status = #{taskStatus}
</if>
GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc
</select>
<select id="getParentNameById" resultType="java.lang.String">
select whole_type_name from ma_whole_set where parent_id = #{ctParentId} limit 1
</select>
<select id="getAscriptionTypeByTypeId" resultType="java.lang.String">
select whole_type_name from ma_whole_set where parent_id = #{typeId} and ascription_type = 1 limit 1
</select>
</mapper>

View File

@ -46,8 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--<include refid="bmProjectInfo"/>-->
select a.lot_id, a.pro_id, a.lot_name, a.status, a.type_id, a.link_man, a.telphone, a.own_pro, a.dept_id, a.is_share,
a.lon, a.lat, a.del_flag, a.create_by, a.create_time,a.remark,a.company_id ,b.dept_name, c.name,a.cost_indicators,
a.longitude, a.latitude, a.address, a.province,a.details_address,a.completion_date,a.start_date
a.longitude, a.latitude, a.address, a.province,a.details_address,a.completion_date,a.start_date,bpi.pro_name
from bm_project_lot a
left join bm_project_info bpi on a.pro_id = bpi.pro_id
left join sys_dept b on a.dept_id = b.dept_id
left join sys_dic c on a.type_id = c.id
where a.del_flag ='0'
@ -237,7 +238,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotName != null and lotName != ''">lot_name = #{lotName},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="typeId != null and typeId != ''">type_id = #{typeId},</if>
<if test="ownPro != null and ownPro != '' ">own_pro = #{ownPro},</if>
<if test="proId != null and proId != '' ">pro_id = #{proId},</if>
<if test="linkMan != null and linkMan != ''">link_man = #{linkMan},</if>
<if test="telphone != null and telphone != ''">telphone = #{telphone},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>

View File

@ -307,7 +307,11 @@
left join sys_user su on rad.repairer = su.user_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN ma_type_repair mtr on mtr.type_id = rad.type_id
where rad.task_id = #{taskId} and mtr.user_id = #{userId}
where rad.task_id = #{taskId}
<if test="userId != null and userId != ''">
and mtr.user_id = #{userId}
</if>
<if test="companyId != null and companyId != ''">
and rad.company_id = #{companyId}
</if>

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper">
<resultMap type="com.bonus.sgzb.material.domain.PurchaseCheckDetails" id="PurchaseCheckDetailsResult">
<result property="id" column="id" />
<result property="taskId" column="task_id" />
@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fileName" column="file_name" />
<result property="fileUrl" column="file_url" />
<result property="companyId" column="company_id" />
<result property="purveyorId" column="purveyor_id" />
</resultMap>
<sql id="selectPurchaseCheckDetailsVo">
@ -36,11 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pcd.supplier_id, pcd.status, msi.supplier, pcd.create_by, pcd.production_time, pcd.create_time, pcd.check_url_name,
pcd.check_url, pcd.file_name, pcd.file_url,pcd.update_by, pcd.update_time, pcd.remark, pcd.company_id,
mt1.type_name machineTypeName,mt.type_name specificationType, mt.manage_type manageType, tk.code ,mt.type_name typeName,
mt.unit_name unitName
mt.unit_name unitName,pcd.purveyor_id,msi2.supplier as purveyorName
from purchase_check_details pcd
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 ma_supplier_info msi on pcd.supplier_id = msi.supplier_id
left join ma_supplier_info msi2 on pcd.purveyor_id = msi2.supplier_id
left join tm_task tk on pcd.task_id = tk.task_id
where 1=1
<if test="taskId != null ">and pcd.task_id = #{taskId}</if>
@ -55,12 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productionTime != null ">and pcd.production_time = #{productionTime}</if>
<if test="companyId != null ">and pcd.company_id = #{companyId}</if>
</select>
<select id="selectPurchaseCheckDetailsByTaskId" parameterType="Long" resultMap="PurchaseCheckDetailsResult">
<include refid="selectPurchaseCheckDetailsVo"/>
where task_id = #{taskId}
</select>
<insert id="insertPurchaseCheckDetails" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckDetails" useGeneratedKeys="true" keyProperty="taskId">
insert into purchase_check_details
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -139,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deletePurchaseCheckDetailsByTaskIds" parameterType="String">
delete from purchase_check_details where task_id in
delete from purchase_check_details where task_id in
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
@ -168,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkDetails.fileName != null">file_name,</if>
<if test="checkDetails.fileUrl != null">file_url,</if>
<if test="checkDetails.companyId != null">company_id,</if>
<if test="checkDetails.purveyorId != null">purveyor_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkDetails.taskId != null">#{checkDetails.taskId},</if>
@ -189,6 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkDetails.fileName != null">#{checkDetails.fileName},</if>
<if test="checkDetails.fileUrl != null">#{checkDetails.fileUrl},</if>
<if test="checkDetails.companyId != null">#{checkDetails.companyId},</if>
<if test="checkDetails.purveyorId != null">#{checkDetails.purveyorId},</if>
</trim>
</foreach>
</insert>
@ -276,4 +280,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
</mapper>
</mapper>

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.RepairAuditDetailsMapper">
<resultMap type="com.bonus.sgzb.material.domain.RepairAuditDetails" id="RepairAuditDetailsResult">
<result property="id" column="id" />
<result property="taskId" column="task_id" />
@ -70,12 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by rad.create_time desc
</select>
<select id="selectRepairAuditDetailsById" parameterType="Long" resultMap="RepairAuditDetailsResult">
<include refid="selectRepairAuditDetailsVo"/>
where id = #{id}
</select>
<insert id="insertRepairAuditDetails" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails">
insert into repair_audit_details
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -232,7 +232,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteRepairAuditDetailsByIds" parameterType="String">
delete from repair_audit_details where id in
delete from repair_audit_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
@ -469,5 +469,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
rc.repair_id = #{repairId}
</select>
<select id="getMaintenanceRecords" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
SELECT
tk.task_id taskId,
tk.CODE repairCode,
bui.unit_name unitName,
bpl.lot_name projectName,
su.nick_name createBy,
su1.nick_name as checkMan,
rad.type_id,
mt.type_name,
mt1.type_name type,
GROUP_CONCAT(rad.ma_id) as maId,
rad.repaired_num,
rad.audit_time,
mm.ma_code,
GROUP_CONCAT(COALESCE(mm.ma_code, ''), '-', COALESCE(rd.repair_remark, '')) AS repairRemark,
rd.task_id repairTaskId
FROM
tm_task tk
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
LEFT JOIN repair_apply_details rd ON rad.repair_id = rd.id
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ma_machine mm ON mt.type_id = mm.type_id
AND rad.ma_id = mm.ma_id
LEFT JOIN sys_user su ON su.user_id = tk.create_by
LEFT JOIN sys_user su1 ON su1.user_id = rad.audit_by
WHERE
tk.task_type = 45
AND tk.task_id = #{taskId}
AND rad.repaired_num > 0
GROUP BY rad.type_id
ORDER BY
tk.create_time DESC
</select>
<select id="getRepairContent" resultType="com.bonus.sgzb.base.domain.RepairContent">
SELECT
CONCAT(COALESCE ( mm.ma_code, '' ),COALESCE ( rar.repair_remark, '' )) as repairRemark,
CONCAT(
COALESCE ( mm.ma_code, '' ),
COALESCE ( mpt.pa_name, '' ),
COALESCE ( rar.repair_content, '' )) AS repairContent
FROM
repair_apply_record rar
left join repair_part_details rpd on rar.part_id = rpd.part_id and rar.task_id = rpd.task_id
left join ma_part_type mpt ON mpt.pa_id = rpd.part_id
LEFT JOIN ma_machine mm ON mm.ma_id = rar.ma_id
WHERE
rar.task_id = #{repairTaskId} and rar.type_id = #{typeId}
<if test="maId != null">
and rar.ma_id = #{maId}
</if>
</select>
<select id="getfileList" resultType="com.bonus.sgzb.base.api.domain.FileInfo">
SELECT
fi.*
FROM
sys_file_info fi
WHERE
fi.model_id = #{taskId}
and fi.type_id = #{typeId}
<if test="maId != null">
and fi.ma_id = #{maId}
</if>
</select>
</mapper>
</mapper>

View File

@ -140,7 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
END as num,
mt.model_code AS modelCode,
mt.manage_type AS manageType,
mt.is_replace as isReplace
mt.is_replace as isReplace,
mt.is_storage as isStorage
FROM ma_type mt
left join (SELECT mt.type_id,
mt2.type_name AS typeName,

View File

@ -136,8 +136,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="projectId != null and projectId != ''">
and bp.lot_id = #{projectId}
<if test="projectIds != null">
AND bp.lot_id IN
<foreach item="projectId" collection="projectIds" open="(" separator="," close=")">
#{projectId}
</foreach>
</if>
<if test="sltStatus != null">
and bai.is_slt = #{sltStatus}