维修员暂存
This commit is contained in:
parent
88923d1b22
commit
b07b7c5db9
|
|
@ -43,4 +43,6 @@ public class FileInfo {
|
|||
private int words;
|
||||
private String creator;
|
||||
private String uid;
|
||||
|
||||
private Integer repairStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ public interface TmTaskMapper {
|
|||
|
||||
List<TmTask> getLeaseDetailByParentId(TmTask record);
|
||||
|
||||
List<TmTask> getLeaseDetailByParentIdTwo(TmTask record);
|
||||
|
||||
List<TmTask> getMaTypeDetails(LeaseApplyDetails leaseApplyDetails);
|
||||
|
||||
MachinePart getMachineParts(TmTask typeId);
|
||||
|
|
|
|||
|
|
@ -258,7 +258,14 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
*/
|
||||
@Override
|
||||
public List<TmTask> getLeaseAuditListByOne(TmTask record) {
|
||||
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
List<TmTask> leaseDetailByParentId = new ArrayList<>();
|
||||
if (roles.contains(STRING_ADMIN) || roles.contains("sysadmin")) {
|
||||
leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentIdTwo(record);
|
||||
} else {
|
||||
leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
|
||||
}
|
||||
|
||||
// 查询成套设备中哪个是主设备
|
||||
for (TmTask tmTask : leaseDetailByParentId) {
|
||||
if (tmTask.getIsCt() == 0) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import com.bonus.sgzb.common.log.annotation.Log;
|
|||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.annotation.Logical;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.vo.RepairAuditDetailsNew;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -186,6 +188,39 @@ public class RepairController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 维修暂存
|
||||
*/
|
||||
@ApiOperation(value = "维修暂存")
|
||||
@Log(title = "维修暂存", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/saveRepairApplyNew")
|
||||
public AjaxResult saveRepairApplyNew(@RequestBody RepairApplyRecord bean) {
|
||||
String partStrList = bean.getPartStrList();
|
||||
List<RepairPartDetails> repairPartDetails = JSONObject.parseArray(partStrList, RepairPartDetails.class);
|
||||
bean.setPartList(repairPartDetails);
|
||||
AjaxResult ajaxResult = service.saveRepairApplyNew(bean);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除维修暂存
|
||||
*/
|
||||
@ApiOperation(value = "清除维修暂存")
|
||||
@Log(title = "清除维修暂存", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/clearSaveRepairApplyNew")
|
||||
public AjaxResult clearSaveRepairApplyNew(@RequestBody RepairApplyRecord bean) {
|
||||
AjaxResult ajaxResult = service.clearSaveRepairApplyNew(bean);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
@ApiOperation("获取维修暂存信息")
|
||||
@GetMapping("/getSaveInfo")
|
||||
public AjaxResult getSaveInfo(RepairApplyRecord bean) {
|
||||
|
||||
RepairApplyRecord vo = service.getSaveInfo(bean);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增维修记录
|
||||
|
|
|
|||
|
|
@ -156,4 +156,9 @@ public class RepairTask {
|
|||
/** 用户ID */
|
||||
@ApiModelProperty(value = "userId")
|
||||
private Long userId;
|
||||
|
||||
//0:提交,1:暂存
|
||||
private Integer submitStatus;
|
||||
|
||||
private Integer repairType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,5 +106,8 @@ public class RepairTaskDetails {
|
|||
|
||||
private String createTime;
|
||||
|
||||
private int repairType;
|
||||
//0:提交,1:暂存
|
||||
private Integer submitStatus;
|
||||
|
||||
private Integer repairType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,8 +78,17 @@ public interface RepairMapper {
|
|||
*/
|
||||
int addRecordNew(RepairApplyRecord bean);
|
||||
|
||||
/**
|
||||
* 新增维修暂存记录
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int addRecordSaveNew(RepairApplyRecord bean);
|
||||
|
||||
|
||||
int addPartNew(RepairApplyRecord bean);
|
||||
|
||||
int addPartSaveNew(RepairApplyRecord bean);
|
||||
/**
|
||||
* 根据id查询维修明细
|
||||
* @param id
|
||||
|
|
@ -275,6 +284,21 @@ public interface RepairMapper {
|
|||
int updateMaChineStatus(@Param("maId")String maId, @Param("type")int type);
|
||||
|
||||
List<FileInfo> getFileList(Long id);
|
||||
|
||||
RepairApplyRecord getSaveInfo(RepairApplyRecord bean);
|
||||
|
||||
List<RepairPartDetails> getPartList(RepairApplyRecord record);
|
||||
|
||||
List<FileInfo> getFileSaveList(Long id);
|
||||
|
||||
RepairApplyRecord getSaveByTypeId(RepairApplyRecord bean);
|
||||
|
||||
void deleteSaveInfo(Long id);
|
||||
|
||||
void deleteSavePartDetails(RepairApplyRecord record);
|
||||
|
||||
void deleteFileSaveList(RepairApplyRecord record);
|
||||
|
||||
// /**
|
||||
// * 根据id查询损坏照片
|
||||
// * @param id
|
||||
|
|
|
|||
|
|
@ -74,6 +74,20 @@ public interface RepairService {
|
|||
*/
|
||||
AjaxResult submitRepairApplyNew(RepairApplyRecord bean);
|
||||
|
||||
/**
|
||||
* 新增暂存记录
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
AjaxResult saveRepairApplyNew(RepairApplyRecord bean);
|
||||
|
||||
/**
|
||||
* 清除维修暂存
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
AjaxResult clearSaveRepairApplyNew(RepairApplyRecord bean);
|
||||
|
||||
|
||||
/**
|
||||
* 快捷维修记录
|
||||
|
|
@ -117,4 +131,6 @@ public interface RepairService {
|
|||
List<RepairTask> exportRepairTaskList(RepairTask bean);
|
||||
|
||||
BigDecimal getCostByPidAndNum(RepairApplyRecord bean);
|
||||
|
||||
RepairApplyRecord getSaveInfo(RepairApplyRecord bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -344,6 +344,17 @@ public class RepairServiceImpl implements RepairService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult submitRepairApplyNew(RepairApplyRecord bean) {
|
||||
//删除之前的暂存数据
|
||||
RepairApplyRecord record = mapper.getSaveByTypeId(bean);
|
||||
if(record != null){
|
||||
//删除repair_apply_record_save表
|
||||
mapper.deleteSaveInfo(record.getId());
|
||||
//删除repair_apply_part_save表
|
||||
mapper.deleteSavePartDetails(record);
|
||||
//删除sys_file_info表
|
||||
mapper.deleteFileSaveList(record);
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
int numFirst = bean.getRepairNum();
|
||||
bean.setUpdateBy(loginUser.getUserid().toString());
|
||||
|
|
@ -428,6 +439,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setRepairStatus(0);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -501,6 +513,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setRepairStatus(0);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -565,6 +578,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setRepairStatus(0);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -700,6 +714,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setRepairStatus(0);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -796,6 +811,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setRepairStatus(0);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -889,6 +905,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
fileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
fileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
fileInfo.setRepairStatus(0);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -903,6 +920,470 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult saveRepairApplyNew(RepairApplyRecord bean) {
|
||||
//删除之前的暂存数据
|
||||
RepairApplyRecord record = mapper.getSaveByTypeId(bean);
|
||||
if(record != null){
|
||||
//删除repair_apply_record_save表
|
||||
mapper.deleteSaveInfo(record.getId());
|
||||
//删除repair_apply_part_save表
|
||||
mapper.deleteSavePartDetails(record);
|
||||
//删除sys_file_info表
|
||||
mapper.deleteFileSaveList(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
int numFirst = bean.getRepairNum();
|
||||
bean.setUpdateBy(loginUser.getUserid().toString());
|
||||
bean.setCreateBy(loginUser.getUserid());
|
||||
List<RepairPartDetails> partList = bean.getPartList();
|
||||
if (partList != null && partList.size() > 0) {
|
||||
if (partList.get(0).getRepairNum() == null){
|
||||
throw new ServiceException("请输入维修数量");
|
||||
}
|
||||
bean.setRepairNum(partList.get(0).getRepairNum());
|
||||
bean.setRepairer(partList.get(0).getRepairer());
|
||||
if (partList.get(0).getUpdateTime() == null) {
|
||||
// 获取当前时间并格式化为 "yyyy-MM-dd HH:mm:ss"
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
bean.setUpdateTime(sdf.format(new Date()));
|
||||
} else {
|
||||
// 如果已有日期但无时分秒,补上 "00:00:00"
|
||||
bean.setUpdateTime(partList.get(0).getUpdateTime() + " 00:00:00");
|
||||
}
|
||||
}else{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
bean.setUpdateTime(sdf.format(new Date()));
|
||||
}
|
||||
//如果是编码维修
|
||||
if(bean.getManageType()==0){ //编码管理
|
||||
RepairTaskDetails details = mapper.getById(bean.getId());
|
||||
switch (bean.getRepairType()) {
|
||||
case "1": {
|
||||
|
||||
int repairNum = details.getRepairedNum() + bean.getRepairNum();
|
||||
int num = repairNum + details.getScrapNum();
|
||||
if (num > details.getRepairNum()) {
|
||||
throw new ServiceException("维修数量大于维修总量");
|
||||
}
|
||||
// //修改apply_details表
|
||||
// mapper.updateRepairedNumNew(bean);
|
||||
//插入到apply_record_save表
|
||||
RepairApplyRecord beanTemp = new RepairApplyRecord();
|
||||
beanTemp.setTypeId(bean.getTypeId());
|
||||
beanTemp.setMaId(bean.getMaId());
|
||||
beanTemp.setRepairNum(1);
|
||||
beanTemp.setRepairType("1");
|
||||
beanTemp.setCreateBy(bean.getRepairer());
|
||||
beanTemp.setCreateTime(bean.getUpdateTime());
|
||||
mapper.addRecordSaveNew(beanTemp);
|
||||
|
||||
//插入到apply_part_save表
|
||||
if (partList != null && partList.size() > 0) {
|
||||
for (RepairPartDetails partDetails : partList) {
|
||||
if (partDetails.getPartId() != null) {
|
||||
// 有维修配件时
|
||||
if (partDetails.getPartCost() == null) {
|
||||
partDetails.setPartCost(new BigDecimal(0));
|
||||
}
|
||||
partDetails.setMaId(bean.getMaId());
|
||||
partDetails.setTypeId(bean.getTypeId());
|
||||
partDetails.setCreateBy(loginUser.getUserid());
|
||||
partDetails.setRepairer(bean.getRepairer());
|
||||
partDetails.setCompanyId(bean.getCompanyId());
|
||||
|
||||
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
|
||||
beanTempTwo.setTypeId(bean.getTypeId());
|
||||
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
|
||||
beanTempTwo.setPartId(Math.toIntExact(partDetails.getPartId()));
|
||||
beanTempTwo.setPartPrice(partDetails.getPartCost());
|
||||
beanTempTwo.setPartNum(partDetails.getPartNum());
|
||||
beanTempTwo.setRepairContent(partDetails.getRepairContent());
|
||||
beanTempTwo.setPartType(partDetails.getPartType());
|
||||
beanTempTwo.setRepairRemark(partDetails.getRepairRemark());
|
||||
beanTempTwo.setPartChange(partDetails.getPartChange());
|
||||
beanTempTwo.setPartChangeNum(partDetails.getPartChangeNum());
|
||||
beanTempTwo.setCreateBy(loginUser.getUserid());
|
||||
mapper.addPartSaveNew(beanTempTwo);
|
||||
|
||||
//文件上传新增
|
||||
if (partDetails.getFileList() != null){
|
||||
for (FileInfo fileInfo : partDetails.getFileList()) {
|
||||
fileInfo.setModelId(beanTempTwo.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());
|
||||
fileInfo.setRepairStatus(1);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// //插入到audit_details表
|
||||
// Date timeNow = DateUtils.getNowDate();
|
||||
// RepairAuditDetails audit = new RepairAuditDetails();
|
||||
// audit.setRepairId(bean.getId());
|
||||
// audit.setParentId(beanTemp.getId());
|
||||
// audit.setTypeId(Long.valueOf(bean.getTypeId()));
|
||||
// audit.setMaId(Long.valueOf(bean.getMaId()));
|
||||
// audit.setRepairedNum(1);
|
||||
// audit.setRepairNum(1);
|
||||
// audit.setCreateBy(String.valueOf(loginUser.getUserid()));
|
||||
// audit.setCreateTime(timeNow);
|
||||
// if(bean.getCompanyId() != null) {
|
||||
// audit.setCompanyId(Math.toIntExact(bean.getCompanyId()));
|
||||
// } else {
|
||||
// audit.setCompanyId(null); // 或其他默认值
|
||||
// }
|
||||
// mapper.insertAuditDetails(audit);
|
||||
//
|
||||
// //修改编码设备状态
|
||||
// mapper.updateMaChineStatus(bean.getMaId(), 145);
|
||||
break;
|
||||
}
|
||||
case "2": {
|
||||
int repairNum = details.getRepairedNum() + bean.getRepairNum();
|
||||
int num = repairNum + details.getScrapNum();
|
||||
if (num > details.getRepairNum()) {
|
||||
throw new ServiceException("维修数量大于维修总量");
|
||||
}
|
||||
// //修改apply_details表
|
||||
// mapper.updateRepairedNumNewTwo(bean);
|
||||
|
||||
//插入到apply_record_save表
|
||||
RepairApplyRecord beanTemp = new RepairApplyRecord();
|
||||
beanTemp.setTypeId(bean.getTypeId());
|
||||
beanTemp.setMaId(bean.getMaId());
|
||||
beanTemp.setRepairNum(1);
|
||||
beanTemp.setRepairType("2");
|
||||
beanTemp.setCreateBy(loginUser.getUserid());
|
||||
beanTemp.setCreateTime(bean.getUpdateTime());
|
||||
mapper.addRecordSaveNew(beanTemp);
|
||||
|
||||
|
||||
//插入到apply_part_save表
|
||||
if (partList != null && partList.size() > 0) {
|
||||
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
|
||||
beanTempTwo.setTypeId(bean.getTypeId());
|
||||
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
|
||||
beanTempTwo.setPartName(partList.get(0).getPartName());
|
||||
beanTempTwo.setPartNum(partList.get(0).getPartNum());
|
||||
beanTempTwo.setRepairContent(partList.get(0).getRepairContent());
|
||||
beanTempTwo.setRepairRemark(partList.get(0).getRepairRemark());
|
||||
beanTempTwo.setCreateBy(loginUser.getUserid());
|
||||
beanTempTwo.setRepairContent(partList.get(0).getRepairContent());
|
||||
mapper.addPartSaveNew(beanTempTwo);
|
||||
List<FileInfo> fileList = partList.get(0).getFileList();
|
||||
|
||||
if (fileList != null) {
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(beanTempTwo.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());
|
||||
fileInfo.setRepairStatus(1);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// //插入到audit_details表
|
||||
// Date timeNow = DateUtils.getNowDate();
|
||||
// RepairAuditDetails audit = new RepairAuditDetails();
|
||||
// audit.setRepairId(bean.getId());
|
||||
// audit.setParentId(beanTemp.getId());
|
||||
// audit.setTypeId(Long.valueOf(bean.getTypeId()));
|
||||
// audit.setMaId(Long.valueOf(bean.getMaId()));
|
||||
// audit.setRepairNum(1);
|
||||
// audit.setRepairedNum(1);
|
||||
// audit.setCreateBy(String.valueOf(loginUser.getUserid()));
|
||||
// audit.setCreateTime(timeNow);
|
||||
// if(bean.getCompanyId() != null) {
|
||||
// audit.setCompanyId(Math.toIntExact(bean.getCompanyId()));
|
||||
// } else {
|
||||
// audit.setCompanyId(null); // 或其他默认值
|
||||
// }
|
||||
// mapper.insertAuditDetails(audit);
|
||||
// //修改编码设备状态
|
||||
// mapper.updateMaChineStatus(bean.getMaId(), 145);
|
||||
break;
|
||||
}
|
||||
case "3": {
|
||||
int scrapNum = details.getScrapNum() + bean.getScrapNum();
|
||||
int num = scrapNum + details.getRepairedNum();
|
||||
if (num > details.getRepairNum()) {
|
||||
throw new ServiceException("维修数量大于维修总量");
|
||||
}
|
||||
// mapper.updateScrapNumNew(bean);
|
||||
//插入到apply_record_save表
|
||||
RepairApplyRecord beanTemp = new RepairApplyRecord();
|
||||
beanTemp.setTypeId(bean.getTypeId());
|
||||
beanTemp.setMaId(bean.getMaId());
|
||||
beanTemp.setRepairNum(1);
|
||||
beanTemp.setRepairType("3");
|
||||
beanTemp.setCreateBy(loginUser.getUserid());
|
||||
beanTemp.setCreateTime(bean.getUpdateTime());
|
||||
mapper.addRecordSaveNew(beanTemp);
|
||||
|
||||
//插入到apply_part_save表
|
||||
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
|
||||
beanTempTwo.setTypeId(bean.getTypeId());
|
||||
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
|
||||
beanTempTwo.setScrapNum(1);
|
||||
beanTempTwo.setScrapType(bean.getScrapType());
|
||||
beanTempTwo.setScrapReason(bean.getScrapReason());
|
||||
beanTempTwo.setCreateBy(loginUser.getUserid());
|
||||
beanTempTwo.setRepairRemark(bean.getRepairRemark());
|
||||
mapper.addPartSaveNew(beanTempTwo);
|
||||
// 新增预报废记录
|
||||
List<FileInfo> fileList = bean.getFileList();
|
||||
if (fileList != null){
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(beanTempTwo.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());
|
||||
fileInfo.setRepairStatus(1);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// //插入到audit_details表
|
||||
// Date timeNow = DateUtils.getNowDate();
|
||||
// RepairAuditDetails audit = new RepairAuditDetails();
|
||||
// audit.setRepairId(bean.getId());
|
||||
// audit.setParentId(beanTemp.getId());
|
||||
// audit.setTypeId(Long.valueOf(bean.getTypeId()));
|
||||
// audit.setMaId(Long.valueOf(bean.getMaId()));
|
||||
// audit.setRepairNum(1);
|
||||
// audit.setScrapNum(1);
|
||||
// audit.setCreateBy(String.valueOf(loginUser.getUserid()));
|
||||
// audit.setCreateTime(timeNow);
|
||||
// if(bean.getCompanyId() != null) {
|
||||
// audit.setCompanyId(Math.toIntExact(bean.getCompanyId()));
|
||||
// } else {
|
||||
// audit.setCompanyId(null); // 或其他默认值
|
||||
// }
|
||||
// mapper.insertAuditDetails(audit);
|
||||
// //修改编码设备状态
|
||||
// mapper.updateMaChineStatus(bean.getMaId(), 145);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}else{ //数量管理
|
||||
//查找符合相应typeId的数据
|
||||
List<RepairTaskDetails> list = mapper.getRepairByTypeId(bean);
|
||||
|
||||
switch (bean.getRepairType()) {
|
||||
case "1": {
|
||||
//插入到apply_record_save表
|
||||
RepairApplyRecord beanTemp = new RepairApplyRecord();
|
||||
beanTemp.setTypeId(bean.getTypeId());
|
||||
beanTemp.setRepairNum(numFirst);
|
||||
beanTemp.setRepairType("1");
|
||||
beanTemp.setCreateBy(bean.getRepairer());
|
||||
beanTemp.setCreateTime(bean.getUpdateTime());
|
||||
mapper.addRecordSaveNew(beanTemp);
|
||||
|
||||
|
||||
//插入到apply_part_save表
|
||||
if (partList != null && partList.size() > 0) {
|
||||
for (RepairPartDetails partDetails : partList) {
|
||||
if (partDetails.getPartId() != null) {
|
||||
// 有维修配件时
|
||||
if (partDetails.getPartCost() == null) {
|
||||
partDetails.setPartCost(new BigDecimal(0));
|
||||
}
|
||||
partDetails.setMaId(bean.getMaId());
|
||||
partDetails.setTypeId(bean.getTypeId());
|
||||
partDetails.setCreateBy(loginUser.getUserid());
|
||||
partDetails.setRepairer(bean.getRepairer());
|
||||
partDetails.setCompanyId(bean.getCompanyId());
|
||||
|
||||
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
|
||||
beanTempTwo.setTypeId(bean.getTypeId());
|
||||
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
|
||||
beanTempTwo.setPartId(Math.toIntExact(partDetails.getPartId()));
|
||||
beanTempTwo.setPartPrice(partDetails.getPartCost());
|
||||
beanTempTwo.setPartNum(partDetails.getPartNum());
|
||||
beanTempTwo.setRepairContent(partDetails.getRepairContent());
|
||||
beanTempTwo.setPartType(partDetails.getPartType());
|
||||
beanTempTwo.setRepairRemark(partDetails.getRepairRemark());
|
||||
beanTempTwo.setPartChange(partDetails.getPartChange());
|
||||
beanTempTwo.setPartChangeNum(partDetails.getPartChangeNum());
|
||||
beanTempTwo.setCreateBy(loginUser.getUserid());
|
||||
mapper.addPartSaveNew(beanTempTwo);
|
||||
|
||||
//文件上传新增
|
||||
if (partDetails.getFileList() != null){
|
||||
for (FileInfo fileInfo : partDetails.getFileList()) {
|
||||
fileInfo.setModelId(beanTempTwo.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());
|
||||
fileInfo.setRepairStatus(1);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "2": {
|
||||
//插入到apply_record_save表
|
||||
RepairApplyRecord beanTemp = new RepairApplyRecord();
|
||||
beanTemp.setTypeId(bean.getTypeId());
|
||||
beanTemp.setRepairNum(numFirst);
|
||||
beanTemp.setRepairType("2");
|
||||
beanTemp.setCreateBy(loginUser.getUserid());
|
||||
beanTemp.setCreateTime(bean.getUpdateTime());
|
||||
mapper.addRecordSaveNew(beanTemp);
|
||||
|
||||
|
||||
//插入到apply_part_save表
|
||||
if (partList != null && partList.size() > 0) {
|
||||
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
|
||||
beanTempTwo.setTypeId(bean.getTypeId());
|
||||
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
|
||||
beanTempTwo.setPartName(partList.get(0).getPartName());
|
||||
beanTempTwo.setPartNum(partList.get(0).getPartNum());
|
||||
beanTempTwo.setRepairContent(partList.get(0).getRepairContent());
|
||||
beanTempTwo.setCreateBy(loginUser.getUserid());
|
||||
beanTempTwo.setRepairRemark(partList.get(0).getRepairRemark());
|
||||
|
||||
mapper.addPartSaveNew(beanTempTwo);
|
||||
List<FileInfo> fileList = partList.get(0).getFileList();
|
||||
if (fileList != null) {
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(beanTempTwo.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());
|
||||
fileInfo.setRepairStatus(1);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "3": {
|
||||
//插入到apply_record_save表
|
||||
RepairApplyRecord beanTemp = new RepairApplyRecord();
|
||||
beanTemp.setTypeId(bean.getTypeId());
|
||||
beanTemp.setRepairNum(numFirst);
|
||||
beanTemp.setRepairType("3");
|
||||
beanTemp.setCreateBy(loginUser.getUserid());
|
||||
beanTemp.setCreateTime(bean.getUpdateTime());
|
||||
mapper.addRecordSaveNew(beanTemp);
|
||||
|
||||
//插入到apply_part_save表
|
||||
RepairApplyRecord beanTempTwo = new RepairApplyRecord();
|
||||
beanTempTwo.setTypeId(bean.getTypeId());
|
||||
beanTempTwo.setParentId(Math.toIntExact(beanTemp.getId()));
|
||||
beanTempTwo.setScrapReason(bean.getScrapReason());
|
||||
beanTempTwo.setScrapType(bean.getScrapType());
|
||||
beanTempTwo.setScrapNum(bean.getScrapNum());
|
||||
beanTempTwo.setCreateBy(loginUser.getUserid());
|
||||
beanTempTwo.setRepairRemark(bean.getRepairRemark());
|
||||
mapper.addPartSaveNew(beanTempTwo);
|
||||
|
||||
// 新增预报废记录
|
||||
List<FileInfo> fileList = bean.getFileList();
|
||||
if (fileList != null){
|
||||
for (FileInfo fileInfo : fileList) {
|
||||
fileInfo.setModelId(beanTempTwo.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());
|
||||
fileInfo.setRepairStatus(1);
|
||||
backReceiveMapper.insertBmFileInfo(fileInfo);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult clearSaveRepairApplyNew(RepairApplyRecord bean) {
|
||||
//删除之前的暂存数据
|
||||
RepairApplyRecord record = mapper.getSaveByTypeId(bean);
|
||||
if (record != null) {
|
||||
//删除repair_apply_record_save表
|
||||
mapper.deleteSaveInfo(record.getId());
|
||||
//删除repair_apply_part_save表
|
||||
mapper.deleteSavePartDetails(record);
|
||||
//删除sys_file_info表
|
||||
mapper.deleteFileSaveList(record);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RepairApplyRecord getSaveInfo(RepairApplyRecord bean) {
|
||||
//获取暂存信息
|
||||
RepairApplyRecord record = mapper.getSaveInfo(bean);
|
||||
//获取配件信息
|
||||
if(record != null){
|
||||
List<RepairPartDetails> partList = mapper.getPartList(record);
|
||||
if(partList != null){
|
||||
|
||||
for(int i=0; i<partList.size(); i++){
|
||||
RepairPartDetails partDetails = partList.get(i);
|
||||
if(i == 0){
|
||||
partDetails.setRepairer(record.getRepairer());
|
||||
partDetails.setRepairNum(record.getRepairNum());
|
||||
partDetails.setUpdateTime(record.getCreateTime());
|
||||
}
|
||||
List<FileInfo> fileList = mapper.getFileSaveList(partDetails.getId());
|
||||
partDetails.setFileList(fileList);
|
||||
}
|
||||
record.setPartList(partList);
|
||||
}
|
||||
}
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult fastRepairApply(List<RepairTaskDetails> list) {
|
||||
|
|
|
|||
|
|
@ -587,6 +587,7 @@
|
|||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="uid != null and uid != ''" >uid,</if>
|
||||
<if test="repairStatus != null " >repair_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="modelId != null">#{modelId},</if>
|
||||
|
|
@ -598,6 +599,7 @@
|
|||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="uid != null and uid != ''" >#{uid},</if>
|
||||
<if test="repairStatus != null " >#{repairStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
|
|||
|
|
@ -1120,6 +1120,50 @@
|
|||
</if>
|
||||
GROUP BY lad.type_id,lad.is_ct
|
||||
</select>
|
||||
|
||||
<select id="getLeaseDetailByParentIdTwo" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||
SELECT
|
||||
lai.task_id as taskId,
|
||||
lad.id as id,
|
||||
lad.parennt_id as parentId,
|
||||
lad.pre_num - ifnull(lad.al_num,0) as outNum,
|
||||
lad.pre_num as preCountNum,
|
||||
lad.status as status,
|
||||
ifnull(lad.al_num,0) as alNum,
|
||||
mt2.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mt.manage_type as manageType,
|
||||
mt.num as num,
|
||||
su.nick_name as userName,
|
||||
lad.type_id as typeId,
|
||||
mt.is_storage as isStorage,
|
||||
lad.type_name as maName,
|
||||
lad.model_name as maModel,
|
||||
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
|
||||
LEFT JOIN lease_apply_info lai on lad.parennt_id = lai.id
|
||||
LEFT JOIN ma_type mt on lad.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
|
||||
LEFT JOIN sys_user su on mtk.user_id = su.user_id
|
||||
WHERE
|
||||
lad.parennt_id = #{id}
|
||||
and mt.is_storage = 1
|
||||
|
||||
<if test="userName != null and userName != ''">
|
||||
and su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and lad.type_id = #{typeId}
|
||||
</if>
|
||||
GROUP BY lad.type_id,lad.is_ct
|
||||
</select>
|
||||
|
||||
<select id="getMaTypeDetails" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||
SELECT
|
||||
mws2.type_id AS typeId,
|
||||
|
|
|
|||
|
|
@ -10,11 +10,22 @@
|
|||
insert into repair_apply_record (ma_id,type_id,repair_num,repair_type,create_by,create_time)
|
||||
values (#{maId},#{typeId},#{repairNum},#{repairType},#{createBy},#{createTime});
|
||||
</insert>
|
||||
|
||||
<insert id="addRecordSaveNew" keyColumn="id" keyProperty="id" useGeneratedKeys="true" >
|
||||
insert into repair_apply_record_save (ma_id,type_id,repair_num,repair_type,create_by,create_time)
|
||||
values (#{maId},#{typeId},#{repairNum},#{repairType},#{createBy},#{createTime});
|
||||
</insert>
|
||||
|
||||
<insert id="addPartNew" keyColumn="id" keyProperty="id" useGeneratedKeys="true" >
|
||||
insert into repair_apply_part (parent_id,type_id,create_by,create_time,repair_content,part_id,part_num,part_price,part_name,remark,repair_remark,part_change,part_change_num,scrap_reason,scrap_type,scrap_num)
|
||||
values (#{parentId},#{typeId},#{createBy},now(),#{repairContent},#{partId},#{partNum},#{partPrice},#{partName},#{remark},#{repairRemark},#{partChange},#{partChangeNum},#{scrapReason},#{scrapType},#{scrapNum});
|
||||
</insert>
|
||||
|
||||
<insert id="addPartSaveNew" keyColumn="id" keyProperty="id" useGeneratedKeys="true" >
|
||||
insert into repair_apply_part_save (parent_id,type_id,create_by,create_time,repair_content,part_id,part_num,part_price,part_name,remark,repair_remark,part_change,part_change_num,scrap_reason,scrap_type,scrap_num)
|
||||
values (#{parentId},#{typeId},#{createBy},now(),#{repairContent},#{partId},#{partNum},#{partPrice},#{partName},#{remark},#{repairRemark},#{partChange},#{partChangeNum},#{scrapReason},#{scrapType},#{scrapNum});
|
||||
</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)
|
||||
values (#{taskId},#{maId},#{typeId},#{partId},#{partNum},#{partCost},#{partType},#{createBy},now(),#{companyId},#{repairContent});
|
||||
|
|
@ -205,6 +216,7 @@
|
|||
id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getRepairTaskList" resultType="com.bonus.sgzb.base.domain.RepairTask">
|
||||
SELECT
|
||||
rd.task_id,
|
||||
|
|
@ -267,12 +279,15 @@
|
|||
sum(rd.repaired_num + rd.scrap_num) as repairFinishNum,
|
||||
sum(rd.repair_num) - sum(rd.repaired_num + rd.scrap_num) as repairNotFinishNum,
|
||||
GROUP_CONCAT(DISTINCT rd.repair_remark SEPARATOR ',') as repairRemark,
|
||||
mt.manage_type as manageType
|
||||
mt.manage_type as manageType,
|
||||
IF(ras.type_id IS NOT NULL, 1, 0) as submitStatus,
|
||||
ras.repair_type as repairType
|
||||
from
|
||||
repair_apply_details rd
|
||||
LEFT JOIN ma_type mt on rd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_type_repair mtr on mtr.type_id = rd.type_id
|
||||
LEFT JOIN repair_apply_record_save ras ON rd.type_id = ras.type_id
|
||||
where 1=1
|
||||
<if test="type != null and type != ''">
|
||||
AND mt.type_name like concat('%',#{type},'%')
|
||||
|
|
@ -452,13 +467,16 @@
|
|||
su.nick_name as repairer,
|
||||
rad.update_time as updateTime,
|
||||
rad.type_id as typeId,
|
||||
mt.manage_type as manageType
|
||||
mt.manage_type as manageType,
|
||||
IF(ras.type_id IS NOT NULL, 1, 0) as submitStatus,
|
||||
ras.repair_type as repairType
|
||||
from repair_apply_details rad
|
||||
left join ma_type mt on rad.type_id = mt.type_id
|
||||
left join ma_machine mm on mm.ma_id = rad.ma_id
|
||||
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
|
||||
LEFT JOIN repair_apply_record_save ras ON rad.type_id = ras.type_id and mm.ma_id = ras.ma_id
|
||||
where rad.type_id = #{typeId} and (rad.status is null or rad.status = 0)
|
||||
<if test="userId != null and userId != ''">
|
||||
and mtr.user_id = #{userId}
|
||||
|
|
@ -653,6 +671,75 @@
|
|||
file_url as fileUrl
|
||||
from
|
||||
sys_file_info sfi
|
||||
where model_id = #{id}
|
||||
where model_id = #{id} and repair_status = 0
|
||||
</select>
|
||||
<select id="getSaveInfo" resultType="com.bonus.sgzb.base.domain.RepairApplyRecord">
|
||||
select
|
||||
id,
|
||||
create_by as repairer,
|
||||
type_id as typeId,
|
||||
repair_num AS repairNum,
|
||||
DATE_FORMAT(create_time, '%Y-%m-%d') as createTime
|
||||
from repair_apply_record_save rars
|
||||
where rars.type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
and rars.ma_id = #{maId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPartList" resultType="com.bonus.sgzb.base.domain.RepairPartDetails">
|
||||
select
|
||||
raps.id as id,
|
||||
raps.part_id as partId,
|
||||
case when raps.part_id is not null then mpt.pa_name else raps.part_name end as partName,
|
||||
part_num as partNum,
|
||||
part_price as partCost,
|
||||
repair_content as repairContent,
|
||||
repair_remark as repairRemark,
|
||||
part_change as partChange,
|
||||
part_change_num as partChangeNum,
|
||||
scrap_num as scrapNum,
|
||||
scrap_reason as scrapReason,
|
||||
scrap_type as scrapType
|
||||
from repair_apply_part_save raps
|
||||
left join repair_apply_record_save rar on raps.parent_id = rar.id
|
||||
left join ma_part_type mpt on raps.part_id = mpt.pa_id
|
||||
where rar.id = #{id}
|
||||
order by raps.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getFileSaveList" resultType="com.bonus.sgzb.base.api.domain.FileInfo">
|
||||
select
|
||||
id,
|
||||
model_id as modelId,
|
||||
file_name as fileName,
|
||||
file_url as fileUrl
|
||||
from
|
||||
sys_file_info sfi
|
||||
where model_id = #{id} and repair_status = 1
|
||||
</select>
|
||||
<select id="getSaveByTypeId" resultType="com.bonus.sgzb.base.domain.RepairApplyRecord">
|
||||
select
|
||||
id,
|
||||
type_id as typeId,
|
||||
ma_id as maId
|
||||
from repair_apply_record_save rars
|
||||
where rars.type_id = #{typeId}
|
||||
<if test="maId!= null and maId != ''">
|
||||
and rars.ma_id = #{maId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteSaveInfo">
|
||||
delete from repair_apply_record_save where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteSavePartDetails">
|
||||
delete from repair_apply_part_save where parent_id = #{id} and type_id = #{typeId}
|
||||
</delete>
|
||||
<delete id="deleteFileSaveList">
|
||||
delete from sys_file_info
|
||||
where type_id = #{typeId} and repair_status = 1
|
||||
<if test="maId != null and maId != ''">
|
||||
and ma_id = #{maId}
|
||||
</if>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -617,20 +617,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE rap.parent_id = rar.id
|
||||
) as repairRemark,
|
||||
-- 使用子查询获取 repairRemarkBefore
|
||||
(
|
||||
SELECT GROUP_CONCAT(CONCAT(mt.type_name, ':', rpad.repair_remark) SEPARATOR ';')
|
||||
FROM repair_apply_details rpad
|
||||
LEFT JOIN ma_type mt ON rpad.type_id = mt.type_id
|
||||
WHERE rpad.id = rad.repair_id
|
||||
IFNULL(
|
||||
TRIM(
|
||||
(
|
||||
SELECT GROUP_CONCAT(CONCAT(mt.type_name, ':', rpad.repair_remark) SEPARATOR ';')
|
||||
FROM repair_apply_details rpad
|
||||
LEFT JOIN ma_type mt ON rpad.type_id = mt.type_id
|
||||
WHERE rpad.id = rad.repair_id
|
||||
)
|
||||
),
|
||||
(
|
||||
SELECT GROUP_CONCAT(DISTINCT rap.repair_remark SEPARATOR ';')
|
||||
FROM repair_apply_part rap
|
||||
WHERE rap.parent_id = rar.id
|
||||
)
|
||||
) as repairRemarkBefore,
|
||||
(
|
||||
SELECT GROUP_CONCAT(
|
||||
CASE
|
||||
-- 当 part_id 存在时,关联表获取 pa_name
|
||||
WHEN rap.scrap_num > 0 THEN CONCAT('报废数量:',rap.scrap_reason)
|
||||
WHEN rap.part_id IS NOT NULL THEN CONCAT(mpt.pa_name, ':','数量为',rap.part_num,' ', rap.repair_content)
|
||||
WHEN rap.scrap_num > 0 THEN CONCAT('报废数量:',rap.scrap_num,' ','报废原因:',rap.scrap_reason)
|
||||
WHEN rap.part_id IS NOT NULL THEN CONCAT(mpt.pa_name, ':','数量为',rap.part_num,' ', rap.repair_content)
|
||||
-- 当 part_id 不存在但 part_name 存在时,直接使用 part_name
|
||||
WHEN rap.part_name IS NOT NULL THEN CONCAT(rap.part_name, ':','数量为',rap.part_num,' ', rap.repair_content)
|
||||
WHEN rap.part_name IS NOT NULL THEN CONCAT(rap.part_name, ':','数量为',rap.part_num,' ', rap.repair_content)
|
||||
-- 两者都不存在时,不显示该记录
|
||||
ELSE NULL
|
||||
END
|
||||
|
|
|
|||
Loading…
Reference in New Issue