代码合并终

This commit is contained in:
2023-02-06 13:33:48 +08:00
parent 51041ad52d
commit abc9af79c4
28 changed files with 951 additions and 104 deletions

View File

@@ -0,0 +1,59 @@
package com.njcn.process.controller;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.process.pojo.vo.IssueesAndOrderVO;
import com.njcn.process.pojo.vo.OrderCountVO;
import com.njcn.process.service.RStatDistributionProblemService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 16:33【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/rStatWorkOrder")
@Api(tags = "工单管理")
@AllArgsConstructor
public class RStatWorkOrderController extends BaseController {
private final RStatDistributionProblemService rStatDistributionProblemService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
@PostMapping("/queryIssuesAndOrder")
@ApiOperation("查询问题及工单(当前部门下)")
@ApiImplicitParam(name = "orgNo", value = "部门id", required = true)
public HttpResult<IssueesAndOrderVO> queryIssuesAndOrder(@RequestParam("orgNo") String orgNo){
String methodDescribe = getMethodDescribe("queryIssuesAndOrder");
IssueesAndOrderVO issueesAndOrderVO =rStatDistributionProblemService.queryIssuesAndOrder(orgNo);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, issueesAndOrderVO, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
@PostMapping("/queryOrderDetail")
@ApiOperation("查询工单及工单总数及完成工单数量(当前部门下)")
@ApiImplicitParam(name = "orgNo", value = "部门id", required = true)
public HttpResult<OrderCountVO> queryOrderDetail(@RequestParam("orgNo") String orgNo){
String methodDescribe = getMethodDescribe("queryOrderDetail");
OrderCountVO orderCountVO =rStatDistributionProblemService.queryOrderCount(orgNo);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, orderCountVO, methodDescribe);
}
}

View File

@@ -0,0 +1,16 @@
package com.njcn.process.mapper;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.process.pojo.po.RStatDistributionProblemPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 14:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface RStatDistributionProblemMapper extends MppBaseMapper<RStatDistributionProblemPO> {
}

View File

@@ -0,0 +1,16 @@
package com.njcn.process.mapper;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.process.pojo.po.RStatWorkOrderDetailPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 14:13【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface RStatWorkOrderDetailMapper extends MppBaseMapper<RStatWorkOrderDetailPO> {
}

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.process.mapper.RStatDistributionProblemMapper">
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.RStatDistributionProblemPO">
<!--@mbg.generated-->
<!--@Table r_stat_distribution_problem-->
<id column="problem_no" jdbcType="VARCHAR" property="problemNo" />
<result column="problem_type" jdbcType="VARCHAR" property="problemType" />
<result column="occur_time" jdbcType="TIMESTAMP" property="occurTime" />
<result column="distribution_id" jdbcType="VARCHAR" property="distributionId" />
<result column="last_time" jdbcType="TIMESTAMP" property="lastTime" />
<result column="check_status" jdbcType="VARCHAR" property="checkStatus" />
<result column="check_result" jdbcType="VARCHAR" property="checkResult" />
<result column="handle_time" jdbcType="TIMESTAMP" property="handleTime" />
<result column="measurement_point_id" jdbcType="VARCHAR" property="measurementPointId" />
<result column="problem_describe" jdbcType="VARCHAR" property="problemDescribe" />
<result column="supply_describe" jdbcType="VARCHAR" property="supplyDescribe" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
problem_no, problem_type, occur_time, distribution_id, last_time, check_status, check_result,
handle_time, measurement_point_id, problem_describe, supply_describe
</sql>
</mapper>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.process.mapper.RStatWorkOrderDetailMapper">
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.RStatWorkOrderDetailPO">
<!--@mbg.generated-->
<!--@Table r_stat_work_order_detail-->
<id column="problem_no" jdbcType="VARCHAR" property="problemNo" />
<result column="work_order_status" jdbcType="VARCHAR" property="workOrderStatus" />
<result column="work_order_type" jdbcType="VARCHAR" property="workOrderType" />
<result column="primary_business_type" jdbcType="VARCHAR" property="primaryBusinessType" />
<result column="two_business_type" jdbcType="VARCHAR" property="twoBusinessType" />
<result column="power_supply_station" jdbcType="VARCHAR" property="powerSupplyStation" />
<result column="work_order_process" jdbcType="VARCHAR" property="workOrderProcess" />
<result column="whbz" jdbcType="VARCHAR" property="whbz" />
<result column="work_order_leader" jdbcType="VARCHAR" property="workOrderLeader" />
<result column="work_order_over_time" jdbcType="TIMESTAMP" property="workOrderOverTime" />
<result column="expect_ask_feedback_time" jdbcType="TIMESTAMP" property="expectAskFeedbackTime" />
<result column="pick_up_person" jdbcType="VARCHAR" property="pickUpPerson" />
<result column="distribution_time" jdbcType="TIMESTAMP" property="distributionTime" />
<result column="expiration_time" jdbcType="TIMESTAMP" property="expirationTime" />
<result column="relation_device" jdbcType="VARCHAR" property="relationDevice" />
<result column="enclosure" jdbcType="VARCHAR" property="enclosure" />
<result column="copy_for" jdbcType="VARCHAR" property="copyFor" />
<result column="ask_feedback_time" jdbcType="TIMESTAMP" property="askFeedbackTime" />
<result column="planned_completion_time" jdbcType="TIMESTAMP" property="plannedCompletionTime" />
<result column="cause_feedback" jdbcType="VARCHAR" property="causeFeedback" />
<result column="check_status" jdbcType="VARCHAR" property="checkStatus" />
<result column="check_comments" jdbcType="VARCHAR" property="checkComments" />
<result column="rectify_complete_time" jdbcType="TIMESTAMP" property="rectifyCompleteTime" />
<result column="rectify_person" jdbcType="VARCHAR" property="rectifyPerson" />
<result column="rectify_describe" jdbcType="VARCHAR" property="rectifyDescribe" />
<result column="assess_complete_time" jdbcType="TIMESTAMP" property="assessCompleteTime" />
<result column="assess_result" jdbcType="VARCHAR" property="assessResult" />
<result column="assess_describe" jdbcType="VARCHAR" property="assessDescribe" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
problem_no, work_order_status, work_order_type, primary_business_type, two_business_type,
power_supply_station, work_order_process, whbz, work_order_leader, work_order_over_time,
expect_ask_feedback_time, pick_up_person, distribution_time, expiration_time, relation_device,
enclosure, copy_for, ask_feedback_time, planned_completion_time, cause_feedback,
check_status, check_comments, rectify_complete_time, rectify_person, rectify_describe,
assess_complete_time, assess_result, assess_describe
</sql>
</mapper>

View File

@@ -0,0 +1,35 @@
package com.njcn.process.service;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.process.pojo.po.RStatDistributionProblemPO;
import com.njcn.process.pojo.vo.IssueesAndOrderVO;
import com.njcn.process.pojo.vo.OrderCountVO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 14:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface RStatDistributionProblemService extends IMppService<RStatDistributionProblemPO> {
/**
* @Description: 查询问题及工单(当前部门下)
* @Param: [orgNo]
* @return: com.njcn.process.pojo.vo.IssueesAndOrderVO
* @Author: clam
* @Date: 2023/2/2
*/
IssueesAndOrderVO queryIssuesAndOrder(String orgNo);
/**
* @Description: 查询工单及工单总数及完成工单数量(当前部门下)
* @Param: [orgNo]
* @return: com.njcn.process.pojo.vo.OrderCountVO
* @Author: clam
* @Date: 2023/2/2
*/
OrderCountVO queryOrderCount(String orgNo);
}

View File

@@ -0,0 +1,17 @@
package com.njcn.process.service;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.process.pojo.po.RStatWorkOrderDetailPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 14:13【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface RStatWorkOrderDetailService extends IMppService<RStatWorkOrderDetailPO> {
}

View File

@@ -0,0 +1,96 @@
package com.njcn.process.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.process.mapper.RStatDistributionProblemMapper;
import com.njcn.process.mapper.RStatWorkOrderDetailMapper;
import com.njcn.process.pojo.po.RStatDistributionProblemPO;
import com.njcn.process.pojo.po.RStatWorkOrderDetailPO;
import com.njcn.process.pojo.vo.IssueesAndOrderVO;
import com.njcn.process.pojo.vo.OrderCountVO;
import com.njcn.process.service.RStatDistributionProblemService;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.user.api.DeptFeignClient;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 14:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@AllArgsConstructor
public class RStatDistributionProblemServiceImpl extends MppServiceImpl<RStatDistributionProblemMapper, RStatDistributionProblemPO> implements RStatDistributionProblemService{
private final DeptFeignClient deptFeignClient;
private final RStatDistributionProblemMapper rStatDistributionProblemMapper;
private final RStatWorkOrderDetailMapper rStatWorkOrderDetailMapper;
/**
* @param orgNo
* @Description: 查询问题及工单(当前部门下)
* @Param: [orgNo]
* @return: com.njcn.process.pojo.vo.IssueesAndOrderVO
* @Author: clam
* @Date: 2023/2/2
*/
@Override
public IssueesAndOrderVO queryIssuesAndOrder(String orgNo) {
IssueesAndOrderVO issueesAndOrderVO = new IssueesAndOrderVO();
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(orgNo).getData();
/*问题个数*/
QueryWrapper<RStatDistributionProblemPO> problemPOQueryWrapper = new QueryWrapper<> ();
problemPOQueryWrapper.select ("problem_no").
in ("org_no",deptIds);
List<RStatDistributionProblemPO> rStatDistributionProblemPOS = rStatDistributionProblemMapper.selectList (problemPOQueryWrapper);
issueesAndOrderVO.setId (orgNo);
issueesAndOrderVO.setIssueesCount (rStatDistributionProblemPOS.size ());
List<String> problemNoList = rStatDistributionProblemPOS.stream ( ).map (RStatDistributionProblemPO::getProblemNo).collect (Collectors.toList ( ));
/*已关联工单数量*/
QueryWrapper<RStatWorkOrderDetailPO> workOrderDetailPOQueryWrapper = new QueryWrapper<> ();
workOrderDetailPOQueryWrapper.select ("1").
in("problem_no",problemNoList).
in ("org_no",deptIds);
Integer relatedOrderCount = rStatWorkOrderDetailMapper.selectCount (workOrderDetailPOQueryWrapper);
issueesAndOrderVO.setRelatedOrderCount (relatedOrderCount);
return issueesAndOrderVO;
}
/**
* @param orgNo
* @Description: 查询工单及工单总数及完成工单数量(当前部门下)
* @Param: [orgNo]
* @return: com.njcn.process.pojo.vo.OrderCountVO
* @Author: clam
* @Date: 2023/2/2
*/
@Override
public OrderCountVO queryOrderCount(String orgNo) {
OrderCountVO orderCountVO = new OrderCountVO();
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(orgNo).getData();
/*工单数量*/
QueryWrapper<RStatWorkOrderDetailPO> workOrderDetailPOQueryWrapper = new QueryWrapper<> ();
workOrderDetailPOQueryWrapper.
in ("org_no",deptIds);
List<RStatWorkOrderDetailPO> rStatWorkOrderDetailPOS = rStatWorkOrderDetailMapper.selectList (workOrderDetailPOQueryWrapper);
orderCountVO.setId (orgNo);
orderCountVO.setOrderCount (rStatWorkOrderDetailPOS.size ());
/*已完成工单数量*/
long count = rStatWorkOrderDetailPOS.stream ( ).filter (t -> Objects.equals (t.getWorkOrderStatus ( ), DicDataEnum.CLOSED.getCode ())).count ( );
orderCountVO.setCompelteOrderCount (Integer.valueOf (count+""));
return orderCountVO;
}
}

View File

@@ -0,0 +1,20 @@
package com.njcn.process.service.impl;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.process.mapper.RStatWorkOrderDetailMapper;
import com.njcn.process.pojo.po.RStatWorkOrderDetailPO;
import com.njcn.process.service.RStatWorkOrderDetailService;
import org.springframework.stereotype.Service;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/2/1 14:13【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class RStatWorkOrderDetailServiceImpl extends MppServiceImpl<RStatWorkOrderDetailMapper, RStatWorkOrderDetailPO> implements RStatWorkOrderDetailService{
}