Compare commits
5 Commits
c745ed3117
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2efb5ad5f | ||
|
|
90bdd2b8e5 | ||
|
|
3cd1dfdbca | ||
|
|
82cb7ef34d | ||
|
|
f5b61d1b4b |
@@ -14,11 +14,11 @@
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/lideeyunji-info.log</file>
|
||||
<file>${log.path}/gr_report-info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/lideeyunji-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<fileNamePattern>${log.path}/gr_report-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
@@ -36,11 +36,11 @@
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/lideeyunji-error.log</file>
|
||||
<file>${log.path}/gr_report-error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/lideeyunji-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<fileNamePattern>${log.path}/gr_report-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
@@ -156,53 +156,55 @@ public class ByglBygdBjPlugin implements AroundAdvicePlugin {
|
||||
byManagementGdMapper.updateById(gd);
|
||||
|
||||
String planId = gd.getPlanId();
|
||||
|
||||
//查询当前计划的工单
|
||||
LambdaQueryWrapper<ByManagementGd> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ByManagementGd::getPlanId, planId);
|
||||
wrapper.eq(ByManagementGd::getOrderState, ByglConstant.BY_STATE_YWC);
|
||||
List<ByManagementGd> byManagementGds = byManagementGdMapper.selectList(wrapper);
|
||||
if(planId !=null){
|
||||
//查询当前计划的工单
|
||||
LambdaQueryWrapper<ByManagementGd> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ByManagementGd::getPlanId, planId);
|
||||
wrapper.eq(ByManagementGd::getOrderState, ByglConstant.BY_STATE_YWC);
|
||||
List<ByManagementGd> byManagementGds = byManagementGdMapper.selectList(wrapper);
|
||||
|
||||
|
||||
//当前计划
|
||||
ByManagementPlan plan = byManagementPlanMapper.selectById(planId);
|
||||
//当前计划
|
||||
ByManagementPlan plan = byManagementPlanMapper.selectById(planId);
|
||||
|
||||
//保养周期
|
||||
String interval = plan.getScheduledInterval();
|
||||
if("1".equals(interval)) {//周期为180天
|
||||
//如果有两条已完成的工单,则将计划状态修改为已完成
|
||||
if(byManagementGds.size() >= 2) {
|
||||
plan.setPlanState(ByglConstant.JH_STATE_YWC);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
}else{
|
||||
String planUpkeepTime = gd.getPlanUpkeepTime();
|
||||
// 解析完成时间(只有日期部分,需要转换为LocalDateTime)
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate completeLocalDate = LocalDate.parse(planUpkeepTime, formatter);
|
||||
LocalDateTime completeDate = completeLocalDate.atStartOfDay();
|
||||
|
||||
// 往后推180天
|
||||
LocalDateTime nextMaintenanceDate = adjustToNextMonthFirstDayIfNeeded(completeDate.plusDays(180));
|
||||
|
||||
// 判断是否超过本年
|
||||
int completeYear = completeDate.getYear();
|
||||
int nextMaintenanceYear = nextMaintenanceDate.getYear();
|
||||
boolean isCrossYear = nextMaintenanceYear > completeYear;
|
||||
|
||||
if(isCrossYear){
|
||||
//保养周期
|
||||
String interval = plan.getScheduledInterval();
|
||||
if("1".equals(interval)) {//周期为180天
|
||||
//如果有两条已完成的工单,则将计划状态修改为已完成
|
||||
if(byManagementGds.size() >= 2) {
|
||||
plan.setPlanState(ByglConstant.JH_STATE_YWC);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
}else{
|
||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String nextMaintenanceDateStr = nextMaintenanceDate.format(dateFormatter);
|
||||
plan.setNextUpkeepTime(nextMaintenanceDateStr);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
String planUpkeepTime = gd.getPlanUpkeepTime();
|
||||
// 解析完成时间(只有日期部分,需要转换为LocalDateTime)
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate completeLocalDate = LocalDate.parse(planUpkeepTime, formatter);
|
||||
LocalDateTime completeDate = completeLocalDate.atStartOfDay();
|
||||
|
||||
// 往后推180天
|
||||
LocalDateTime nextMaintenanceDate = adjustToNextMonthFirstDayIfNeeded(completeDate.plusDays(180));
|
||||
|
||||
// 判断是否超过本年
|
||||
int completeYear = completeDate.getYear();
|
||||
int nextMaintenanceYear = nextMaintenanceDate.getYear();
|
||||
boolean isCrossYear = nextMaintenanceYear > completeYear;
|
||||
|
||||
if(isCrossYear){
|
||||
plan.setPlanState(ByglConstant.JH_STATE_YWC);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
}else{
|
||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String nextMaintenanceDateStr = nextMaintenanceDate.format(dateFormatter);
|
||||
plan.setNextUpkeepTime(nextMaintenanceDateStr);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
}
|
||||
}
|
||||
}else if("2".equals(interval)) {//周期为360天
|
||||
plan.setPlanState(ByglConstant.JH_STATE_YWC);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
}
|
||||
}else if("2".equals(interval)) {//周期为360天
|
||||
plan.setPlanState(ByglConstant.JH_STATE_YWC);
|
||||
byManagementPlanMapper.updateById(plan);
|
||||
}
|
||||
|
||||
//都验收成功 生成记录
|
||||
ByManagementJl jl = BeanUtils.toBean(ys, ByManagementJl.class);
|
||||
jl.setId(null);
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceRe
|
||||
import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount;
|
||||
import com.lideeyunji.core.framework.service.INewGrBiSaAggMonthCountService;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import com.lideeyunji.tool.framework.yunji.model.ResultDataModel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -46,6 +47,9 @@ public class stgoodTop10Plugin implements ReportAroundAdvicePlugin {
|
||||
params.put("useYearEnd", lastYear);
|
||||
params.put("useMonthEnd", lastMonth);
|
||||
}
|
||||
if(!params.get("useYearStart").toString().equals(params.get("useYearEnd").toString())){
|
||||
throw new lideeYunJiException("不能跨年查询!");
|
||||
}
|
||||
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
||||
if (params.containsKey("column")) {
|
||||
String orderBy = params.get("column") + " " + params.get("order");
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.service.INewGrBiSaAggMonthCountService;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import com.lideeyunji.tool.framework.yunji.model.ResultDataModel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -43,6 +44,9 @@ public class zdCustomerPlugin implements ReportAroundAdvicePlugin {
|
||||
params.put("useYearEnd", lastYear);
|
||||
params.put("useMonthEnd", lastMonth);
|
||||
}
|
||||
if(!params.get("useYearStart").toString().equals(params.get("useYearEnd").toString())){
|
||||
throw new lideeYunJiException("不能跨年查询!");
|
||||
}
|
||||
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
||||
// if (params.containsKey("column")) {
|
||||
// String orderBy = params.get("column") + " " + params.get("order");
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -50,4 +51,26 @@ public class DevGzbxController {
|
||||
return BaseWebResult.success("审批成功");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/process")
|
||||
public BaseWebResult process(@RequestBody Map<String,Object> model) {
|
||||
Long id = lideeYunJiUtils.getMap2Long(model, "faultId");
|
||||
if(id == null){
|
||||
return BaseWebResult.error(FrameErrorCodeConstants.FRAME_OP_ERROR);
|
||||
}
|
||||
List<Map<String,Object>> data = devGzbxService.process(id);
|
||||
return BaseWebResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/processGd")
|
||||
public BaseWebResult processGd(@RequestBody Map<String,Object> model) {
|
||||
Long id = lideeYunJiUtils.getMap2Long(model, "faultId");
|
||||
if(id == null){
|
||||
return BaseWebResult.error(FrameErrorCodeConstants.FRAME_OP_ERROR);
|
||||
}
|
||||
List<Map<String,Object>> data = devGzbxService.processGd(id);
|
||||
return BaseWebResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class AddFaultReportingFunctionRecord implements AroundAdvicePlugin {
|
||||
devGzbxDO.setFaultNumber(faultNumber);
|
||||
devGzbxDO.setLeaderUserId(leaderUserId);
|
||||
devGzbxDO.setReporter(userId);
|
||||
devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId));
|
||||
// devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId));
|
||||
devGzbxMapper.updateById(devGzbxDO);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.lideeyunji.module.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 故障报修 Service 接口
|
||||
*
|
||||
@@ -11,4 +14,8 @@ public interface DevGzbxService {
|
||||
void auditNotPass(Long id);
|
||||
|
||||
void orderAuditNotPass(Long id);
|
||||
|
||||
List<Map<String, Object>> process(Long id);
|
||||
|
||||
List<Map<String, Object>> processGd(Long id);
|
||||
}
|
||||
|
||||
@@ -5,12 +5,18 @@ import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
||||
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
||||
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
||||
import com.lideeyunji.module.biz.service.DevGzbxService;
|
||||
import com.lideeyunji.service.system.api.IApiAdminUserApi;
|
||||
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 参数配置 Service 实现类
|
||||
*/
|
||||
@@ -24,6 +30,8 @@ public class DevGzbxServiceImpl implements DevGzbxService {
|
||||
|
||||
@Resource
|
||||
private DevGzbxWxgdMapper devGzbxWxgdMapper;
|
||||
@Resource
|
||||
private IApiAdminUserApi userApi;
|
||||
|
||||
@Override
|
||||
public void auditNotPass(Long id) {
|
||||
@@ -41,4 +49,115 @@ public class DevGzbxServiceImpl implements DevGzbxService {
|
||||
devGzbxWxgdMapper.updateById(wxgd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> process(Long id) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(id);
|
||||
DevGzbxWxgdDO gd = devGzbxWxgdMapper.selectOne("gzbx_id", id);
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.put("nodeName", "车间主任审批");
|
||||
model.put("spr",userApi.getUser(devGzbxDO.getLeaderUserId()));
|
||||
model.put("status", "current");
|
||||
model.put("comment", "-");
|
||||
if(devGzbxDO.getLeaderUserZt() == 1){
|
||||
model.put("status", "approved");
|
||||
model.put("comment", devGzbxDO.getLeaderUserYj());
|
||||
}
|
||||
result.add(model);
|
||||
|
||||
Map<String, Object> model1 = new HashMap<>();
|
||||
model1.put("nodeName", "指定部门审批");
|
||||
model1.put("spr",userApi.getUser(devGzbxDO.getAssignDeptLeader()));
|
||||
model1.put("status", "current");
|
||||
model1.put("comment", "-");
|
||||
if(devGzbxDO.getAssignUserZt() == 1){
|
||||
model1.put("status", "approved");
|
||||
model1.put("comment", devGzbxDO.getAssignUserYj());
|
||||
}
|
||||
result.add(model1);
|
||||
|
||||
Map<String, Object> model4 = new HashMap<>();
|
||||
model4.put("nodeName", "车间主任验收");
|
||||
model4.put("status", "current");
|
||||
model4.put("comment", "-");
|
||||
|
||||
Map<String, Object> model5 = new HashMap<>();
|
||||
model5.put("nodeName", "指定部门验收");
|
||||
model5.put("status", "current");
|
||||
model5.put("comment", "-");
|
||||
if (gd != null){
|
||||
model4.put("spr",userApi.getUser(gd.getLeaderUserId()));
|
||||
if(gd.getLeaderYsZt() == 1){
|
||||
model4.put("status", "approved");
|
||||
model4.put("comment", gd.getLeaderYsYj());
|
||||
}
|
||||
model5.put("spr",userApi.getUser(gd.getAssignDeptLeader()));
|
||||
if(gd.getAssignYsZt() == 1){
|
||||
model5.put("status", "approved");
|
||||
model5.put("comment", gd.getAssignYsYj());
|
||||
}
|
||||
}
|
||||
result.add(model4);
|
||||
result.add(model5);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> processGd(Long id) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectById(id);
|
||||
Long gzbxId = devGzbxWxgdDO.getGzbxId();
|
||||
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.put("nodeName", "车间主任审批");
|
||||
model.put("status", "approved");
|
||||
model.put("comment", "-");
|
||||
|
||||
Map<String, Object> model1 = new HashMap<>();
|
||||
model1.put("nodeName", "指定部门审批");
|
||||
model1.put("status", "approved");
|
||||
model1.put("comment", "-");
|
||||
|
||||
Map<String, Object> model4 = new HashMap<>();
|
||||
model4.put("nodeName", "车间主任验收");
|
||||
model4.put("status", "current");
|
||||
model4.put("comment", "-");
|
||||
model4.put("spr",userApi.getUser(devGzbxWxgdDO.getLeaderUserId()));
|
||||
if(devGzbxWxgdDO.getLeaderYsZt() == 1){
|
||||
model4.put("status", "approved");
|
||||
model4.put("comment", devGzbxWxgdDO.getLeaderYsYj());
|
||||
}
|
||||
|
||||
Map<String, Object> model5 = new HashMap<>();
|
||||
model5.put("nodeName", "指定部门验收");
|
||||
model5.put("status", "current");
|
||||
model5.put("comment", "-");
|
||||
model5.put("spr",userApi.getUser(devGzbxWxgdDO.getAssignDeptLeader()));
|
||||
if(devGzbxWxgdDO.getAssignYsZt() == 1){
|
||||
model5.put("status", "approved");
|
||||
model5.put("comment", devGzbxWxgdDO.getAssignYsYj());
|
||||
}
|
||||
|
||||
if (gzbxId != null) {
|
||||
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbxId);
|
||||
model.put("comment", devGzbxDO.getLeaderUserYj());
|
||||
model.put("spr",userApi.getUser(devGzbxDO.getLeaderUserId()));
|
||||
|
||||
model1.put("comment", devGzbxDO.getAssignUserYj());
|
||||
model1.put("spr",userApi.getUser(devGzbxDO.getAssignDeptLeader()));
|
||||
}else {
|
||||
model.put("comment", devGzbxWxgdDO.getLeaderYsYj());
|
||||
model.put("spr",userApi.getUser(devGzbxWxgdDO.getLeaderUserId()));
|
||||
|
||||
model1.put("comment", devGzbxWxgdDO.getAssignYsYj());
|
||||
model1.put("spr",userApi.getUser(devGzbxWxgdDO.getAssignDeptLeader()));
|
||||
}
|
||||
|
||||
result.add(model);
|
||||
result.add(model1);
|
||||
result.add(model4);
|
||||
result.add(model5);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -245,6 +245,7 @@ public class AuthController {
|
||||
userVo.setSupAdmin(supAdminFlag);//是否是超级管理员
|
||||
userVo.setTenantAdmin(tenantAdminFlag);//是否是租户管理员
|
||||
userVo.setSupAdminToken(isSupAdmin());
|
||||
userVo.setMobile(user.getMobile());
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ public class AuthPermissionInfoRespVO {
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
||||
private Set<Long> deptId;
|
||||
|
||||
@Schema(description = "手机号码", example = "15601691300")
|
||||
private String mobile;
|
||||
|
||||
private Long loginDeptId;
|
||||
private Long loginRoleId;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user