退料接收和维修需求开发
This commit is contained in:
parent
1052d7edb0
commit
ea00df8e21
|
|
@ -38,7 +38,9 @@ public class BackApplyInfo extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "装备管理方式名称")
|
||||
private String manageTypeName;
|
||||
|
||||
@ApiModelProperty(value = "退料接收文件")
|
||||
private List<FileInfo> fileList;
|
||||
private String uid;
|
||||
/**
|
||||
* 机具管理方式
|
||||
*/
|
||||
|
|
@ -166,7 +168,7 @@ public class BackApplyInfo extends BaseEntity {
|
|||
private Integer backNum;
|
||||
|
||||
/**
|
||||
* 退料状态
|
||||
* 退料状态(1合格,2维修,3待报废)
|
||||
*/
|
||||
private String backStatus;
|
||||
|
||||
|
|
@ -381,6 +383,12 @@ public class BackApplyInfo extends BaseEntity {
|
|||
|
||||
/** 操作后库存 */
|
||||
private int postStoreNum;
|
||||
/** 维修备注 */
|
||||
private String repairRemark;
|
||||
/** 报废备注 */
|
||||
private String scrapRemark;
|
||||
/** 报废原因(1人为 2自然损坏) */
|
||||
private Integer scrapReason;
|
||||
|
||||
/** 库管员 */
|
||||
private long userId;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/3/7 - 11:27
|
||||
*/
|
||||
@Data
|
||||
public class FileInfo {
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 模块id */
|
||||
private Long modelId;
|
||||
private Integer typeId;
|
||||
private Integer maId;
|
||||
/** 文件名称 */
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 文件路径 */
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private String fileUrl;
|
||||
|
||||
/** 数据字典 */
|
||||
@ApiModelProperty(value = "数据字典")
|
||||
private Long dicId;
|
||||
|
||||
/** 创建者 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private String size;
|
||||
private String type;
|
||||
private int words;
|
||||
private String creator;
|
||||
private String uid;
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@ public enum TaskTypeEnum {
|
|||
* 报废任务
|
||||
*/
|
||||
SCRAP_TASK(57, "报废任务"),
|
||||
RETURN_TASK(36, "退料任务"),
|
||||
|
||||
//盘点报废
|
||||
TM_TASK_PART_SCRAP(141, "盘点报废");
|
||||
|
|
|
|||
|
|
@ -221,6 +221,8 @@ public class BackReceiveController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//@Log(title = "退料接收-结束任务", businessType = BusinessType.MATERIAL)
|
||||
@PreventRepeatSubmit
|
||||
@PostMapping("endBack")
|
||||
|
|
@ -236,6 +238,11 @@ public class BackReceiveController extends BaseController {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@GetMapping("getPreAuditNum")
|
||||
public AjaxResult getPreAuditNum(BackApplyInfo record) {
|
||||
Integer num = backReceiveService.getPreAuditNum(record);
|
||||
return AjaxResult.success(num);
|
||||
}
|
||||
|
||||
@Log(title = "退料接收-编号查询", businessType = BusinessType.INSERT)
|
||||
@PostMapping("codeQuery")
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.app.mapper;
|
|||
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -204,7 +205,7 @@ public interface BackReceiveMapper {
|
|||
|
||||
int selectTaskStatus(int taskId);
|
||||
|
||||
BackApplyInfo backReceiveRecordWeb(BackApplyInfo record);
|
||||
List<BackApplyInfo> backReceiveRecordWeb(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> getCtList(BackApplyInfo record);
|
||||
|
||||
|
|
@ -213,4 +214,10 @@ public interface BackReceiveMapper {
|
|||
int finishBackCheckDetails(BackApplyInfo record);
|
||||
|
||||
void updateBackReceiveTime(BackApplyInfo record);
|
||||
|
||||
Integer insertBmFileInfo(FileInfo fileInfo);
|
||||
|
||||
Integer deleteFile(BackApplyInfo record);
|
||||
|
||||
FileInfo getfileByUid(String uid);
|
||||
}
|
||||
|
|
@ -113,4 +113,6 @@ public interface BackReceiveService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult getDetailsReceiveList(BackApplyInfo record);
|
||||
|
||||
Integer getPreAuditNum(BackApplyInfo record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ import com.bonus.sgzb.app.domain.TmTask;
|
|||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||
import com.bonus.sgzb.app.mapper.TmTaskMapper;
|
||||
import com.bonus.sgzb.app.service.BackReceiveService;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.base.mapper.MaMachineMapper;
|
||||
import com.bonus.sgzb.base.service.ISysConfigService;
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
|
|
@ -17,9 +14,13 @@ import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
|||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.HttpHelper;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.TypeTreeNode;
|
||||
import com.bonus.sgzb.material.mapper.BackApplyMapper;
|
||||
import com.bonus.sgzb.material.mapper.ScrapApplyDetailsMapper;
|
||||
import com.zaxxer.hikari.util.FastList;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -51,11 +52,13 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
@Resource
|
||||
private TmTaskMapper tmTaskMapper;
|
||||
|
||||
@Resource
|
||||
private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
|
||||
|
||||
@Autowired
|
||||
private BackApplyMapper backApplyMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> getbackReceiveList(BackApplyInfo record) {
|
||||
return backReceiveMapper.getbackReceiveList(record);
|
||||
|
|
@ -154,7 +157,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
throw new RuntimeException("修改updateTaskStatus异常");
|
||||
}
|
||||
//插入back_check_details
|
||||
res = insertBcd(record);
|
||||
res = insertBcdCode(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
|
|
@ -197,6 +200,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int maintenanceNum = 0;
|
||||
int scrapNum = 0;
|
||||
record.setTypeId(bai.getTypeId());
|
||||
//获取库存
|
||||
int num = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setNum(num);
|
||||
|
||||
|
|
@ -444,12 +448,23 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
public List<BackApplyInfo> backReceiveRecordWeb(BackApplyInfo record) {
|
||||
String typeId = record.getTypeId();
|
||||
String[] split = typeId.split(",");
|
||||
|
||||
List<BackApplyInfo> backApplyInfoList = new ArrayList<>();
|
||||
for (String s : split) {
|
||||
record.setTypeId(s);
|
||||
BackApplyInfo backApplyInfo = backReceiveMapper.backReceiveRecordWeb(record);
|
||||
List<BackApplyInfo> backApplyInfo = backReceiveMapper.backReceiveRecordWeb(record);
|
||||
for (BackApplyInfo applyInfo : backApplyInfo) {
|
||||
if (StringUtils.isNotBlank(applyInfo.getUid())) {
|
||||
List<FileInfo> fileList = new ArrayList<>();
|
||||
for (String uid : applyInfo.getUid().split(",")) {
|
||||
FileInfo fileInfo = backReceiveMapper.getfileByUid(uid);
|
||||
fileList.add(fileInfo);
|
||||
}
|
||||
applyInfo.setFileList(fileList);
|
||||
}
|
||||
}
|
||||
if (backApplyInfo != null) {
|
||||
backApplyInfoList.add(backApplyInfo);
|
||||
backApplyInfoList.addAll(backApplyInfo);
|
||||
}
|
||||
}
|
||||
return backApplyInfoList;
|
||||
|
|
@ -465,9 +480,19 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
List<BackApplyInfo> backApplyInfo = backReceiveMapper.backReceiveRecordWebPt(record);
|
||||
if (backApplyInfo != null) {
|
||||
for (BackApplyInfo applyInfo : backApplyInfo) {
|
||||
backApplyInfoList.add(applyInfo);
|
||||
if (StringUtils.isNotBlank(applyInfo.getUid())) {
|
||||
List<FileInfo> fileList = new ArrayList<>();
|
||||
for (String uid : applyInfo.getUid().split(",")) {
|
||||
FileInfo fileInfo = backReceiveMapper.getfileByUid(uid);
|
||||
fileList.add(fileInfo);
|
||||
}
|
||||
applyInfo.setFileList(fileList);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (backApplyInfo != null) {
|
||||
backApplyInfoList.addAll(backApplyInfo);
|
||||
}
|
||||
}
|
||||
return backApplyInfoList;
|
||||
}
|
||||
|
|
@ -503,6 +528,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
|
||||
/**
|
||||
* 退料接收明细
|
||||
*
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -538,6 +564,11 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return AjaxResult.success(backApplyInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getPreAuditNum(BackApplyInfo record) {
|
||||
return backApplyMapper.getPreAuditNum(record);
|
||||
}
|
||||
|
||||
public int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy) {
|
||||
int newTask;
|
||||
//生成单号
|
||||
|
|
@ -622,9 +653,70 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
|
||||
private int insertBcd(BackApplyInfo record) {
|
||||
int res = 0;
|
||||
String uid = "";
|
||||
BackApplyInfo[] arr = record.getArr();
|
||||
List<FileInfo> fileList = record.getFileList();
|
||||
if (fileList != null) {
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
uid += fileInfo.getUid() + ",";
|
||||
fileInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setDicId(Long.valueOf(TaskTypeEnum.RETURN_TASK.getCode()));
|
||||
fileInfo.setModelId(arr[0].getParentId().longValue());
|
||||
fileInfo.setUid(fileInfo.getUid());
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
if (arr.length > 0) {
|
||||
for (int i = 0; i < arr.length; i++) {
|
||||
arr[i].setUid(uid);
|
||||
res = backReceiveMapper.insertCheckDetails(arr[i]);
|
||||
String manageType = arr[i].getManageType();
|
||||
if ("0".equals(manageType)) {
|
||||
String backStatus = arr[i].getBackStatus();
|
||||
int maId = arr[i].getMaId();
|
||||
if ("1".equals(backStatus)) {
|
||||
//退料合格状态变为退料带入库84
|
||||
backReceiveMapper.updateMaStatus(maId, "84");
|
||||
}
|
||||
if ("2".equals(backStatus)) {
|
||||
//退料维修状态变为退料待检修17
|
||||
backReceiveMapper.updateMaStatus(maId, "17");
|
||||
}
|
||||
if ("3".equals(backStatus)) {
|
||||
//退料待报废状态变为退料待报废20
|
||||
backReceiveMapper.updateMaStatus(maId, "20");
|
||||
//在任务表中创建一个报废任务
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int insertBcdCode(BackApplyInfo record) {
|
||||
int res = 0;
|
||||
BackApplyInfo[] arr = record.getArr();
|
||||
|
||||
if (arr.length > 0) {
|
||||
for (int i = 0; i < arr.length; i++) {
|
||||
if (arr[i].getFileList() != null) {
|
||||
String uid = "";
|
||||
for (FileInfo fileInfo : arr[i].getFileList()) {
|
||||
uid += fileInfo.getUid() + ",";
|
||||
fileInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setDicId(Long.valueOf(TaskTypeEnum.RETURN_TASK.getCode()));
|
||||
fileInfo.setModelId(arr[i].getParentId().longValue());
|
||||
fileInfo.setTypeId(Integer.parseInt(arr[i].getTypeId()));
|
||||
fileInfo.setMaId(arr[i].getMaId());
|
||||
fileInfo.setUid(fileInfo.getUid());
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
arr[i].setUid(uid);
|
||||
}
|
||||
|
||||
res = backReceiveMapper.insertCheckDetails(arr[i]);
|
||||
String manageType = arr[i].getManageType();
|
||||
if ("0".equals(manageType)) {
|
||||
|
|
@ -654,6 +746,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int res = 0;
|
||||
if (record != null) {
|
||||
String manageType = record.getManageType();
|
||||
// 编码设备
|
||||
if ("0".equals(manageType)) {
|
||||
List<Integer> maId = backReceiveMapper.getMaId(record);
|
||||
for (Integer s : maId) {
|
||||
|
|
@ -661,18 +754,20 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
backReceiveMapper.updateMaStatus(s, "16");
|
||||
}
|
||||
res = backReceiveMapper.deleteCheckDetails(record);
|
||||
} else if ("2".equals(manageType)) {
|
||||
backReceiveMapper.deleteFile(record);
|
||||
}/* else if ("2".equals(manageType)) {
|
||||
String[] split = record.getTypeIds();
|
||||
for (String s : split) {
|
||||
record.setTypeId(s);
|
||||
res = backReceiveMapper.deleteCheckDetails(record);
|
||||
}
|
||||
} else {
|
||||
}*/ else {
|
||||
// 数量设备
|
||||
res = backReceiveMapper.deleteCheckDetails(record);
|
||||
backReceiveMapper.deleteFile(record);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -686,26 +781,26 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
String format = dateFormat.format(nowDate);
|
||||
Integer taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType);
|
||||
|
||||
String taskNumStr = "";
|
||||
if (taskNum != null) {
|
||||
// 将字符串转换为整数
|
||||
String taskNumStr = "";
|
||||
if (taskNum != null) {
|
||||
// 将字符串转换为整数
|
||||
// int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
taskNum++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNumStr = String.format("%04d", taskNum);
|
||||
} else {
|
||||
taskNumStr = "0001";
|
||||
}
|
||||
String code = "";
|
||||
if (TaskTypeEnum.MAINTENANCE_TASK.getCode().equals(taskType)) {
|
||||
code = TaskTypeConstants.WX;
|
||||
}
|
||||
|
||||
if (TaskTypeEnum.RETURNED_MATERIALS_TO_BE_SCRAPPED.getCode().equals(taskType)) {
|
||||
code = TaskTypeConstants.YBF;
|
||||
}
|
||||
code = code + format + "-" + taskNumStr;
|
||||
return code;
|
||||
// 执行加一操作
|
||||
taskNum++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNumStr = String.format("%04d", taskNum);
|
||||
} else {
|
||||
taskNumStr = "0001";
|
||||
}
|
||||
String code = "";
|
||||
if (TaskTypeEnum.MAINTENANCE_TASK.getCode().equals(taskType)) {
|
||||
code = TaskTypeConstants.WX;
|
||||
}
|
||||
|
||||
if (TaskTypeEnum.RETURNED_MATERIALS_TO_BE_SCRAPPED.getCode().equals(taskType)) {
|
||||
code = TaskTypeConstants.YBF;
|
||||
}
|
||||
code = code + format + "-" + taskNumStr;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -113,6 +114,15 @@ public class RepairController extends BaseController {
|
|||
AjaxResult ajaxResult = service.submitRepairApply(bean);
|
||||
return ajaxResult;
|
||||
}
|
||||
/**
|
||||
* 新增维修记录
|
||||
*/
|
||||
@ApiOperation(value = "根据partId和数量查询配件总价")
|
||||
@GetMapping("/getCostByPidAndNum")
|
||||
public AjaxResult getCostByPidAndNum(RepairApplyRecord bean) {
|
||||
BigDecimal cost = service.getCostByPidAndNum(bean);
|
||||
return AjaxResult.success(cost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 快捷维修记录
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -91,7 +92,7 @@ public class RepairApplyRecord implements Serializable {
|
|||
* 配件数量
|
||||
*/
|
||||
@ApiModelProperty(value = "配件数量")
|
||||
private int partNum;
|
||||
private Integer partNum;
|
||||
/**
|
||||
* 配件单价
|
||||
*/
|
||||
|
|
@ -112,6 +113,7 @@ public class RepairApplyRecord implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value = "配件名称")
|
||||
private String partName;
|
||||
private String repairRemark;
|
||||
/**
|
||||
* 维修人
|
||||
*/
|
||||
|
|
@ -126,4 +128,6 @@ public class RepairApplyRecord implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value = "损坏照片id")
|
||||
private String fileIds;
|
||||
|
||||
private List<FileInfo> fileList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.FileInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author c liu
|
||||
|
|
@ -88,6 +90,8 @@ public class RepairPartDetails {
|
|||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
@ApiModelProperty(value = "维修备注")
|
||||
private String repairRemark;
|
||||
/**
|
||||
* 维修内容
|
||||
*/
|
||||
|
|
@ -95,6 +99,7 @@ public class RepairPartDetails {
|
|||
private String repairContent;
|
||||
private Long companyId;
|
||||
private Long repairer;
|
||||
private List<FileInfo> fileList;
|
||||
@ApiModelProperty(value = "维修数量")
|
||||
private Integer repairNum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public class RepairTaskDetails {
|
|||
private String repairer;
|
||||
private String keyword;
|
||||
private String typeId;
|
||||
private String repairRemark;
|
||||
private Long companyId;
|
||||
/**
|
||||
* 任务创建人
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.sgzb.base.domain.vo.DictVo;
|
|||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -77,4 +78,6 @@ public interface RepairService {
|
|||
* @return
|
||||
*/
|
||||
List<RepairTask> exportRepairTaskList(RepairTask bean);
|
||||
|
||||
BigDecimal getCostByPidAndNum(RepairApplyRecord bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
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.RepairPartDetails;
|
||||
import com.bonus.sgzb.base.domain.RepairTask;
|
||||
|
|
@ -8,6 +10,7 @@ import com.bonus.sgzb.base.domain.vo.DictVo;
|
|||
import com.bonus.sgzb.base.mapper.RepairMapper;
|
||||
import com.bonus.sgzb.base.service.RepairService;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
|
|
@ -19,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -34,6 +38,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
@Autowired
|
||||
private TaskMapper taskMapper;
|
||||
|
||||
@Autowired
|
||||
private BackReceiveMapper backReceiveMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<RepairTask> getRepairTaskList(RepairTask bean) {
|
||||
|
|
@ -46,6 +53,13 @@ public class RepairServiceImpl implements RepairService {
|
|||
return mapper.exportRepairTaskList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getCostByPidAndNum(RepairApplyRecord bean) {
|
||||
BigDecimal partPrice = mapper.selectPartPrice(bean.getPartId().longValue());
|
||||
BigDecimal cost = partPrice.multiply(new BigDecimal(bean.getPartNum())).setScale(2, RoundingMode.HALF_UP);
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean) {
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
|
|
@ -133,17 +147,35 @@ public class RepairServiceImpl implements RepairService {
|
|||
bean.setPartNum(partDetails.getPartNum());
|
||||
bean.setRepairContent(partDetails.getRepairContent());
|
||||
bean.setPartType(partDetails.getPartType());
|
||||
bean.setPartType(partDetails.getPartType());
|
||||
bean.setRepairRemark(partDetails.getRepairRemark());
|
||||
mapper.addRecord(bean);
|
||||
} else {
|
||||
// 不选维修配件时
|
||||
bean.setRepairRemark(partDetails.getRepairRemark());
|
||||
mapper.addRecord(bean);
|
||||
}
|
||||
//文件上传新增
|
||||
if (partDetails.getFileList() != null){
|
||||
for (FileInfo fileInfo : partDetails.getFileList()) {
|
||||
fileInfo.setModelId(bean.getId());
|
||||
fileInfo.setTypeId(Integer.parseInt(bean.getTypeId()));
|
||||
if (bean.getMaId() != null){
|
||||
fileInfo.setMaId(Integer.parseInt(bean.getMaId()));
|
||||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (fcType.equals(bean.getRepairType())) {
|
||||
bean.setPartName(partList.get(0).getPartName());
|
||||
bean.setPartType(partList.get(0).getPartType());
|
||||
bean.setRepairContent(partList.get(0).getRepairContent());
|
||||
bean.setRepairRemark(partList.get(0).getRepairRemark());
|
||||
if (partList.get(0).getSupplierId() == null) {
|
||||
throw new ServiceException("请选择返厂厂家");
|
||||
} else {
|
||||
|
|
@ -156,6 +188,19 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
bean.setPartNum(partList.get(0).getPartNum());
|
||||
mapper.addRecord(bean);
|
||||
List<FileInfo> fileList = partList.get(0).getFileList();
|
||||
if (fileList != null){
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(bean.getId());
|
||||
fileInfo.setTypeId(Integer.parseInt(bean.getTypeId()));
|
||||
if (bean.getMaId() != null){
|
||||
fileInfo.setMaId(Integer.parseInt(bean.getMaId()));
|
||||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (RepairPartDetails partDetails : partList) {
|
||||
if (partDetails.getPartCost() != null) {
|
||||
|
|
@ -171,6 +216,17 @@ public class RepairServiceImpl implements RepairService {
|
|||
} else {
|
||||
// 新增预报废记录
|
||||
mapper.addRecord(bean);
|
||||
List<FileInfo> fileList = bean.getFileList();
|
||||
if (fileList != null){
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(bean.getId());
|
||||
fileInfo.setTypeId(Integer.parseInt(bean.getTypeId()));
|
||||
fileInfo.setMaId(Integer.parseInt(bean.getMaId()));
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public class BackApplyController extends BaseController {
|
|||
/**
|
||||
* 退料审核详情-不带分页
|
||||
*/
|
||||
@ApiOperation(value = "退料审核(审批/退料单)")
|
||||
@ApiOperation(value = "退料审核(退料单)")
|
||||
@GetMapping("/materialReturnNoteByExamine")
|
||||
@RequiresPermissions("return:receive:list")
|
||||
public AjaxResult materialReturnNoteByExamine(BackApplyInfo bean) {
|
||||
|
|
|
|||
|
|
@ -194,4 +194,8 @@ public interface BackApplyMapper {
|
|||
* @return
|
||||
*/
|
||||
BackApplyInfo selectCheckDetailsById(BackApplyInfo backApplyDetail);
|
||||
|
||||
List<BackApplyInfo> getBackCheckView(BackApplyInfo bean);
|
||||
|
||||
Integer getPreAuditNum(BackApplyInfo record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,16 +175,17 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
@Override
|
||||
public List<BackApplyInfo> getView(BackApplyInfo bean) {
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
if (StringUtils.isNotEmpty(bean.getBadId())) {
|
||||
/* if (StringUtils.isNotEmpty(bean.getBadId())) {
|
||||
String badId = bean.getBadId();
|
||||
String[] split = badId.split(",");
|
||||
bean.setSplit(split);
|
||||
}
|
||||
}*/
|
||||
if (companyId != null) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
}
|
||||
List<BackApplyInfo> view = backApplyMapper.getView(bean);
|
||||
// List<BackApplyInfo> view = backApplyMapper.getView(bean);
|
||||
// return getMaTypeDetails(view);
|
||||
List<BackApplyInfo> view = backApplyMapper.getBackCheckView(bean);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -246,6 +246,9 @@
|
|||
<if test="id != null">
|
||||
back_id,
|
||||
</if>
|
||||
<if test="repairRemark != null and repairRemark != ''">
|
||||
repair_remark,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
|
|
@ -280,6 +283,9 @@
|
|||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="repairRemark != null and repairRemark != ''">
|
||||
#{repairRemark},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -315,6 +321,18 @@
|
|||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="repairRemark != null and repairRemark != ''">
|
||||
repair_remark,
|
||||
</if>
|
||||
<if test="scrapRemark != null and scrapRemark != ''">
|
||||
scrap_remark,
|
||||
</if>
|
||||
<if test="scrapReason != null">
|
||||
scrap_reason,
|
||||
</if>
|
||||
<if test="uid != null and uid != ''">
|
||||
uid,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
|
|
@ -346,6 +364,18 @@
|
|||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
<if test="repairRemark != null and repairRemark != ''">
|
||||
#{repairRemark},
|
||||
</if>
|
||||
<if test="scrapRemark != null and scrapRemark != ''">
|
||||
#{scrapRemark},
|
||||
</if>
|
||||
<if test="scrapReason != null">
|
||||
#{scrapReason},
|
||||
</if>
|
||||
<if test="uid != null and uid != ''">
|
||||
#{uid},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -545,6 +575,31 @@
|
|||
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,create_time)
|
||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId},#{info.leaseType},now());
|
||||
</insert>
|
||||
<insert id="insertBmFileInfo">
|
||||
insert into sys_file_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="modelId != null">model_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
<if test="dicId != null">dic_id,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="maId != null">ma_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="uid != null and uid != ''" >uid,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="modelId != null">#{modelId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
<if test="dicId != null">#{dicId},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="maId != null">#{maId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="uid != null and uid != ''" >#{uid},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateTaskStatus">
|
||||
|
|
@ -596,6 +651,12 @@
|
|||
and ma_id = #{maId}
|
||||
</if>
|
||||
</delete>
|
||||
<delete id="deleteFile">
|
||||
delete from sys_file_info where model_id = #{parentId} and dic_id = 36 and type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
and ma_id = #{maId}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<select id="getbackReceiveList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
|
|
@ -846,6 +907,7 @@
|
|||
bcd.parent_id as parentId,
|
||||
bcd.create_by as createBy,
|
||||
bcd.ma_id as maId,
|
||||
bcd.repair_remark as repairRemark,
|
||||
bai.company_id as companyId
|
||||
FROM
|
||||
back_check_details bcd
|
||||
|
|
@ -1085,13 +1147,16 @@
|
|||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt1.type_name AS typeCode,
|
||||
ifnull(sum( bcd.back_num ), 0) AS backNum,
|
||||
SUM( CASE WHEN bcd.back_status = 1 THEN bcd.back_num ELSE 0 END ) AS hgNum,
|
||||
SUM( CASE WHEN bcd.back_status = 2 THEN bcd.back_num ELSE 0 END ) AS wxNum,
|
||||
SUM( CASE WHEN bcd.back_status = 3 THEN bcd.back_num ELSE 0 END ) AS bfNum,
|
||||
CASE WHEN bcd.back_status = 1 THEN bcd.back_num ELSE 0 END AS hgNum,
|
||||
CASE WHEN bcd.back_status = 2 THEN bcd.back_num ELSE 0 END AS wxNum,
|
||||
CASE WHEN bcd.back_status = 3 THEN bcd.back_num ELSE 0 END AS bfNum,
|
||||
mm.ma_code AS maCode,
|
||||
bcd.create_time AS backTime,
|
||||
bcd.type_id as modelId,
|
||||
bcd.repair_remark AS repairRemark,
|
||||
bcd.scrap_remark AS scrapRemark,
|
||||
bcd.scrap_reason AS scrapReason,
|
||||
bcd.uid as uid,
|
||||
bcd.back_status AS backStatus
|
||||
FROM
|
||||
back_check_details bcd
|
||||
|
|
@ -1101,11 +1166,6 @@
|
|||
WHERE
|
||||
bcd.parent_id = #{parentId}
|
||||
AND bcd.type_id = #{typeId}
|
||||
<if test="maCode != null and maCode != ''">
|
||||
and mm.ma_code like concat('%', #{maCode}, '%')
|
||||
</if>
|
||||
GROUP BY
|
||||
bcd.type_id
|
||||
ORDER BY
|
||||
bcd.create_time DESC
|
||||
</select>
|
||||
|
|
@ -1128,6 +1188,10 @@
|
|||
mm.ma_code AS maCode,
|
||||
bcd.create_time AS backTime,
|
||||
bcd.type_id AS modelId,
|
||||
bcd.repair_remark AS repairRemark,
|
||||
bcd.scrap_remark AS scrapRemark,
|
||||
bcd.scrap_reason AS scrapReason,
|
||||
bcd.uid as uid,
|
||||
bcd.back_status AS backStatus
|
||||
FROM
|
||||
back_check_details bcd
|
||||
|
|
@ -1143,5 +1207,8 @@
|
|||
ORDER BY
|
||||
bcd.create_time DESC
|
||||
</select>
|
||||
<select id="getfileByUid" resultType="com.bonus.sgzb.base.api.domain.FileInfo">
|
||||
select * from sys_file_info where uid = #{uid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.sgzb.base.mapper.RepairMapper">
|
||||
<insert id="addRecord">
|
||||
insert into repair_apply_record (task_id,ma_id,type_id,repair_num,scrap_num,repair_type,create_by,create_time,repair_content,company_id,scrap_reason,scrap_type,supplier_id,part_num,part_price,part_type,part_name,repairer,file_ids,remark,part_id)
|
||||
values (#{taskId},#{maId},#{typeId},#{repairNum},#{scrapNum},#{repairType},#{createBy},now(),#{repairContent},#{companyId},#{scrapReason},#{scrapType},#{supplierId},#{partNum},#{partPrice},#{partType},#{partName},#{repairer},#{fileIds},#{remark},#{partId});
|
||||
<insert id="addRecord" keyColumn="id" keyProperty="id" useGeneratedKeys="true" >
|
||||
insert into repair_apply_record (task_id,ma_id,type_id,repair_num,scrap_num,repair_type,create_by,create_time,repair_content,company_id,scrap_reason,scrap_type,supplier_id,part_num,part_price,part_type,part_name,repairer,file_ids,remark,part_id,repair_remark)
|
||||
values (#{taskId},#{maId},#{typeId},#{repairNum},#{scrapNum},#{repairType},#{createBy},now(),#{repairContent},#{companyId},#{scrapReason},#{scrapType},#{supplierId},#{partNum},#{partPrice},#{partType},#{partName},#{repairer},#{fileIds},#{remark},#{partId},#{repairRemark});
|
||||
</insert>
|
||||
<insert id="addPart">
|
||||
insert into repair_part_details (task_id,ma_id,type_id,part_id,part_num,part_cost,part_type,create_by,create_time,company_id,repair_content)
|
||||
|
|
@ -197,6 +197,7 @@
|
|||
mm.ma_code as code,
|
||||
rad.repair_num as repairNum,
|
||||
rad.repaired_num as repairedNum,
|
||||
rad.repair_remark as repairRemark,
|
||||
rad.scrap_num as scrapNum,
|
||||
rad.status as status,
|
||||
su.nick_name as repairer,
|
||||
|
|
|
|||
|
|
@ -1046,4 +1046,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
parent_id,
|
||||
type_id
|
||||
</select>
|
||||
<select id="getBackCheckView" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.back_person AS backPerson,
|
||||
bai.phone AS phone,
|
||||
bai.back_time as backTime,
|
||||
lot.lot_name AS lotName,
|
||||
unit.unit_name AS unitName,
|
||||
mt.type_name typeCode,
|
||||
mt.manage_type as manageType,
|
||||
mt2.type_name AS typeName,
|
||||
bagi.agreement_code as agreementCode,
|
||||
CASE WHEN bad.back_status = 1 THEN '合格'
|
||||
WHEN bad.back_status = 2 THEN '维修'
|
||||
WHEN bad.back_status = 3 THEN '待报废'
|
||||
ELSE '' END AS backStatus,
|
||||
CASE WHEN bad.back_status = 1 THEN ''
|
||||
WHEN bad.back_status = 2 THEN bad.repair_remark
|
||||
WHEN bad.back_status = 3 THEN bad.scrap_remark END AS remark,
|
||||
bad.scrap_reason,
|
||||
bad.type_id as typeId,
|
||||
bad.back_num AS num
|
||||
FROM
|
||||
back_check_details bad
|
||||
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
|
||||
LEFT JOIN tm_task tt on bai.task_id = tt.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
|
||||
LEFT JOIN bm_project_lot lot ON lot.lot_id = bagi.project_id
|
||||
LEFT JOIN bm_unit_info unit ON unit.unit_id = bagi.unit_id
|
||||
LEFT JOIN ma_type mt ON mt.type_id = bad.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
WHERE
|
||||
bai.task_id = #{taskId}
|
||||
<if test="companyId != null and companyId != ''">
|
||||
and bai.company_id = #{companyId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPreAuditNum" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
ifnull(sum(bad.pre_num),0)
|
||||
FROM
|
||||
back_apply_details bad
|
||||
LEFT JOIN back_apply_info bai ON bad.parent_id = bai.id
|
||||
LEFT JOIN tm_task tt ON tt.task_id = bai.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
||||
LEFT JOIN bm_agreement_info bb ON tta.agreement_id = bb.agreement_id
|
||||
WHERE
|
||||
tta.agreement_id = #{agreementId} and bad.type_id =#{typeId} and tt.task_status != 40
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -230,7 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_part_type mpt ON rar.part_id = mpt.pa_id
|
||||
LEFT JOIN ma_part_type mpt2 ON mpt.parent_id = mpt2.pa_id
|
||||
where rar.repair_type in (1,2) and rar.part_num != 0 and rar.status = 1
|
||||
where rar.repair_type in (1,2) and rar.part_num != 0 and rar.status = 1 and rar.part_type = 1
|
||||
<if test="taskList != null and taskList.size() > 0">
|
||||
and rar.task_id in
|
||||
<foreach item="task" collection="taskList" open="(" separator="," close=")">
|
||||
|
|
|
|||
Loading…
Reference in New Issue