Commit 45875084 authored by tianyiming's avatar tianyiming

Merge remote-tracking branch 'origin/develop_dl_plan6_temp' into develop_dl_plan6_temp

parents 3fa70787 31695c11
......@@ -6,6 +6,7 @@ import javax.persistence.Lob;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.TableName;
import org.hibernate.annotations.Where;
......@@ -16,6 +17,7 @@ import org.hibernate.annotations.Where;
@Table(name = "p_input_item")
@NamedQuery(name = "InputItem.findAll", query = "SELECT c FROM InputItem c")
@Where(clause = "is_delete=0")//表示未删除的数据
@TableName("p_input_item")
public class InputItem extends BasicEntity {
private static final long serialVersionUID = 1L;
......
......@@ -114,5 +114,11 @@ public class PlanTaskDetail extends BasicEntity {
this.executorId = executorId;
}
public Date getExecutorDate() {
return executorDate;
}
public void setExecutorDate(Date executorDate) {
this.executorDate = executorDate;
}
}
\ No newline at end of file
package com.yeejoin.amos.patrol.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
......@@ -11,6 +13,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name="p_point_inputitem")
@TableName("p_point_inputitem")
@NamedQuery(name="PointInputItem.findAll", query="SELECT p FROM PointInputItem p")
public class PointInputItem extends BasicEntity{
private static final long serialVersionUID = 1L;
......
......@@ -8,6 +8,7 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonBackReference;
......@@ -17,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
*/
@Entity
@Table(name="p_route_point_item")
@TableName("p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity {
private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.patrol.business.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @ProjectName: YeeAMOSPatrolRoot
* @Package: com.yeejoin.amos.patrol.business.bo
......@@ -125,4 +128,7 @@ public class CheckInputSyncBo extends BasicEntityBo {
private String protectedObjectName;
private String checkTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date date;
}
\ No newline at end of file
......@@ -226,10 +226,19 @@ public class CheckController extends AbstractBaseController {
requestParam.setOrgCode(orgCode);
requestParam.setUserId(getUserId());
requestParam.setCheckDepartmentId(personIdentity.getCompanyId());
requestParam.setCheckDepartmentId(reginParams.getDepartment().getSequenceNbr().toString());
requestParam.setUserName(personIdentity.getPersonName());
requestParam.setDepId(personIdentity.getCompanyId());
requestParam.setDepName(personIdentity.getCompanyName());
if (reginParams.getDepartment() != null && reginParams.getDepartment().getSequenceNbr() != null) {
requestParam.setDepId(reginParams.getDepartment().getSequenceNbr().toString());
}
if (reginParams.getDepartment() != null) {
requestParam.setDepName(reginParams.getDepartment().getDepartmentName());
}
CheckDto checkDto = checkService.saveCheckRecordNew(requestParam,token);
if(StringUtil.isNotEmpty(checkDto)){
asyncTaskf(checkDto.getCheckId());
......
package com.yeejoin.amos.patrol.business.controller;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.dao.mapper.PointInputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.*;
import com.yeejoin.amos.patrol.business.feign.EquipFeign;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
......@@ -22,6 +27,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -104,6 +110,16 @@ public class PointController extends AbstractBaseController {
@Autowired
private IRoutePointItemDao iRoutePointItemDao;
@Autowired
private InputItemMapper inputItemMapper;
@Autowired
private PointInputItemMapper pointInputItemMapper;
@Autowired
private RoutePointItemMapper routePointItemMapper;
/**
*
* 新增接口
......@@ -181,7 +197,7 @@ public class PointController extends AbstractBaseController {
}
@Transactional
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡查对象", notes = "新增巡查对象")
@PostMapping(value = "/addPointXcdx", produces = "application/json;charset=UTF-8")
......@@ -191,9 +207,6 @@ public class PointController extends AbstractBaseController {
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify();
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
if(pointClassify.getId()==null){
newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
newPointClassify.setName(pointClassify.getName());
newPointClassify.setInspectionSpecName(pointClassify.getInspectionName());
......@@ -204,7 +217,6 @@ public class PointController extends AbstractBaseController {
newPointClassify.setDataSourceName(pointClassify.getDataSourceName());
newPointClassify.setAddress(pointClassify.getAddress());
newPointClassify.setBuildingId(pointClassify.getBuildingId());
if(pointClassify.getBuildingName()==null){
FeignClientResult responseModel = equipFeign.getBuildingTreeOne(pointClassify.getBuildingId());
......@@ -225,14 +237,22 @@ public class PointController extends AbstractBaseController {
String uuid= UUID.randomUUID().toString().replace("-","");
newPointClassify.setOriginalId(uuid.substring(0,16));
}
if (null != pointClassify.getId()) {
newPointClassify.setId(pointClassify.getId());
}
newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode());
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> oldInputItemList = new ArrayList<>();
List<Long> collect = new ArrayList<>();
if(pointClassify.getId()==null){
pointClassify.setId(newPointClassify.getId());
}else{
newPointClassify.setId(pointClassify.getId());
List<PointInputItemVo> oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项
oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项
collect = oldInputItemList.stream().map(PointInputItemVo::getPointItemId).collect(Collectors.toList());
List<PointInputItemVo> newInputItemList = new ArrayList<>();
List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData();
newInputItemList.addAll(classList);
......@@ -251,8 +271,9 @@ public class PointController extends AbstractBaseController {
}
});
if (pItemIds.size() > 0) {
iPointInputItemDao.delPointInputItemById(pItemIds);
iRoutePointItemDao.delRoutePointItemByItemId(pItemIds);// 删除p_route_point_item中使用到该项的行
inputItemMapper.delPointInputItemById(pItemIds);
// iPointInputItemDao.delPointInputItemById(pItemIds);
inputItemMapper.delRoutePointItemByItemId(pItemIds);// 删除p_route_point_item中使用到该项的行
}
}
......@@ -264,31 +285,36 @@ public class PointController extends AbstractBaseController {
pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(0);
// pointInputItem.setId(0);
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
pointInputItemMapper.insert(pointInputItem);
// PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
//更新巡检路线
if(routePointList.size()>0){
Long classifyId=newPointClassify.getId();
for (RoutePoint routePoint :routePointList) {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setPointClassifyId(classifyId);
routePointItem.setPointInputItemId(pointInputItemResult.getId());
routePointItem.setPointInputItemId(pointInputItem.getId());
routePointItem.setRoutePointId(routePoint.getId());
iRoutePointItemDao.save(routePointItem);
routePointItemMapper.insert(routePointItem);
// iRoutePointItemDao.save(routePointItem);
}
}
}else{
}else {
if (!collect.contains(pItemVo.getPointItemId())) {
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
iPointInputItemDao.save(pointInputItem);
pointInputItemMapper.insert(pointInputItem);
// iPointInputItemDao.save(pointInputItem);
}
}
return CommonResponseUtil.success();
}
return CommonResponseUtil.success(pointClassify);
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
......@@ -299,20 +325,6 @@ public class PointController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡查对象", notes = "新增巡查对象")
@GetMapping(value = "/xcdxIsExits", produces = "application/json;charset=UTF-8")
public CommonResponse xcdxIsExits(Long pointId,String equipMentId){
List<PointClassify> pointClassifies = iPointClassifyDao.queryByPointIdAndEquipmentId(pointId,equipMentId);
if (pointClassifies.size() > 0){
return CommonResponseUtil.success(false);
}
return CommonResponseUtil.success(true);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡查对象", notes = "新增巡查对象")
@PostMapping(value = "/addPointXcdxList", produces = "application/json;charset=UTF-8")
public CommonResponse addPointXcdxList(@ApiParam(value = "新增巡查对象", required = true) @RequestBody List<PointInputItemNewVo> pointClassifys){
......
......@@ -9,12 +9,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -203,7 +198,10 @@ public class SafetyPreCtrlController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "巡检执行情况查询", notes = "巡检执行情况查询")
@RequestMapping(value = "/checkExecute/listNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public HashMap<String, Object> findChkExListNew(@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
public HashMap<String, Object> findChkExListNew(@RequestParam(value = "pageSize") int pageSize, @RequestParam(value = "pageNumber") int pageNumber ) {
CommonPageable commonPageable = new CommonPageable();
commonPageable.setPageNumber(pageNumber-1);
commonPageable.setPageSize(pageSize);
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode();
HashMap<String, Object> checkChkExListBo= iPlanTaskService.getChkExListNew(loginOrgCode,commonPageable);
......@@ -221,7 +219,10 @@ public class SafetyPreCtrlController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风险点查询", notes = "风险点查询")
@RequestMapping(value = "/point/listNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public HashMap<String, Object> findPointListNew(@ApiParam(value = "分页参数", required = false) CommonPageable commonPageable) {
public HashMap<String, Object> findPointListNew( @RequestParam(value = "pageSize") int pageSize,@RequestParam(value = "pageNumber") int pageNumber ) {
CommonPageable commonPageable = new CommonPageable();
commonPageable.setPageNumber(pageNumber-1);
commonPageable.setPageSize(pageSize);
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode();
HashMap<String, Object> checkChkExListBo= pointService.getCheckPtListNew(loginOrgCode,commonPageable);
......
......@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Mapper;
......@@ -15,7 +16,8 @@ import com.yeejoin.amos.patrol.dao.entity.InputItem;
import org.springframework.stereotype.Repository;
@Repository
public interface InputItemMapper extends BaseMapper {
@Mapper
public interface InputItemMapper extends BaseMapper<InputItem> {
/**
* 新接口
......@@ -62,4 +64,9 @@ public interface InputItemMapper extends BaseMapper {
public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("classifyId") String classifyId );
public PointInputItemVo getInputItemByEquipmentName(@Param("equipmentName") String equipmentName );
void delPointInputItemById(@Param("ids") List<Long> ids);
void delRoutePointItemByItemId(@Param("ids") List<Long> ids);
}
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PointInputItemMapper extends BaseMapper<PointInputItem> {
}
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
public interface RoutePointItemMapper extends BaseMapper{
@Mapper
public interface RoutePointItemMapper extends BaseMapper<RoutePointItem> {
public void updateRoutePointItem( RoutePointItem pointItem);
......
......@@ -440,10 +440,12 @@ public class CheckServiceImpl implements ICheckService {
}
}
// 巡检站端与中心级数据同步
Check finalCheck1 = check;
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
// 事物提交后业务逻辑
patrolDataSyncService.checkDataSync(finalCheck1);
Map<String, Object> map = new HashMap<>();
map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList()));
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
......@@ -700,7 +702,6 @@ public class CheckServiceImpl implements ICheckService {
map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList()));
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
patrolDataSyncService.checkInputDataSync(checkInputList);
}
});
return checkDto;
......
......@@ -1425,7 +1425,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
colModel.add(temph4);
colModel.add(temph5);
HashMap<String, Object> dataGridMock = new HashMap<>();
dataGridMock.put("current",result.getNumber());
dataGridMock.put("current",result.getNumber()+1);
dataGridMock.put("total",result.getTotalElements());
dataGridMock.put("pagination",true);
dataGridMock.put("totalPage",result.getTotalPages());
......
......@@ -134,7 +134,7 @@ public class PointServiceImpl implements IPointService {
@Override
public void addPointClassifyByPointId(PointClassify pointClassify) {
iPointClassifyDao.save(pointClassify);
iPointClassifyDao.saveAndFlush(pointClassify);
}
......@@ -1463,7 +1463,7 @@ public class PointServiceImpl implements IPointService {
colModel.add(temph8);
HashMap<String, Object> dataGridMock = new HashMap<>();
dataGridMock.put("current",result.getNumber());
dataGridMock.put("current",result.getNumber()+1);
dataGridMock.put("total",result.getTotalElements());
dataGridMock.put("pagination",true);
dataGridMock.put("totalPage",result.getTotalPages());
......
......@@ -106,7 +106,7 @@
and FIND_IN_SET(#{dangerId}, t.dangerIds)
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
and d.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
</trim>
</select>
......@@ -242,7 +242,26 @@
) as is_ok,
a.score,
d.`name` AS `route_name`,
a.check_mode,
(
CASE
WHEN a.check_mode = 'QR'
THEN '二维码巡检'
WHEN a.check_mode = 'MOBILE'
THEN '移动点巡检'
WHEN a.check_mode = 'NFC'
THEN 'NFC巡检'
WHEN a.check_mode = 'WEB'
THEN '录入检查点巡检'
WHEN a.check_mode = 'WEB_OUT'
THEN '外来检查'
ELSE
'系统自检'
END
) as check_mode,
e.`name` AS `plan_name`,
a.plan_task_id,
a.plan_id,
......@@ -290,7 +309,7 @@
and FIND_IN_SET(#{dangerId}, t.dangerIds)
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
and d.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
</trim>
order by ${orderBy}
......
......@@ -446,4 +446,19 @@
<select id="getAllCategoryName" resultType="java.util.Map">
select code, `name` from wl_equipment_category
</select>
<delete id="delPointInputItemById">
DELETE FROM p_point_inputitem WHERE id IN
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<delete id="delRoutePointItemByItemId">
DELETE FROM p_route_point_item WHERE point_input_item_id IN
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -262,10 +262,9 @@
pt.user_dept userDept
FROM
p_plan_task pt
LEFT JOIN p_plan_task_detail b
ON pt.id = b.task_no
INNER JOIN p_plan p ON pt.plan_id = p.id
where b.task_no is not null
) a
<include refid="plan-task-app-where"/>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
......@@ -486,6 +485,8 @@
(select p_point.`name` from p_point where p_point.id= temp2.pointId) pointName,
(select p_plan.`name` from p_plan where p_plan.id= temp2.planId) planName,
(select p_route.`name` from p_route where p_route.id= temp2.routeId) routeName,
(select p_route.`biz_org_code` from p_route where p_route.id= temp2.routeId) orgCode,
temp2.*
FROM
p_point_inputitem ppi
......@@ -514,7 +515,7 @@
ptd.route_id routeId,
ptd.plan_id planId,
ptd.user_id AS userId,
ptd.org_code AS orgCode,
ptd.end_time AS endTime,
pptd.id as planTaskDetailId,
(select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId
......
......@@ -8,6 +8,9 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.health.redis.enabled=false
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
......@@ -16,14 +19,10 @@ emqx.client-user-name=admin
emqx.client-password=public
emqx.max-inflight=1000
spring.redis.database=1
spring.redis.host=172.16.11.201
spring.redis.port=6379
spring.redis.password=1234560
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
kafka.topics=null.topic
kafka.init.topics=akka.iot.created,akka.patrol.created,akka.sign.created,akka.bussSign.created,akka.user.created
kafka.init.topics=
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
emq.topic=emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created
\ No newline at end of file
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
emq.topic=emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment