Merge branch 'dev' of http://192.168.0.56:3000/bonus/devicesmgt into dev
This commit is contained in:
commit
629f937be7
|
|
@ -562,7 +562,7 @@ public class DateTimeHelper {
|
|||
long hours = time / 60 / 1000;
|
||||
return hours;
|
||||
} catch (Exception e) {
|
||||
return 0l;
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,8 +189,9 @@ public class StringHelper {
|
|||
public static String decode(String bytes) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream(bytes.length() / 2);
|
||||
// 将每2位16进制整数组装成一个字节
|
||||
for (int i = 0; i < bytes.length(); i += 2)
|
||||
for (int i = 0; i < bytes.length(); i += 2){
|
||||
baos.write((hexString.indexOf(bytes.charAt(i)) << 4 | hexString.indexOf(bytes.charAt(i + 1))));
|
||||
}
|
||||
return new String(baos.toByteArray());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ spring:
|
|||
# 环境配置
|
||||
active: sgzb_cloud_dev
|
||||
cloud:
|
||||
loadbalancer:
|
||||
# 关闭Ribbon的负载均衡器
|
||||
ribbon:
|
||||
enabled: false
|
||||
# 开启Nacos的负载均衡器
|
||||
nacos:
|
||||
enabled: true
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.app.controller;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.domain.GlobalConstants;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.service.BackApplyService;
|
||||
import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
|
||||
|
|
@ -23,26 +24,22 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退料申请--App
|
||||
*/
|
||||
* @description 退料申请--app
|
||||
* @author hay
|
||||
* @date 2024/1/22 10:17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/back_apply")
|
||||
public class BackApplyController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private BackApplyService backApplyService; // 任务表Service
|
||||
private BackApplyService backApplyService;
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private TmTaskService tmTaskService; // 任务表Service
|
||||
|
||||
@Resource
|
||||
private LeaseApplyInfoService leaseApplyInfoService; // 领料申请表Service
|
||||
|
||||
@Resource
|
||||
private LeaseApplyDetailsService leaseApplyDetailsService; // 领料申请明细表Service
|
||||
private TmTaskService tmTaskService;
|
||||
|
||||
/**
|
||||
* 退料申请列表
|
||||
|
|
@ -231,16 +228,18 @@ public class BackApplyController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
// 退料编号生成规则
|
||||
/**
|
||||
* 退料编号生成规则
|
||||
*/
|
||||
private String purchaseCodeRule() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = tmTaskService.selectTaskNumByMonth(nowDate, 36) + 1;
|
||||
String code = "";
|
||||
if (taskNum > 9 && taskNum < 100) {
|
||||
if (taskNum > GlobalConstants.NINE && taskNum < GlobalConstants.ONE_HUNDRED) {
|
||||
code = "T" + format + "-00" + taskNum;
|
||||
} else if (taskNum > 99 && taskNum < 1000) {
|
||||
} else if (taskNum > GlobalConstants.NINETY_NINE && taskNum < GlobalConstants.ONE_THOUSAND) {
|
||||
code = "T" + format + "-0" + taskNum;
|
||||
} else {
|
||||
code = "T" + format + "-000" + taskNum;
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ public class BackReceiveController extends BaseController {
|
|||
int res =backReceiveService.setCodeBack(record);
|
||||
if (res>0){
|
||||
return AjaxResult.success("接收成功");
|
||||
}else if (res==-1){
|
||||
return AjaxResult.error("该编码已接收");
|
||||
}else {
|
||||
return AjaxResult.error("接收失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,14 +42,17 @@ public class TmTaskController extends BaseController {
|
|||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
// 任务表Service
|
||||
@Resource
|
||||
private TmTaskService tmTaskService; // 任务表Service
|
||||
private TmTaskService tmTaskService;
|
||||
|
||||
// 领料申请表Service
|
||||
@Resource
|
||||
private LeaseApplyInfoService leaseApplyInfoService; // 领料申请表Service
|
||||
private LeaseApplyInfoService leaseApplyInfoService;
|
||||
|
||||
// 领料申请明细表Service
|
||||
@Resource
|
||||
private LeaseApplyDetailsService leaseApplyDetailsService; // 领料申请明细表Service
|
||||
private LeaseApplyDetailsService leaseApplyDetailsService;
|
||||
|
||||
@Autowired
|
||||
private LeaseUserBookService leaseUserBookService;
|
||||
|
|
@ -273,7 +276,7 @@ public class TmTaskController extends BaseController {
|
|||
/**
|
||||
* 查询机具领料审核列表
|
||||
*
|
||||
* @param task 筛选条件
|
||||
* @param task 筛选条件
|
||||
* @param souceBy app为1 web为0
|
||||
* @return 列表
|
||||
*/
|
||||
|
|
@ -283,11 +286,13 @@ public class TmTaskController extends BaseController {
|
|||
if (StringUtils.isNull(task)) {
|
||||
return AjaxResult.error("参数错误");
|
||||
}
|
||||
List<TmTask> leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
List<TmTask> leaseAuditList = new ArrayList<>();
|
||||
if (souceBy == 1) {
|
||||
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
return AjaxResult.success(leaseAuditList);
|
||||
}
|
||||
startPage();
|
||||
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
return AjaxResult.success(getDataTable(leaseAuditList));
|
||||
}
|
||||
|
||||
|
|
@ -333,7 +338,7 @@ public class TmTaskController extends BaseController {
|
|||
}
|
||||
String[] split = role.split(",");
|
||||
for (String s : split) {
|
||||
if (s.equals("kg")) {
|
||||
if ("kg".equals(s)) {
|
||||
//如果是库管员只能看到自己的审核列表
|
||||
List<TmTask> leaseAuditList = tmTaskService.getLeaseAuditListForApp(task);
|
||||
List<TmTask> list = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
|
||||
public class GlobalConstants {
|
||||
/** 9 */
|
||||
public static final int NINE=9;
|
||||
/** 100 */
|
||||
public static final int ONE_HUNDRED=100;
|
||||
/** 1000 */
|
||||
public static final int ONE_THOUSAND=1000;
|
||||
/** 99 */
|
||||
public static final int NINETY_NINE=99;
|
||||
/** 41 */
|
||||
public static final int FORTY_ONE=41;
|
||||
}
|
||||
|
|
@ -10,19 +10,56 @@ import org.apache.ibatis.annotations.Param;
|
|||
@Mapper
|
||||
public interface AppMapper {
|
||||
|
||||
/**
|
||||
* 查询当日领料数量
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return int
|
||||
*/
|
||||
int getDayLeaseNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* 查询当日退料数量
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
int getDayBackNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* 查询当日出库数量
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
int getDayInputNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* 查询当日入库数量
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
int getDayOutNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* 领料待审批数量
|
||||
* @return
|
||||
*/
|
||||
int getLeaseNum();
|
||||
|
||||
/**
|
||||
* 退料待审批数量
|
||||
* @return
|
||||
*/
|
||||
int getBackNum();
|
||||
|
||||
/**
|
||||
* 报废待审批数量
|
||||
* @return
|
||||
*/
|
||||
int getScrapNum();
|
||||
|
||||
/**
|
||||
* 试验检验待审批数量
|
||||
* @return
|
||||
*/
|
||||
int getTrialNum();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,32 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface AppMenuMapper {
|
||||
/**
|
||||
* 获取所有按钮
|
||||
* @return
|
||||
*/
|
||||
List<AppMenu> getAllMenu();
|
||||
|
||||
/**
|
||||
* 根据用户id获取按钮
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<AppMenu> getMenuById(Long userId);
|
||||
|
||||
/**
|
||||
* 为用户id添加按钮
|
||||
* @param appMenuId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int addMenuById(@Param("appMenuId") Long appMenuId,@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 为用户id删除按钮
|
||||
* @param appMenuId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int delMenuById(@Param("appMenuId") Long appMenuId, @Param("userId")Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,4 +55,6 @@ public interface BackReceiveMapper {
|
|||
List<BackApplyInfo> qrcodeQuery(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> backReceiveRecord(BackApplyInfo record);
|
||||
|
||||
int selectCodeByMaIdAndTaskId(@Param("maId") Integer maId,@Param("taskId") Integer taskId);
|
||||
}
|
||||
|
|
@ -11,5 +11,10 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface SysNoticeMapper {
|
||||
/**
|
||||
* 获取通知公告
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
List<SysNotice> getList(String keyword);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,32 @@ import java.util.List;
|
|||
* @date 2024/1/17
|
||||
*/
|
||||
public interface AppMenuService {
|
||||
/**
|
||||
* 获取所有按钮
|
||||
* @return
|
||||
*/
|
||||
List<AppMenu> getAllMenu();
|
||||
|
||||
/**
|
||||
* 根据用户id获取按钮
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<AppMenu> getMenuById(Long userId);
|
||||
|
||||
/**
|
||||
* 为用户id添加按钮
|
||||
* @param appMenuId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int addMenuById(Long appMenuId, Long userId);
|
||||
|
||||
/**
|
||||
* 为用户id删除按钮
|
||||
* @param appMenuId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int delMenuById(Long appMenuId, Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,15 @@ import com.bonus.sgzb.app.domain.ToDoList;
|
|||
*/
|
||||
public interface AppService {
|
||||
|
||||
/**
|
||||
* 查询关键数据
|
||||
* @return
|
||||
*/
|
||||
CriticalData getCriticalData();
|
||||
|
||||
/**
|
||||
* 查询待办事项
|
||||
* @return
|
||||
*/
|
||||
ToDoList getToDoList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,10 @@ import java.util.List;
|
|||
* @date 2023/12/11
|
||||
*/
|
||||
public interface SysNoticeService {
|
||||
/**
|
||||
* 获取通知公告
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
List<SysNotice> getList(String keyword);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ public class AppServiceImpl implements AppService {
|
|||
@Override
|
||||
public CriticalData getCriticalData() {
|
||||
CriticalData data = new CriticalData();
|
||||
LocalDate current_date = LocalDate.now();
|
||||
String startTime = current_date + " 00:00:00";
|
||||
String endTime = current_date + " 23:59:59";
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
String startTime = currentDate + " 00:00:00";
|
||||
String endTime = currentDate + " 23:59:59";
|
||||
int dayLeaseNum = mapper.getDayLeaseNum(startTime,endTime);
|
||||
int dayBackNum = mapper.getDayBackNum(startTime,endTime);
|
||||
int dayInputNum = mapper.getDayInputNum(startTime,endTime);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ import org.springframework.stereotype.Service;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 退料申请--app
|
||||
* @author hay
|
||||
* @date 2024/1/22 11:13
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class BackApplyServiceImpl implements BackApplyService {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.bonus.sgzb.app.service.impl;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.GlobalConstants;
|
||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||
import com.bonus.sgzb.app.service.BackReceiveService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -12,6 +14,11 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 退料申请--app
|
||||
* @author hay
|
||||
* @date 2024/1/22 11:16
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class BackReceiveServiceImpl implements BackReceiveService {
|
||||
|
|
@ -33,13 +40,13 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int setNumBack(BackApplyInfo record) {
|
||||
int res =0;
|
||||
int res;
|
||||
try{
|
||||
int taskId = record.getTaskId();
|
||||
//修改任务状态
|
||||
res= updateTaskStatus(taskId,39);
|
||||
//插入back_check_details
|
||||
res = insertBCD(record);
|
||||
res = insertBcd(record);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
|
|
@ -51,7 +58,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
}
|
||||
|
||||
private int updateTaskStatus(int taskId, int i) {
|
||||
int res=0;
|
||||
int res;
|
||||
res=backReceiveMapper.updateTaskStatus(taskId,i);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -59,10 +66,22 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int setCodeBack(BackApplyInfo record) {
|
||||
int res = 0;
|
||||
int res=0;
|
||||
try{
|
||||
//todo 此处需要判断 接收数量是否大于退料数量或者查询待接收数量是否为0
|
||||
|
||||
BackApplyInfo[] arr = record.getArr();
|
||||
if (arr.length>0){
|
||||
for (int i=0;i< arr.length;i++){
|
||||
//根据maId和taskId查询是否已接收
|
||||
int re = backReceiveMapper.selectCodeByMaIdAndTaskId(arr[i].getMaId(),record.getTaskId());
|
||||
if (re>0){
|
||||
res=-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (res==-1){
|
||||
return res;
|
||||
}
|
||||
}
|
||||
int taskId = record.getTaskId();
|
||||
//修改任务状态
|
||||
res= updateTaskStatus(taskId,39);
|
||||
|
|
@ -70,7 +89,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
//插入back_check_details
|
||||
res = insertBCD(record);
|
||||
res = insertBcd(record);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
|
|
@ -83,7 +102,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int endBack(BackApplyInfo record) {
|
||||
int res =0;
|
||||
int res;
|
||||
try{
|
||||
int taskId = record.getTaskId();
|
||||
//修改任务状态
|
||||
|
|
@ -95,11 +114,11 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
//合格的插入入库记录input_apply_details,修改库存ma_type,修改机具状态
|
||||
List<BackApplyInfo> hgList = backReceiveMapper.getHgList(record);
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
res = insertIAD(hgList);
|
||||
res = insertIad(hgList);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("input_apply_details");
|
||||
}
|
||||
res = updateMT(hgList);
|
||||
res = updateMt(hgList);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("ma_type");
|
||||
}
|
||||
|
|
@ -112,22 +131,22 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(record);
|
||||
if(wxList!=null && wxList.size()>0){
|
||||
//插入任务表tm_task
|
||||
int newTaskId = insertTT(wxList,41,record.getCreateBy());
|
||||
int newTaskId = insertTt(wxList,41,record.getCreateBy());
|
||||
//插入协议任务表tm_task_agreement
|
||||
res = insertTTA(newTaskId,wxList);
|
||||
res = insertTta(newTaskId,wxList);
|
||||
//插入维修记录表repair_apply_details
|
||||
res = insertRAD(newTaskId,wxList);
|
||||
res = insertRad(newTaskId,wxList);
|
||||
}
|
||||
//待报废的创建报废任务,插入任务协议表
|
||||
|
||||
List<BackApplyInfo> bfList = backReceiveMapper.getBfList(record);
|
||||
if(bfList!=null && bfList.size()>0){
|
||||
//插入任务表tm_task
|
||||
int newTaskId = insertTT(bfList,57,record.getCreateBy());
|
||||
int newTaskId = insertTt(bfList,57,record.getCreateBy());
|
||||
//插入协议任务表tm_task_agreement
|
||||
res = insertTTA(newTaskId,bfList);
|
||||
res = insertTta(newTaskId,bfList);
|
||||
//插入维修记录表scrap_apply_details
|
||||
res = insertSAD(newTaskId,bfList);
|
||||
res = insertSad(newTaskId,bfList);
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException(e.getMessage());
|
||||
|
|
@ -150,7 +169,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return backReceiveMapper.backReceiveRecord(record);
|
||||
}
|
||||
|
||||
private int insertRAD(int taskId, List<BackApplyInfo> wxList) {
|
||||
private int insertRad(int taskId, List<BackApplyInfo> wxList) {
|
||||
int result = 0;
|
||||
if(wxList !=null){
|
||||
for( BackApplyInfo wx : wxList ){
|
||||
|
|
@ -161,7 +180,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return result;
|
||||
}
|
||||
|
||||
private int insertSAD(int taskId, List<BackApplyInfo> list) {
|
||||
private int insertSad(int taskId, List<BackApplyInfo> list) {
|
||||
int result = 0;
|
||||
if(list !=null){
|
||||
for( BackApplyInfo bf : list ){
|
||||
|
|
@ -172,21 +191,21 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return result;
|
||||
}
|
||||
|
||||
private int insertTTA(int taskId, List<BackApplyInfo> list) {
|
||||
int res = 0 ;
|
||||
private int insertTta(int taskId, List<BackApplyInfo> list) {
|
||||
int res;
|
||||
String agreementId = list.get(0).getAgreementId();
|
||||
res = backReceiveMapper.insertTTA(taskId,agreementId);
|
||||
return res;
|
||||
}
|
||||
|
||||
private int insertTT(List<BackApplyInfo> hgList, int taskType,String createBy) {
|
||||
int newTask = 0;
|
||||
private int insertTt(List<BackApplyInfo> hgList, int taskType,String createBy) {
|
||||
int newTask;
|
||||
//生成单号
|
||||
String code = genCodeRule(taskType);
|
||||
BackApplyInfo applyInfo = new BackApplyInfo();
|
||||
applyInfo.setTaskType(taskType);
|
||||
String taskStatus="";
|
||||
if(41 == taskType){
|
||||
if(GlobalConstants.FORTY_ONE == taskType){
|
||||
taskStatus = "43";
|
||||
}
|
||||
if(57 == taskType){
|
||||
|
|
@ -219,7 +238,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int updateMT(List<BackApplyInfo> hgList) {
|
||||
private int updateMt(List<BackApplyInfo> hgList) {
|
||||
int res =0;
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
for(BackApplyInfo bi : hgList){
|
||||
|
|
@ -229,7 +248,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int insertIAD(List<BackApplyInfo> hgList) {
|
||||
private int insertIad(List<BackApplyInfo> hgList) {
|
||||
int res =0;
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
for(BackApplyInfo bi : hgList){
|
||||
|
|
@ -239,7 +258,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int insertBCD(BackApplyInfo record) {
|
||||
private int insertBcd(BackApplyInfo record) {
|
||||
int res =0;
|
||||
BackApplyInfo[] arr = record.getArr();
|
||||
if(arr.length>0){
|
||||
|
|
@ -268,7 +287,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
}
|
||||
|
||||
|
||||
// 编号生成规则
|
||||
/**
|
||||
* 编号生成规则
|
||||
*/
|
||||
private String genCodeRule(int taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
|
||||
/**
|
||||
* 根据任务id查询出库数据
|
||||
*
|
||||
* @param parentId 任务id
|
||||
* @return 出库数据集合
|
||||
*/
|
||||
|
|
@ -45,19 +46,24 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
|
||||
/**
|
||||
* 领料出库处理
|
||||
*
|
||||
* @param record 出库对象
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult submitOut(LeaseOutDetails record) {
|
||||
String maStatus = "15";
|
||||
double outNum = 0.1;
|
||||
if (StringUtils.isNull(record)) {
|
||||
return AjaxResult.error("领料出库失败,请检查参数是否填写完整!");
|
||||
}
|
||||
String status = leaseOutDetailsMapper.getMachineStatus(record);
|
||||
if (status.equals("16")){
|
||||
return AjaxResult.error("领料出库失败,该设备不是在库状态!");
|
||||
if (!(Integer.valueOf(0) == record.getMaId() || record.getMaId() == null)) {
|
||||
String status = leaseOutDetailsMapper.getMachineStatus(record);
|
||||
if (!maStatus.equals(status)) {
|
||||
return AjaxResult.error("领料出库失败,该设备不是在库状态!");
|
||||
}
|
||||
}
|
||||
if (record.getOutNum() == null || record.getOutNum() < 0.1) {
|
||||
if (record.getOutNum() == null || record.getOutNum() < outNum) {
|
||||
record.setOutNum(1.00);
|
||||
}
|
||||
// 首先更新领料任务详情表的领料数及状态
|
||||
|
|
@ -76,23 +82,23 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
if (insertSelectiveNum > 0) {
|
||||
if (updateMaTypeStockNum > 0) {
|
||||
// if (updateMaMachineStatus > 0) {
|
||||
// if (insertAgreementInfo > 0) {
|
||||
// if (insertAgreementInfo > 0) {
|
||||
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId());
|
||||
int i = 0;
|
||||
for (LeaseApplyDetails bean : leaseApplyDetailsList){
|
||||
if (Objects.equals(bean.getPreNum(), bean.getAlNum())){
|
||||
for (LeaseApplyDetails bean : leaseApplyDetailsList) {
|
||||
if (Objects.equals(bean.getPreNum(), bean.getAlNum())) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
String taskId = leaseOutDetailsMapper.getTaskId(record.getParentId());
|
||||
if (i == leaseApplyDetailsList.size()){
|
||||
leaseOutDetailsMapper.updateTaskStatus(taskId,35);
|
||||
}else {
|
||||
leaseOutDetailsMapper.updateTaskStatus(taskId,34);
|
||||
if (i == leaseApplyDetailsList.size()) {
|
||||
leaseOutDetailsMapper.updateTaskStatus(taskId, 35);
|
||||
} else {
|
||||
leaseOutDetailsMapper.updateTaskStatus(taskId, 34);
|
||||
}
|
||||
return AjaxResult.success("领料出库成功!");
|
||||
// }
|
||||
// return AjaxResult.error("领料出库失败,插入任务协议信息错误!");
|
||||
// }
|
||||
// return AjaxResult.error("领料出库失败,插入任务协议信息错误!");
|
||||
// }
|
||||
// return AjaxResult.error("领料出库失败,最后更新设备状态错误!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.bonus.sgzb.app.mapper.PurchaseInputMapper;
|
|||
import com.bonus.sgzb.app.service.PurchaseInputService;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -92,6 +93,8 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
|
|||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(28);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
purchaseInputMapper.updateTmTask(task);
|
||||
}
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -340,20 +340,6 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
List<LeaseApplyDetails> listLeaseDetails = new ArrayList<>();
|
||||
for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
|
||||
if (leaseApplyInfo != null) {
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
//获取当前用户所属公司id
|
||||
Long companyId = sysUser.getCompanyId();
|
||||
//获取当前用户的角色
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : roles) {
|
||||
sb.append(s);
|
||||
}
|
||||
String rolesStr = sb.toString();
|
||||
//如果是内部人员,加上所属公司
|
||||
if (rolesStr.contains("nbry") && !rolesStr.contains("admin")) {
|
||||
leaseApplyInfo.setCompanyId(Integer.parseInt(companyId.toString()));
|
||||
}
|
||||
// 去查询领料任务详情表
|
||||
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
||||
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.bonus.sgzb.base.controller;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.sgzb.base.domain.*;
|
||||
import com.bonus.sgzb.base.domain.vo.dictVo;
|
||||
import com.bonus.sgzb.base.domain.vo.DictVo;
|
||||
import com.bonus.sgzb.base.service.RepairService;
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
|
|
@ -10,7 +10,6 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -46,7 +45,6 @@ public class RepairController extends BaseController {
|
|||
/**
|
||||
* 导出维修任务列表
|
||||
*/
|
||||
//@RequiresPermissions("domain:details:export")
|
||||
@Log(title = "导出维修任务列表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RepairTask bean)
|
||||
|
|
@ -154,7 +152,7 @@ public class RepairController extends BaseController {
|
|||
@GetMapping("/getDicSelect")
|
||||
public AjaxResult getDicSelect(@RequestParam String value)
|
||||
{
|
||||
List<dictVo> list = service.getDicSelect(value);
|
||||
List<DictVo> list = service.getDicSelect(value);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ public class RepairApplyRecord implements Serializable {
|
|||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;//
|
||||
private String remark;
|
||||
/**
|
||||
* 报废原因
|
||||
*/
|
||||
@ApiModelProperty(value = "报废原因")
|
||||
private String scrapReason;//
|
||||
private String scrapReason;
|
||||
/**
|
||||
* 报废类型(0:自然报废,1任务报废)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public class RepairPartDetails {
|
|||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;//
|
||||
private String remark;
|
||||
/**
|
||||
* 维修内容
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -65,12 +65,21 @@ public class RepairTask {
|
|||
@ApiModelProperty(value = "维修状态")
|
||||
@Excel(name = "维修状态",sort = 7)
|
||||
private String repairStatus;
|
||||
private String keyword;//关键字
|
||||
private String startTime;//开始时间
|
||||
private String endTime;//结束时间
|
||||
private Long companyId;//
|
||||
private Long agreementId;//
|
||||
private String repairStatusCode;//
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyword;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
private Long companyId;
|
||||
private Long agreementId;
|
||||
private String repairStatusCode;
|
||||
/**
|
||||
* 维修机具类型
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ public class RepairTaskDetails {
|
|||
*/
|
||||
@ApiModelProperty(value = "维修人")
|
||||
private String repairer;
|
||||
private String keyword;//关键字
|
||||
private String typeId;//规格ID
|
||||
private Long companyId;//规格ID
|
||||
private String keyword;
|
||||
private String typeId;
|
||||
private Long companyId;
|
||||
/**
|
||||
* 任务创建人
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,14 +3,12 @@ package com.bonus.sgzb.base.domain.vo;
|
|||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author c liu
|
||||
* @date 2023/12/17
|
||||
*/
|
||||
@Data
|
||||
public class dictVo extends BaseEntity {
|
||||
public class DictVo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long id;
|
||||
private String name;
|
||||
|
|
@ -4,7 +4,7 @@ import com.bonus.sgzb.base.domain.RepairApplyRecord;
|
|||
import com.bonus.sgzb.base.domain.RepairPartDetails;
|
||||
import com.bonus.sgzb.base.domain.RepairTask;
|
||||
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||
import com.bonus.sgzb.base.domain.vo.dictVo;
|
||||
import com.bonus.sgzb.base.domain.vo.DictVo;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -18,44 +18,144 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface RepairMapper {
|
||||
|
||||
/**
|
||||
* 获取维修任务列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairTask> getRepairTaskList(RepairTask bean);
|
||||
|
||||
/**
|
||||
* 获取维修详细列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean);
|
||||
|
||||
|
||||
/**
|
||||
* 新增维修记录
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int addRecord(RepairApplyRecord bean);
|
||||
|
||||
/**
|
||||
* 根据id查询维修明细
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
RepairTaskDetails getById(Long id);
|
||||
|
||||
/**
|
||||
* 修改维修数量
|
||||
* @param id
|
||||
* @param repairNum
|
||||
* @param repairer
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int updateRepairedNum(@Param("id") Long id, @Param("repairNum")int repairNum,@Param("repairer") Long repairer,@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 修改报废数量
|
||||
* @param id
|
||||
* @param scrapNum
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int updateScrapNum(@Param("id")Long id, @Param("scrapNum")int scrapNum,@Param("userId")Long userId);
|
||||
|
||||
/**
|
||||
* 新增配件维修记录
|
||||
* @param partDetails
|
||||
* @return
|
||||
*/
|
||||
int addPart(RepairPartDetails partDetails);
|
||||
|
||||
/**
|
||||
* 完成维修更改维修状态
|
||||
* @param ids
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int completeRepair(@Param("ids") ArrayList<Long> ids, @Param("userId")Long userId);
|
||||
|
||||
/**
|
||||
* 查询维修人员列表
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> selectUserList();
|
||||
|
||||
/**
|
||||
* 修改维修任务状态
|
||||
* @param taskList
|
||||
* @param userid
|
||||
* @return
|
||||
*/
|
||||
int updateTaskStatus(@Param("taskList")List<RepairTask> taskList,@Param("userId") Long userid);
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
int addTask(RepairTask task);
|
||||
|
||||
/**
|
||||
* 查询协议Id
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
Long getAgreementId(RepairTask task);
|
||||
|
||||
/**
|
||||
* 新增 协议与任务关联
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
int createAgreementTask(RepairTask task);
|
||||
|
||||
/**
|
||||
* 修改维修数量
|
||||
* @param id
|
||||
* @param repairNum
|
||||
* @param userid
|
||||
* @return
|
||||
*/
|
||||
int updateRepairedNumTwo(@Param("id")Long id, @Param("repairNum")int repairNum, @Param("userId")Long userid);
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否存在未完成维修的
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
int getUnFinish(RepairTask task);
|
||||
|
||||
List<dictVo> getDicSelect(String value);
|
||||
/**
|
||||
* 根据value获取字典数据
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
List<DictVo> getDicSelect(String value);
|
||||
|
||||
/**
|
||||
* 根据任务Id获取维修详细
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
List<RepairTaskDetails> getDetailsListByTaskId(RepairTask task);
|
||||
|
||||
/**
|
||||
* 新增实验建议审核数据
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
int addAuditDetails(RepairTaskDetails details);
|
||||
|
||||
/**
|
||||
* 导出维修任务
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairTask> exportRepairTaskList(RepairTask bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ package com.bonus.sgzb.base.service;
|
|||
import com.bonus.sgzb.base.domain.RepairApplyRecord;
|
||||
import com.bonus.sgzb.base.domain.RepairTask;
|
||||
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||
import com.bonus.sgzb.base.domain.vo.TreeSelect;
|
||||
import com.bonus.sgzb.base.domain.vo.dictVo;
|
||||
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;
|
||||
|
||||
|
|
@ -17,24 +16,65 @@ import java.util.List;
|
|||
*/
|
||||
public interface RepairService {
|
||||
|
||||
|
||||
/**
|
||||
* 获取维修任务列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairTask> getRepairTaskList(RepairTask bean);
|
||||
|
||||
|
||||
/**
|
||||
* 获取维修详细列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean);
|
||||
|
||||
/**
|
||||
* 新增维修记录
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
AjaxResult submitRepairApply(RepairApplyRecord bean);
|
||||
|
||||
|
||||
/**
|
||||
* 快捷维修记录
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
AjaxResult fastRepairApply(List<RepairTaskDetails> list);
|
||||
|
||||
/**
|
||||
* 完成维修
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int completeRepair(ArrayList<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询维修人员列表
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> selectUserList();
|
||||
|
||||
/**
|
||||
* 提交审核
|
||||
* @param taskList
|
||||
* @return
|
||||
*/
|
||||
AjaxResult endRepairTask(List<RepairTask> taskList);
|
||||
|
||||
List<dictVo> getDicSelect(String value);
|
||||
/**
|
||||
* 根据value获取字典数据
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
List<DictVo> getDicSelect(String value);
|
||||
|
||||
/**
|
||||
* 导出维修列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairTask> exportRepairTaskList(RepairTask bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@ import com.bonus.sgzb.base.domain.RepairApplyRecord;
|
|||
import com.bonus.sgzb.base.domain.RepairPartDetails;
|
||||
import com.bonus.sgzb.base.domain.RepairTask;
|
||||
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||
import com.bonus.sgzb.base.domain.vo.dictVo;
|
||||
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.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.service.TokenService;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||
|
|
@ -17,10 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author c liu
|
||||
|
|
@ -31,9 +28,6 @@ public class RepairServiceImpl implements RepairService {
|
|||
@Autowired
|
||||
private RepairMapper mapper;
|
||||
|
||||
@Resource
|
||||
private TokenService TokenService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<RepairTask> getRepairTaskList(RepairTask bean) {
|
||||
|
|
@ -53,12 +47,14 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult submitRepairApply( RepairApplyRecord bean) {
|
||||
RepairTaskDetails details = mapper.getById(bean.getId());
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
bean.setCreateBy(loginUser.getUserid());
|
||||
List<RepairPartDetails> partList = bean.getPartList();
|
||||
String nbType = "1";
|
||||
String fcType = "2";
|
||||
if (partList != null && partList.size()>0){
|
||||
bean.setRepairNum(partList.get(0).getRepairNum());
|
||||
bean.setRepairer(partList.get(0).getRepairer());
|
||||
|
|
@ -92,9 +88,11 @@ public class RepairServiceImpl implements RepairService {
|
|||
mapper.updateScrapNum(bean.getId(), scrapNum,loginUser.getUserid());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (partList != null && partList.size()>0){
|
||||
if (bean.getRepairType().equals("1")){
|
||||
if (nbType.equals(bean.getRepairType())){
|
||||
for (RepairPartDetails partDetails : partList){
|
||||
if(partDetails.getPartId() != null){
|
||||
if (partDetails.getPartCost() == null || partDetails.getPartCost().isEmpty()){
|
||||
|
|
@ -109,7 +107,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (bean.getRepairType().equals("2")){
|
||||
if (fcType.equals(bean.getRepairType())){
|
||||
bean.setPartName(partList.get(0).getPartName());
|
||||
bean.setPartType(partList.get(0).getPartType());
|
||||
bean.setRepairContent(partList.get(0).getRepairContent());
|
||||
|
|
@ -132,7 +130,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult fastRepairApply(List<RepairTaskDetails> list) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
for (RepairTaskDetails bean : list){
|
||||
|
|
@ -159,7 +157,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult endRepairTask(List<RepairTask> taskList) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
for (RepairTask task : taskList){
|
||||
|
|
@ -187,7 +185,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<dictVo> getDicSelect(String value) {
|
||||
public List<DictVo> getDicSelect(String value) {
|
||||
return mapper.getDicSelect(value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ public class CommonUtil {
|
|||
* @date 2023/12/14 18:54
|
||||
*/
|
||||
public Integer totalValue(List<Map<String, String>> list, String maType) {
|
||||
if (CollectionUtils.isEmpty(list) || StringUtils.isEmpty(maType)) return 0;
|
||||
if (CollectionUtils.isEmpty(list) || StringUtils.isEmpty(maType)) {
|
||||
return 0;
|
||||
}
|
||||
BigDecimal value = new BigDecimal(new Double(0).toString());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map<String, String> map = list.get(i);
|
||||
|
|
@ -113,7 +115,7 @@ public class CommonUtil {
|
|||
BigDecimal jjValue = new BigDecimal(new Double(0).toString());
|
||||
BigDecimal tsValue = new BigDecimal(new Double(0).toString());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if(Objects.isNull(list.get(i))){
|
||||
if (Objects.isNull(list.get(i))) {
|
||||
continue;
|
||||
}
|
||||
if (Objects.equals(list.get(i).getCompanyName(), CommonConstants.JJ)) {
|
||||
|
|
@ -246,7 +248,9 @@ public class CommonUtil {
|
|||
* @date 2023/12/15 19:21
|
||||
*/
|
||||
public Integer setZKData(List<ScrapAnalysisVo> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return 0;
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return 0;
|
||||
}
|
||||
BigDecimal totalValue = new BigDecimal(new Double(0).toString());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ScrapAnalysisVo vo = list.get(i);
|
||||
|
|
@ -265,7 +269,9 @@ public class CommonUtil {
|
|||
* @date 2023/12/16 13:20
|
||||
*/
|
||||
public Integer setDRKData(List<ScrapAnalysisVo> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return 0;
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return 0;
|
||||
}
|
||||
BigDecimal finalValue = new BigDecimal(new Double(0).toString());
|
||||
BigDecimal totalValue = new BigDecimal(new Double(0).toString());
|
||||
BigDecimal totalValue2 = new BigDecimal(new Double(0).toString());
|
||||
|
|
@ -289,7 +295,9 @@ public class CommonUtil {
|
|||
* @date 2023/12/16 14:01
|
||||
*/
|
||||
public Integer setUSEData(List<ScrapAnalysisVo> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return 0;
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return 0;
|
||||
}
|
||||
BigDecimal finalValue = new BigDecimal(new Double(0).toString());
|
||||
BigDecimal totalValue = new BigDecimal(new Double(0).toString());
|
||||
BigDecimal totalValue2 = new BigDecimal(new Double(0).toString());
|
||||
|
|
@ -316,7 +324,9 @@ public class CommonUtil {
|
|||
* @date 2023/12/16 14:07
|
||||
*/
|
||||
public Integer setZXData(List<ScrapAnalysisVo> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return 0;
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return 0;
|
||||
}
|
||||
/*维修总量/维修合格数量/维修报废数量/待维修数量*/
|
||||
BigDecimal repairValue = new BigDecimal(new Double(0).toString());
|
||||
BigDecimal repairedValue = new BigDecimal(new Double(0).toString());
|
||||
|
|
@ -344,7 +354,9 @@ public class CommonUtil {
|
|||
* @date 2023/12/16 14:22
|
||||
*/
|
||||
public Integer setBFData(List<ScrapAnalysisVo> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return 0;
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return 0;
|
||||
}
|
||||
BigDecimal totalValue = new BigDecimal(new Double(0).toString());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ScrapAnalysisVo vo = list.get(i);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ spring:
|
|||
# 环境配置
|
||||
active: sgzb_cloud_dev
|
||||
cloud:
|
||||
loadbalancer:
|
||||
# 关闭Ribbon的负载均衡器
|
||||
ribbon:
|
||||
enabled: false
|
||||
# 开启Nacos的负载均衡器
|
||||
nacos:
|
||||
enabled: true
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@
|
|||
<select id="getMenuById" resultType="com.bonus.sgzb.app.domain.AppMenu">
|
||||
select amu.id,
|
||||
amu.menu_id as menuId,
|
||||
am.icon_name as iconName
|
||||
am.icon_name as iconName,
|
||||
am.icon_mark as iconMark
|
||||
from app_menu_user amu
|
||||
left join app_menu am on am.id = amu.menu_id
|
||||
where user_id = #{userId}
|
||||
|
|
|
|||
|
|
@ -276,22 +276,11 @@
|
|||
</insert>
|
||||
<update id="audit">
|
||||
UPDATE tm_task tt
|
||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
<if test="taskStatus == 107">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='5',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 109">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='7',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 103">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='1',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 105">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='3',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
SET tt.task_status = '38',bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.direct_audit_time=NOW()
|
||||
WHERE
|
||||
bai.id = #{id}
|
||||
bai.id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="refuse">
|
||||
|
|
@ -299,16 +288,16 @@
|
|||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
<if test="taskStatus == 108">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='6',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='6',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 110">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='8',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='8',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 104">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='2',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='2',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 106">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='4',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='4',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
WHERE
|
||||
bai.id = #{id}
|
||||
|
|
|
|||
|
|
@ -738,6 +738,16 @@
|
|||
ORDER BY
|
||||
bcd.create_time DESC
|
||||
</select>
|
||||
<select id="selectCodeByMaIdAndTaskId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
back_check_details cbd
|
||||
LEFT JOIN back_apply_info bai ON bai.id = cbd.parent_id
|
||||
WHERE
|
||||
cbd.ma_id = #{maId}
|
||||
AND bai.task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
update ma_type set num = #{num} where type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateByTaskIdTypeId">
|
||||
update purchase_check_details set check_num = #{inputNum},status = #{status} where task_id = #{taskId} and type_id = #{typeId}
|
||||
update purchase_check_details set check_num = #{inputNum},status = #{status},input_num=#{inputNum},input_status='1',input_time=NOW() where task_id = #{taskId} and type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateMacodeByType">
|
||||
update purchase_macode_info
|
||||
|
|
|
|||
|
|
@ -616,30 +616,6 @@
|
|||
update_by = #{record.companyAuditBy},
|
||||
update_time = now(),
|
||||
</if>
|
||||
<if test="record.examineStatusId == 103 and record.examineStatusId == '103'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 1,
|
||||
</if>
|
||||
<if test="record.examineStatusId == 105 and record.examineStatusId == '105'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 3,
|
||||
</if>
|
||||
<if test="record.examineStatusId == 107 and record.examineStatusId == '107'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 5,
|
||||
</if>
|
||||
<if test="record.examineStatusId == 109 and record.examineStatusId == '109'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 7,
|
||||
</if>
|
||||
</trim>
|
||||
WHERE
|
||||
task_id = #{record.taskId}
|
||||
|
|
@ -665,30 +641,6 @@
|
|||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
</if>
|
||||
<if test="record.examineStatusId == 104 and record.examineStatusId == '104'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 2,
|
||||
</if>
|
||||
<if test="record.examineStatusId == 106 and record.examineStatusId == '106'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 4,
|
||||
</if>
|
||||
<if test="record.examineStatusId == 108 and record.examineStatusId == '108'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 6,
|
||||
</if>
|
||||
<if test="record.examineStatusId == 110 and record.examineStatusId == '110'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
status = 8,
|
||||
</if>
|
||||
</trim>
|
||||
WHERE
|
||||
task_id = #{record.taskId}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@
|
|||
from repair_apply_details
|
||||
where task_id = #{taskId} and status = '0'
|
||||
</select>
|
||||
<select id="getDicSelect" resultType="com.bonus.sgzb.base.domain.vo.dictVo">
|
||||
<select id="getDicSelect" resultType="com.bonus.sgzb.base.domain.vo.DictVo">
|
||||
select s2.id,
|
||||
s2.name
|
||||
from sys_dic s1
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE mt.`level` = '4' AND mt.`del_flag` = '0'
|
||||
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt3.type_name like concat('%', #{typeName}, '%')
|
||||
AND mt2.type_name like concat('%', #{typeName}, '%')
|
||||
</if>
|
||||
ORDER BY mt.type_id DESC
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -215,6 +215,6 @@ public class BackApplyController extends BaseController {
|
|||
{
|
||||
List<BackApplyInfo> list = backApplyService.exportList(bean);
|
||||
ExcelUtil<BackApplyInfo> util = new ExcelUtil<BackApplyInfo>(BackApplyInfo.class);
|
||||
util.exportExcel(response, list, "新购验收任务数据");
|
||||
util.exportExcel(response, list, "退料申请数据");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.controller;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
|
|
@ -12,6 +13,8 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -93,6 +96,19 @@ public class PurchaseAccessoryController extends BaseController
|
|||
return toAjax(purchaseAccessoryService.updatePurchaseCheckDetails(purchasePartDetailsList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购配件验收导出
|
||||
*/
|
||||
@ApiOperation("新购配件验收导出")
|
||||
@Log(title = "新购配件验收导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PurchasePartInfo bean)
|
||||
{
|
||||
List<PurchasePartInfo> list = purchaseAccessoryService.exportList(bean);
|
||||
ExcelUtil<PurchasePartInfo> util = new ExcelUtil<PurchasePartInfo>(PurchasePartInfo.class);
|
||||
util.exportExcel(response, list, "新购配件验收数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -136,4 +152,17 @@ public class PurchaseAccessoryController extends BaseController
|
|||
public AjaxResult checkInput(@RequestBody List<PurchasePartDetails> purchasePartDetails){
|
||||
return toAjax(purchaseAccessoryService.checkInput(purchasePartDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购配件入库导出
|
||||
*/
|
||||
@ApiOperation("新购配件入库导出")
|
||||
@Log(title = "新购配件入库导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/inputExport")
|
||||
public void inputExport(HttpServletResponse response, PurchasePartDetails bean)
|
||||
{
|
||||
List<PurchasePartDetails> list = purchaseAccessoryService.inputExport(bean);
|
||||
ExcelUtil<PurchasePartDetails> util = new ExcelUtil<PurchasePartDetails>(PurchasePartDetails.class);
|
||||
util.exportExcel(response, list, "新购配件入库数据");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
|
@ -33,6 +35,47 @@ public class PurchasePartDetails extends BaseEntity
|
|||
@ApiModelProperty(value = "规格id")
|
||||
private Long modelId;
|
||||
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
@Excel(name = "采购单号")
|
||||
private String code;
|
||||
|
||||
/** 采购日期 */
|
||||
@ApiModelProperty(value = "采购日期")
|
||||
@Excel(name = "采购日期")
|
||||
private String purchaseTime;
|
||||
|
||||
/** 到货日期 */
|
||||
@ApiModelProperty(value = "到货日期")
|
||||
@Excel(name = "到货日期")
|
||||
private String arrivalTime;
|
||||
|
||||
@ApiModelProperty(value = "机具类型名称")
|
||||
@Excel(name = "配件类型")
|
||||
private String machineTypeName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationType;
|
||||
|
||||
/** 采购员 */
|
||||
@ApiModelProperty(value = "采购员")
|
||||
@Excel(name = "采购员")
|
||||
private String purchaserName;
|
||||
|
||||
/** 创建者 */
|
||||
@Excel(name = "提交入库人员")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "提交入库时间" , dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
/** 采购单价 */
|
||||
@ApiModelProperty(value = "采购单价")
|
||||
private String purchasePrice;
|
||||
|
|
@ -43,6 +86,7 @@ public class PurchasePartDetails extends BaseEntity
|
|||
|
||||
/** 验收数量 */
|
||||
@ApiModelProperty(value = "验收数量")
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal checkNum;
|
||||
|
||||
/** 绑定数量 */
|
||||
|
|
@ -67,6 +111,7 @@ public class PurchasePartDetails extends BaseEntity
|
|||
|
||||
/** 状态结果 */
|
||||
@ApiModelProperty(value = "状态结果")
|
||||
@Excel(name = "状态")
|
||||
private String statusResult;
|
||||
|
||||
/** 出厂日期 */
|
||||
|
|
@ -106,31 +151,19 @@ public class PurchasePartDetails extends BaseEntity
|
|||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String specificationType;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "机具类型名称")
|
||||
private String machineTypeName;
|
||||
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private String manageType;
|
||||
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "关键字筛选")
|
||||
private String keyWord;
|
||||
|
||||
public void setTaskId(Long taskId)
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
|
@ -370,6 +403,50 @@ public class PurchasePartDetails extends BaseEntity
|
|||
this.inputBy = inputBy;
|
||||
}
|
||||
|
||||
public String getPurchaseTime() {
|
||||
return purchaseTime;
|
||||
}
|
||||
|
||||
public void setPurchaseTime(String purchaseTime) {
|
||||
this.purchaseTime = purchaseTime;
|
||||
}
|
||||
|
||||
public String getArrivalTime() {
|
||||
return arrivalTime;
|
||||
}
|
||||
|
||||
public void setArrivalTime(String arrivalTime) {
|
||||
this.arrivalTime = arrivalTime;
|
||||
}
|
||||
|
||||
public String getPurchaserName() {
|
||||
return purchaserName;
|
||||
}
|
||||
|
||||
public void setPurchaserName(String purchaserName) {
|
||||
this.purchaserName = purchaserName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -39,43 +39,46 @@ public class PurchasePartInfo extends BaseEntity
|
|||
@Excel(name = "到货日期")
|
||||
private String arrivalTime;
|
||||
|
||||
/** 采购员名称 */
|
||||
@ApiModelProperty(value = "采购员名称")
|
||||
@Excel(name = "采购员")
|
||||
private String purchaserName;
|
||||
|
||||
/** 采购员 */
|
||||
@ApiModelProperty(value = "采购员")
|
||||
private Long purchaser;
|
||||
|
||||
/** 采购机具设备名称 */
|
||||
@ApiModelProperty(value = "采购机具设备")
|
||||
@Excel(name = "机具类型名称")
|
||||
@Excel(name = "配件名称")
|
||||
private String purchasingTypeName;
|
||||
|
||||
/** 采购机具设备型号 */
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
@Excel(name = "配件规格")
|
||||
private String purchasingTypeCode;
|
||||
|
||||
/** 采购员名称 */
|
||||
@ApiModelProperty(value = "采购员名称")
|
||||
@Excel(name = "采购员")
|
||||
private String purchaserName;
|
||||
|
||||
/** 管理模式 */
|
||||
@ApiModelProperty(value = "管理模式")
|
||||
@Excel(name = "管理模式",readConverterExp = "0=编码管理,1=计数管理")
|
||||
private String manageType;
|
||||
|
||||
/** 机具厂家 */
|
||||
@ApiModelProperty(value = "机具厂家")
|
||||
@Excel(name = "机具厂家")
|
||||
private String supplier;
|
||||
/** 采购单价 */
|
||||
@ApiModelProperty(value = "采购单价")
|
||||
@Excel(name = "采购单价")
|
||||
private String purchasePrice;
|
||||
|
||||
/** 采购数量 */
|
||||
@ApiModelProperty(value = "采购数量")
|
||||
@Excel(name = "采购数量")
|
||||
private String purchaseNum;
|
||||
|
||||
/** 配件厂家 */
|
||||
@ApiModelProperty(value = "配件厂家")
|
||||
@Excel(name = "配件厂家")
|
||||
private String supplier;
|
||||
|
||||
/** 验收数量 */
|
||||
@ApiModelProperty(value = "验收数量")
|
||||
@Excel(name = "验收数量")
|
||||
private String checkNum;
|
||||
|
||||
/** 采购状态 */
|
||||
|
|
@ -324,6 +327,14 @@ public class PurchasePartInfo extends BaseEntity
|
|||
this.taskStatusResult = taskStatusResult;
|
||||
}
|
||||
|
||||
public String getPurchasePrice() {
|
||||
return purchasePrice;
|
||||
}
|
||||
|
||||
public void setPurchasePrice(String purchasePrice) {
|
||||
this.purchasePrice = purchasePrice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -86,4 +86,18 @@ public interface PurchaseAccessoryMapper
|
|||
int updatePartTypeNum(@Param("partId") Long partId,@Param("inputNum") BigDecimal inputNum);
|
||||
|
||||
int setlectStatusById(Long id);
|
||||
|
||||
/**
|
||||
* 新购配件导出
|
||||
* @param bean
|
||||
* @return List<PurchasePartInfo>
|
||||
*/
|
||||
List<PurchasePartInfo> exportList(PurchasePartInfo bean);
|
||||
|
||||
/**
|
||||
* 新购配件入库导出
|
||||
* @param bean
|
||||
* @return List<PurchasePartInfo>
|
||||
*/
|
||||
List<PurchasePartDetails> inputExport(PurchasePartDetails bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,4 +72,7 @@ public interface RepairAuditDetailsMapper
|
|||
|
||||
List<RepairAuditDetailsVO> exportRepairQuestList(RepairAuditDetails bean);
|
||||
|
||||
List<RepairAuditDetails> selectRepairInputByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectScrapNumByTaskId(Long taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,4 +73,18 @@ public interface IPurchaseAccessoryService
|
|||
List<PurchasePartDetails> selectPutinDetails(PurchasePartDetails purchasePartDetails);
|
||||
|
||||
int checkInput(List<PurchasePartDetails> purchasePartDetails);
|
||||
|
||||
/**
|
||||
* 新购配件导出
|
||||
* @param bean
|
||||
* @return List<PurchasePartInfo>
|
||||
*/
|
||||
List<PurchasePartInfo> exportList(PurchasePartInfo bean);
|
||||
|
||||
/**
|
||||
* 新购配件入库导出
|
||||
* @param bean
|
||||
* @return List<PurchasePartDetails>
|
||||
*/
|
||||
List<PurchasePartDetails> inputExport(PurchasePartDetails bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,6 +281,16 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService
|
|||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchasePartInfo> exportList(PurchasePartInfo bean) {
|
||||
return purchaseAccessoryMapper.exportList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchasePartDetails> inputExport(PurchasePartDetails bean) {
|
||||
return purchaseAccessoryMapper.inputExport(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购配件--采购单号编码生成规则
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -320,18 +320,16 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
purchaseMacodeInfoMapper.updateMacodeByType(purchaseMacodeInfo);
|
||||
// 新增入库记录
|
||||
purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 当全部为已入库的时候任务改为入库状态
|
||||
Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
|
||||
if (count <= 0) {
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(28);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
taskMapper.updateTmTask(task);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,84 +167,71 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
throw new Exception("任务已审核已通过");
|
||||
}
|
||||
if ("通过".equals(checkResult)) {
|
||||
|
||||
String taskCode ="";
|
||||
int taskStatus= 0;
|
||||
int taskType = 0;
|
||||
int companyId = 0;
|
||||
// 查询协议表
|
||||
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
||||
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(taskId);
|
||||
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsList) {
|
||||
Long typeId = repairAuditDetails.getTypeId();
|
||||
Long maId = repairAuditDetails.getMaId();
|
||||
BigDecimal repairNum = repairAuditDetails.getRepairedNum();
|
||||
List<RepairAuditDetails> repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
|
||||
List<RepairAuditDetails> scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
||||
if(repairInputList != null && repairInputList.size() > 0){
|
||||
companyId = repairInputList.get(0).getCompanyId();
|
||||
taskCode = purchaseCodeRule("R",50);
|
||||
taskStatus = 53;
|
||||
taskType = 50;
|
||||
long inputTaskId = genTask(taskCode,taskType,taskStatus,tmTaskAgreement,companyId);
|
||||
for (RepairAuditDetails inputDetails : repairInputList) {
|
||||
Long typeId = inputDetails.getTypeId();
|
||||
Long maId = inputDetails.getMaId();
|
||||
BigDecimal repairNum = inputDetails.getRepairedNum();
|
||||
BigDecimal b = new BigDecimal(0);
|
||||
// 创建修饰后入库任务
|
||||
if (repairNum.compareTo(b) > 0) {
|
||||
TmTask task = new TmTask();
|
||||
task.setCode(purchaseCodeRule("R",50));
|
||||
task.setTaskStatus(53);
|
||||
task.setTaskType(50);
|
||||
task.setCompanyId(repairAuditDetails.getCompanyId());
|
||||
task.setCreateTime(new Date());
|
||||
task.setCreateBy(SecurityUtils.getUsername());
|
||||
taskMapper.insertTmTask(task);
|
||||
// 添加协议信息表
|
||||
TmTaskAgreement taskAgreement = new TmTaskAgreement();
|
||||
taskAgreement.setTaskId(task.getTaskId());
|
||||
if (tmTaskAgreement.getAgreementId() == null){
|
||||
throw new ServiceException("缺少协议数据");
|
||||
}else {
|
||||
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
|
||||
if (repairNum.compareTo(b) > 0) {
|
||||
// 添加修试后入库任务
|
||||
RepairInputDetails repairInputDetails = new RepairInputDetails();
|
||||
repairInputDetails.setTaskId(inputTaskId);
|
||||
repairInputDetails.setAuditId(inputDetails.getId());
|
||||
repairInputDetails.setRepairId(inputDetails.getRepairId());
|
||||
repairInputDetails.setRepairNum(inputDetails.getRepairedNum());
|
||||
repairInputDetails.setTypeId(inputDetails.getTypeId());
|
||||
repairInputDetails.setMaId(inputDetails.getMaId());
|
||||
repairInputDetails.setStatus("0");
|
||||
repairInputDetails.setCreateById(SecurityUtils.getUserId());
|
||||
repairInputDetails.setCreateTime(new Date());
|
||||
repairTestInputMapper.insertRepairInputDetails(repairInputDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(scrapNumList != null && scrapNumList.size() > 0){
|
||||
companyId = scrapNumList.get(0).getCompanyId();
|
||||
taskCode = purchaseCodeRule("BF",57);
|
||||
taskStatus = 58;
|
||||
taskType = 57;
|
||||
long scrapTaskId = genTask(taskCode,taskType,taskStatus,tmTaskAgreement,companyId);
|
||||
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
||||
Long typeId = scrapDetails.getTypeId();
|
||||
Long maId = scrapDetails.getMaId();
|
||||
BigDecimal b = new BigDecimal(0);
|
||||
// 创建报废任务
|
||||
BigDecimal scrapNum = scrapDetails.getScrapNum();
|
||||
if (scrapNum.compareTo(b) > 0) {
|
||||
// 添加退料任务
|
||||
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||
scrapApplyDetails.setTaskId(scrapTaskId);
|
||||
scrapApplyDetails.setTypeId(typeId);
|
||||
scrapApplyDetails.setMaId(maId);
|
||||
scrapApplyDetails.setScrapNum(scrapNum);
|
||||
scrapApplyDetails.setScrapSource("2");
|
||||
scrapApplyDetails.setStatus("0");
|
||||
scrapApplyDetails.setParentId(scrapDetails.getId());
|
||||
scrapApplyDetails.setCreateById(SecurityUtils.getUserId());
|
||||
scrapApplyDetails.setCreateTime(new Date());
|
||||
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
||||
}
|
||||
taskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||
agreementMapper.insertTmTaskAgreement(taskAgreement);
|
||||
|
||||
// 添加修试后入库任务
|
||||
RepairInputDetails repairInputDetails = new RepairInputDetails();
|
||||
repairInputDetails.setTaskId(task.getTaskId());
|
||||
repairInputDetails.setAuditId(repairAuditDetails.getId());
|
||||
repairInputDetails.setRepairId(repairAuditDetails.getRepairId());
|
||||
repairInputDetails.setRepairNum(repairAuditDetails.getRepairedNum());
|
||||
repairInputDetails.setTypeId(repairAuditDetails.getTypeId());
|
||||
repairInputDetails.setMaId(repairAuditDetails.getMaId());
|
||||
repairInputDetails.setStatus("0");
|
||||
repairInputDetails.setCreateById(SecurityUtils.getUserId());
|
||||
repairInputDetails.setCreateTime(new Date());
|
||||
repairTestInputMapper.insertRepairInputDetails(repairInputDetails);
|
||||
}
|
||||
|
||||
// 创建报废任务
|
||||
BigDecimal scrapNum = repairAuditDetails.getScrapNum();
|
||||
if (scrapNum.compareTo(b) > 0) {
|
||||
TmTask task = new TmTask();
|
||||
task.setCode(purchaseCodeRule("BF",57));
|
||||
task.setTaskStatus(58);
|
||||
task.setTaskType(57);
|
||||
task.setCompanyId(repairAuditDetails.getCompanyId());
|
||||
task.setCreateTime(new Date());
|
||||
task.setCreateBy(SecurityUtils.getUsername());
|
||||
taskMapper.insertTmTask(task);
|
||||
// 添加协议信息表
|
||||
TmTaskAgreement taskAgreement = new TmTaskAgreement();
|
||||
taskAgreement.setTaskId(task.getTaskId());
|
||||
if (tmTaskAgreement.getAgreementId() == null){
|
||||
throw new ServiceException("缺少协议数据");
|
||||
}else {
|
||||
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
|
||||
}
|
||||
agreementMapper.insertTmTaskAgreement(taskAgreement);
|
||||
|
||||
// 添加退料任务
|
||||
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||
scrapApplyDetails.setTaskId(task.getTaskId());
|
||||
scrapApplyDetails.setTypeId(typeId);
|
||||
scrapApplyDetails.setMaId(maId);
|
||||
scrapApplyDetails.setScrapNum(scrapNum);
|
||||
scrapApplyDetails.setScrapSource("2");
|
||||
scrapApplyDetails.setStatus("0");
|
||||
scrapApplyDetails.setParentId(repairAuditDetails.getId());
|
||||
scrapApplyDetails.setCreateById(SecurityUtils.getUserId());
|
||||
scrapApplyDetails.setCreateTime(new Date());
|
||||
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
||||
|
||||
}
|
||||
}
|
||||
// 修饰审核通过时改修任务为已通过审核
|
||||
task1.setTaskStatus(47);
|
||||
|
|
@ -265,6 +252,29 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
return 1;
|
||||
}
|
||||
|
||||
private long genTask(String taskCode,int taskType,int taskStatus,TmTaskAgreement tmTaskAgreement,int companyId){
|
||||
TmTask task = new TmTask();
|
||||
task.setCode(taskCode);
|
||||
task.setTaskStatus(taskStatus);
|
||||
task.setTaskType(taskType);
|
||||
task.setCompanyId(companyId);
|
||||
task.setCreateTime(new Date());
|
||||
task.setCreateBy(SecurityUtils.getUsername());
|
||||
taskMapper.insertTmTask(task);
|
||||
// 添加协议信息表
|
||||
TmTaskAgreement taskAgreement = new TmTaskAgreement();
|
||||
long taskId = task.getTaskId();
|
||||
taskAgreement.setTaskId(taskId);
|
||||
if (tmTaskAgreement.getAgreementId() == null){
|
||||
throw new ServiceException("缺少协议数据");
|
||||
}else {
|
||||
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
|
||||
}
|
||||
taskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||
agreementMapper.insertTmTaskAgreement(taskAgreement);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 采购单号编码生成规则
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ spring:
|
|||
# 环境配置
|
||||
active: sgzb_cloud_dev
|
||||
cloud:
|
||||
loadbalancer:
|
||||
# 关闭Ribbon的负载均衡器
|
||||
ribbon:
|
||||
enabled: false
|
||||
# 开启Nacos的负载均衡器
|
||||
nacos:
|
||||
enabled: true
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
|
|
|
|||
|
|
@ -253,18 +253,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
UPDATE tm_task tt
|
||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
<if test="taskStatus == 107">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='5',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 109">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='7',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 103">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='1',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 105">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='3',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
SET tt.task_status = '38',bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='1',bai.direct_audit_time=NOW()
|
||||
WHERE
|
||||
bai.id = #{id}
|
||||
</update>
|
||||
|
|
@ -274,16 +263,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
<if test="taskStatus == 108">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='6',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='6',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 110">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='8',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='8',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 104">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='2',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='2',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
<if test="taskStatus == 106">
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='4',bai.direct_audit_time=NOW()
|
||||
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status='4',bai.direct_audit_time=NOW()
|
||||
</if>
|
||||
WHERE
|
||||
bai.id = #{id}
|
||||
|
|
|
|||
|
|
@ -266,25 +266,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectPutInListList" resultMap="PurchasePartInfoResult">
|
||||
select pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
|
||||
pci.update_by,
|
||||
pci.update_time, pci.remark, pci.company_id ,tk.code,tk.task_status taskStatus,
|
||||
CASE
|
||||
tk.task_status
|
||||
WHEN 69 THEN '待入库'
|
||||
WHEN 70 THEN '已入库'
|
||||
ELSE ''
|
||||
END taskStatusResult,
|
||||
su.user_name purchaserName
|
||||
from purchase_part_info pci
|
||||
left join tm_task tk on pci.task_id = tk.task_id
|
||||
left join sys_user su on pci.purchaser = su.user_id
|
||||
SELECT
|
||||
pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, us.user_name as createBy, pci.create_time,
|
||||
pci.update_by,
|
||||
pci.update_time, pci.remark, pci.company_id ,tk.code,tk.task_status taskStatus,GROUP_CONCAT(distinct mpt1.pa_name) purchasingTypeName,
|
||||
CASE
|
||||
tk.task_status
|
||||
WHEN 69 THEN '待入库'
|
||||
WHEN 70 THEN '已入库'
|
||||
ELSE ''
|
||||
END taskStatusResult,
|
||||
su.user_name purchaserName
|
||||
FROM
|
||||
purchase_part_details ppd
|
||||
LEFT JOIN purchase_part_info pci on pci.task_id=ppd.task_id
|
||||
left join tm_task tk on pci.task_id = tk.task_id
|
||||
left join sys_user su on pci.purchaser = su.user_id
|
||||
left join ma_part_type mpt on ppd.part_id = mpt.pa_id
|
||||
left join ma_part_type mpt1 on mpt.parent_id = mpt1.pa_id
|
||||
LEFT JOIN sys_user us on us.user_id = pci.create_by
|
||||
where task_type = 67 and tk.task_status in (69,70)
|
||||
<if test="keyWord != null and keyWord != ''">and tk.code like concat('%',#{keyWord},'%')</if>
|
||||
<if test="purchaseTime != null and purchaseTime != ''">and pci.purchase_time = #{purchaseTime}</if>
|
||||
<if test="arrivalTime != null and arrivalTime != ''">and pci.arrival_time = #{arrivalTime}</if>
|
||||
<if test="purchaser != null ">and pci.purchaser = #{purchaser}</if>
|
||||
<if test="companyId != null ">and pci.company_id = #{companyId}</if>
|
||||
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
|
||||
<if test="submitStorageTime != null and submitStorageTime != ''"> and pci.create_time like concat('%',#{submitStorageTime},'%')</if>
|
||||
<if test="partId != null and partId != ''"> and mpt1.pa_id in (#{partId})</if>
|
||||
GROUP BY task_id
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="selectPurchasePartDetailsStatus" resultType="java.lang.Integer">
|
||||
|
|
@ -347,4 +352,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mt.pa_id = #{partId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="exportList" resultType="com.bonus.sgzb.material.domain.PurchasePartInfo">
|
||||
SELECT
|
||||
tk.`code`,
|
||||
ppi.purchase_time as purchaseTime,
|
||||
ppi.arrival_time as arrivalTime,
|
||||
mpt2.pa_name as purchasingTypeName,
|
||||
mpt.pa_name as purchasingTypeCode,
|
||||
su.user_name purchaserName,
|
||||
ppd.purchase_price as purchasePrice,
|
||||
ppd.purchase_num as purchaseNum,
|
||||
msi.supplier,
|
||||
CASE
|
||||
WHEN ppd.`status` = 0 THEN '待验收'
|
||||
WHEN ppd.`status` = 1 THEN '已验收'
|
||||
WHEN ppd.`status` = 2 THEN '验收不通过'
|
||||
WHEN ppd.`status` = 3 THEN '已入库'
|
||||
ELSE ''
|
||||
END AS purchasingStatus
|
||||
FROM
|
||||
purchase_part_details ppd
|
||||
LEFT JOIN purchase_part_info ppi on ppd.task_id=ppi.task_id
|
||||
LEFT JOIN tm_task tk ON ppi.task_id = tk.task_id
|
||||
LEFT JOIN ( SELECT id, NAME FROM sys_dic WHERE p_id = 67 ) dict ON tk.task_status = dict.id
|
||||
LEFT JOIN sys_user su ON ppi.purchaser = su.user_id
|
||||
LEFT JOIN ma_part_type mpt on mpt.pa_id=ppd.part_id
|
||||
LEFT JOIN ma_part_type mpt2 on mpt2.pa_id=mpt.parent_id
|
||||
LEFT JOIN ma_supplier_info msi on msi.supplier_id=ppd.supplier_id
|
||||
WHERE
|
||||
task_type = 67
|
||||
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
|
||||
<if test="purchaseTime != null and purchaseTime != ''"> and ppi.purchase_time = #{purchaseTime}</if>
|
||||
<if test="arrivalTime != null and arrivalTime != ''"> and ppi.arrival_time = #{arrivalTime}</if>
|
||||
<if test="purchaser != null "> and ppi.purchaser = #{purchaser}</if>
|
||||
<if test="companyId != null "> and ppi.company_id = #{companyId}</if>
|
||||
ORDER BY
|
||||
ppi.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="inputExport" resultType="com.bonus.sgzb.material.domain.PurchasePartDetails">
|
||||
|
||||
SELECT
|
||||
tk.task_id as taskId,
|
||||
tk.`code`,
|
||||
pci.purchase_time as purchaseTime, pci.arrival_time as arrivalTime,mpt2.pa_name as machineTypeName,
|
||||
mpt.pa_name as specificationType,su.user_name purchaserName, us.user_name as createBy, pci.create_time as createTime,ppd.check_num as checkNum,
|
||||
CASE
|
||||
WHEN ppd.`status` = 0 THEN '待验收'
|
||||
WHEN ppd.`status` = 1 THEN '待入库'
|
||||
WHEN ppd.`status` = 2 THEN '验收不通过'
|
||||
WHEN ppd.`status` = 3 THEN '已入库'
|
||||
ELSE ''
|
||||
END AS statusResult
|
||||
FROM
|
||||
purchase_part_details ppd
|
||||
LEFT JOIN purchase_part_info pci on pci.task_id=ppd.task_id
|
||||
left join tm_task tk on pci.task_id = tk.task_id
|
||||
left join sys_user su on pci.purchaser = su.user_id
|
||||
left join ma_part_type mpt on ppd.part_id = mpt.pa_id
|
||||
left join ma_part_type mpt2 on mpt.parent_id = mpt2.pa_id
|
||||
LEFT JOIN sys_user us on us.user_id = pci.create_by
|
||||
where task_type = 67 and tk.task_status in (69,70)
|
||||
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
|
||||
<if test="submitStorageTime != null and submitStorageTime != ''"> and pci.create_time like concat('%',#{submitStorageTime},'%')</if>
|
||||
<if test="partId != null and partId != ''"> and mpt2.pa_id in (#{partId})</if>
|
||||
ORDER BY tk.task_id DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -210,7 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<update id="updateByTaskIdTypeId">
|
||||
update purchase_check_details set check_num = #{inputNum},status = #{status} where task_id = #{taskId} and type_id = #{typeId}
|
||||
update purchase_check_details set check_num = #{inputNum},status = #{status},input_num=#{inputNum},input_status='1',input_time=NOW() where task_id = #{taskId} and type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateCheckDetails">
|
||||
update purchase_check_details set status = '0' where task_id = #{taskId}
|
||||
|
|
|
|||
|
|
@ -145,11 +145,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectPutInListList" resultMap="PurchaseCheckInfoResult">
|
||||
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time, pci.update_by,
|
||||
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.user_name purchaserName,
|
||||
tk.create_by
|
||||
tk.create_by,
|
||||
CASE tk.task_status
|
||||
WHEN 28 THEN
|
||||
tk.update_time
|
||||
ELSE
|
||||
''
|
||||
END as inputTime,
|
||||
CASE tk.task_status
|
||||
WHEN 28 THEN
|
||||
us.user_name
|
||||
ELSE
|
||||
''
|
||||
END as inputUser
|
||||
from purchase_check_info pci
|
||||
left join tm_task tk on pci.task_id = tk.task_id
|
||||
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
|
||||
left join sys_user su on pci.purchaser = su.user_id
|
||||
LEFT JOIN sys_user us on us.user_id = tk.update_by
|
||||
where task_type = 23 and tk.task_status in (26,28)
|
||||
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
|
||||
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectRepairAuditDetailsVo">
|
||||
select id, task_id, repair_id, ma_id, type_id, repair_num, repaired_num, scrap_num, audit_by, audit_time, audit_remark, status, create_by, create_time, update_by, update_time, remark, company_id from repair_audit_details
|
||||
SELECT
|
||||
rd.id,
|
||||
rd.task_id,
|
||||
rd.repair_id,
|
||||
rd.ma_id,
|
||||
rd.type_id,
|
||||
rd.repair_num,
|
||||
rd.repaired_num,
|
||||
rd.scrap_num,
|
||||
rd.audit_by,
|
||||
rd.audit_time,
|
||||
rd.audit_remark,
|
||||
rd.STATUS,
|
||||
rd.create_by,
|
||||
rd.create_time,
|
||||
rd.update_by,
|
||||
rd.update_time,
|
||||
rd.remark,
|
||||
mt.company_id
|
||||
FROM
|
||||
repair_audit_details rd
|
||||
LEFT JOIN ma_type mt on rd.type_id = mt.type_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
||||
|
|
@ -276,5 +297,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
) t
|
||||
GROUP BY task_id
|
||||
</select>
|
||||
<select id="selectRepairInputByTaskId" resultType="com.bonus.sgzb.material.domain.RepairAuditDetails">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and repaired_num > 0
|
||||
</select>
|
||||
<select id="selectScrapNumByTaskId" resultType="com.bonus.sgzb.material.domain.RepairAuditDetails">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and scrap_num > 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -15,6 +15,13 @@ spring:
|
|||
# 环境配置
|
||||
active: sgzb_cloud_dev
|
||||
cloud:
|
||||
loadbalancer:
|
||||
# 关闭Ribbon的负载均衡器
|
||||
ribbon:
|
||||
enabled: false
|
||||
# 开启Nacos的负载均衡器
|
||||
nacos:
|
||||
enabled: true
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"author": "机具",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||
"dev": "vue-cli-service serve",
|
||||
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
|
|
|
|||
|
|
@ -37,13 +37,14 @@ module.exports = {
|
|||
[process.env.VUE_APP_BASE_API]: {
|
||||
// target: `http://112.29.103.165:21626`,//线上环境-重庆
|
||||
// target: `http://112.29.103.165:21624`,//线上环境-宁夏
|
||||
target: `http://192.168.0.14:21624`,//线上环境
|
||||
// target: `http://192.168.5.21:8080`,//
|
||||
// target: `http://192.168.0.14:21624`,//线上环境
|
||||
// target: `http://192.168.5.12:8080`,//丁
|
||||
// target: `http://10.40.92.21:8080`,
|
||||
// target: `http://10.40.92.13:8080`,
|
||||
|
||||
// target: `http://10.40.92.126:8080`,//高
|
||||
// target: `http://10.40.92.104:8080`,//亮
|
||||
// target: `http://192.168.0.166:8080`,//刘川
|
||||
target: `http://10.40.92.21:8080`,//梁超
|
||||
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue