手持接口-巡检工单

highway
wws 1 year ago
parent b865658cb2
commit fab6f3aa28

@ -0,0 +1,61 @@
package com.op.device.controller;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
import com.op.device.service.IDevicePDAService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* PDAController
*
* @author wws
* @date 2023-10-23
*/
@RestController
@RequestMapping("/devicePDA")
public class DevicePDAController {
@Autowired
private IDevicePDAService devicePDAService;
/**
* list
* @param userId
* @return
*/
@GetMapping("/getTodayTask")
public AjaxResult getTodayTask(int userId) {
return devicePDAService.getTodayTask(userId);
}
/**
*
* @param userId
* @return
*/
@GetMapping("/getTaskRecord")
public AjaxResult getTaskRecord(int userId) {
return devicePDAService.getTaskRecord(userId);
}
/**
*
* @param equOrder
* @return
*/
@PostMapping("/getInspectionOrderInfo")
public AjaxResult getInspectionOrderInfo(@RequestBody EquOrder equOrder) {
return devicePDAService.getInspectionOrderInfo(equOrder);
}
/**
*
* @param equOrder
* @return
*/
@PostMapping("/updateInspectionRecord")
public AjaxResult updateInspectionRecord(@RequestBody EquOrder equOrder) {
return devicePDAService.updateInspectionRecord(equOrder);
}
}

@ -23,7 +23,7 @@ import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
* Controller
*
* @author wws
* @date 2023-10-23

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
@ -118,14 +119,42 @@ public class EquOrder extends BaseEntity {
@Excel(name = "删除标志")
private String delFlag;
private List<EquOrderEqu> equList;
private String planName;
private String workCenterName;
private List<Date> timeArray;
private List<SysUser> personList;
private boolean overdue;
private EquOrderEqu equ;
public EquOrderEqu getEqu() {
return equ;
}
public void setEqu(EquOrderEqu equ) {
this.equ = equ;
}
public boolean isOverdue() {
return overdue;
}
public void setOverdue(boolean overdue) {
this.overdue = overdue;
}
public List<SysUser> getPersonList() {
return personList;
}
public void setPersonList(List<SysUser> personList) {
this.personList = personList;
}
public List<Date> getTimeArray() {
return timeArray;
}
@ -150,14 +179,6 @@ public class EquOrder extends BaseEntity {
this.planName = planName;
}
public List<EquOrderEqu> getEquList() {
return equList;
}
public void setEquList(List<EquOrderEqu> equList) {
this.equList = equList;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}

@ -81,6 +81,17 @@ public class EquOrderStandard extends BaseEntity {
/** 删除标识 */
private String delFlag;
// 图片路径
private String picturePath;
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
public void setId(String id) {
this.id = id;
}

@ -60,9 +60,9 @@ public interface EquOrderEquMapper {
public int deleteEquOrderEquByIds(String[] ids);
/**
* parentCodelist
* parentCode
* @param orderCode
* @return
*/
List<EquOrderEqu> selectEquOrderEquListByParentCode(String orderCode);
EquOrderEqu selectEquOrderEquListByParentCode(String orderCode);
}

@ -72,4 +72,17 @@ public interface EquOrderMapper {
* @return
*/
String selectCenterNameByCenterCode(String planWorkshop);
/**
* list
* @return
*/
List<EquOrder> selectTodayTask(int userId);
/**
*
* @param userId
* @return
*/
List<EquOrder> selectTaskRecord(int userId);
}

@ -58,4 +58,11 @@ public interface EquOrderPersonMapper {
* @return
*/
public int deleteEquOrderPersonByIds(String[] ids);
/**
* codeids
* @param orderCode
* @return
*/
List<String> selectEquOrderPersonByOrderCode(String orderCode);
}

@ -1,5 +1,6 @@
package com.op.device.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.system.api.domain.SysUser;
import java.util.List;
@ -17,6 +18,7 @@ public interface PersonMapper {
* @param userId
* @return
*/
@DS("#master")
public SysUser selectSysUserByUserId(Long userId);
/**
@ -25,6 +27,7 @@ public interface PersonMapper {
* @param sysUser
* @return
*/
@DS("#master")
public List<SysUser> selectSysUserList(SysUser sysUser);
/**
@ -33,6 +36,7 @@ public interface PersonMapper {
* @param sysUser
* @return
*/
@DS("#master")
public int insertSysUser(SysUser sysUser);
/**
@ -41,6 +45,7 @@ public interface PersonMapper {
* @param sysUser
* @return
*/
@DS("#master")
public int updateSysUser(SysUser sysUser);
/**
@ -49,6 +54,7 @@ public interface PersonMapper {
* @param userId
* @return
*/
@DS("#master")
public int deleteSysUserByUserId(Long userId);
/**
@ -57,5 +63,6 @@ public interface PersonMapper {
* @param userIds
* @return
*/
@DS("#master")
public int deleteSysUserByUserIds(Long[] userIds);
}

@ -0,0 +1,40 @@
package com.op.device.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
/**
* PDAService
*
* @author wws
* @date 2023-10-23
*/
public interface IDevicePDAService {
/**
* list
* @return
*/
AjaxResult getTodayTask(int userId);
/**
*
* @param userId
* @return
*/
AjaxResult getTaskRecord(int userId);
/**
*
* @param equOrder
* @return
*/
AjaxResult getInspectionOrderInfo(EquOrder equOrder);
/**
*
* @param equOrder
* @return
*/
AjaxResult updateInspectionRecord(EquOrder equOrder);
}

@ -0,0 +1,132 @@
package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquOrderEqu;
import com.op.device.domain.EquOrderStandard;
import com.op.device.mapper.*;
import com.op.device.service.IDevicePDAService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static com.op.common.core.web.domain.AjaxResult.error;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* PDAService
*
* @author wws
* @date 2023-10-23
*/
@Service
public class DevicePDAServiceImpl implements IDevicePDAService {
@Autowired
private EquOrderMapper equOrderMapper;
@Autowired
private EquOrderEquMapper equOrderEquMapper;
@Autowired
private EquOrderDetailMapper equOrderDetailMapper;
@Autowired
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private EquOrderPersonMapper equOrderPersonMapper;
@Autowired
private PersonMapper personMapper;
/**
* list
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getTodayTask(int userId) {
List<EquOrder> orderList = equOrderMapper.selectTodayTask(userId);
return success(orderList);
}
/**
*
*
* @param userId
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getTaskRecord(int userId) {
List<EquOrder> orderList = equOrderMapper.selectTaskRecord(userId);
return success(orderList);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getInspectionOrderInfo(EquOrder equOrder) {
List<EquOrder> orderList = equOrderMapper.selectEquOrderList(equOrder);
if (orderList.size() > 1) {
return error(500, "查询到多个任务详情!");
}
if (orderList.size() == 0) {
return error(500, "未查询到任务信息!");
}
EquOrder order = orderList.get(0);
List<Date> timeArray = new ArrayList<>();
timeArray.add(order.getOrderStart());
timeArray.add(order.getOrderEnd());
order.setTimeArray(timeArray);
order.setPlanName(equOrderMapper.selectPlanNameByPlanCode(order.getOrderCode()));
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getCode());
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode());
detail.setStandardList(standardList);
}
equ.setDetailList(detailList);
// 人员信息
List<String> users = equOrderPersonMapper.selectEquOrderPersonByOrderCode(order.getOrderCode());
List<SysUser> personList = new ArrayList<>();
for (String id : users) {
personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id)));
}
order.setPersonList(personList);
order.setEqu(equ);
return success(order);
}
/**
* TODO
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult updateInspectionRecord(EquOrder equOrder) {
return success(equOrder);
}
}

@ -12,6 +12,7 @@ import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquOrderEqu;
import com.op.device.domain.EquOrderStandard;
import com.op.device.mapper.*;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.domain.EquOrder;
@ -37,6 +38,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
private EquOrderDetailMapper equOrderDetailMapper;
@Autowired
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private PersonMapper personMapper;
/**
*
@ -59,20 +62,27 @@ public class EquOrderServiceImpl implements IEquOrderService {
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
List<EquOrderEqu> equList = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
for (EquOrderEqu equ : equList) {
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getCode());
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode());
detail.setStandardList(standardList);
}
equ.setDetailList(detailList);
// 人员信息
List<String> users = equOrderPersonMapper.selectEquOrderPersonByOrderCode(orderCode);
List<SysUser> personList = new ArrayList<>();
for (String id : users) {
personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id)));
}
// TODO 人员信息
order.setPersonList(personList);
order.setEquList(equList);
order.setEqu(equ);
return order;
}
@ -119,8 +129,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
equOrderMapper.updateEquOrder(equOrder);
// 更新标准信息
List<EquOrderEqu> equList = equOrder.getEquList();
for (EquOrderEqu equ : equList) {
EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList();
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = detail.getStandardList();
@ -130,7 +139,6 @@ public class EquOrderServiceImpl implements IEquOrderService {
equOrderStandardMapper.updateEquOrderStandard(standard);
}
}
}
return success();
}

@ -269,7 +269,6 @@ public class EquPlanServiceImpl implements IEquPlanService {
* @return
*/
@Override
@DS("#master")
public AjaxResult getPersonList() {
SysUser sysUser = new SysUser();
List<SysUser> personList = sysUserMapper.selectSysUserList(sysUser);

@ -70,6 +70,7 @@
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
and del_flag = '0'
</select>
<select id="selectEquOrderByOrderCode" parameterType="String" resultMap="EquOrderResult">
@ -85,6 +86,20 @@
select workshop_name from base_equipment where del_flag = '0' and workshop_code = #{planWorkshop}
</select>
<select id="selectTodayTask" resultType="java.lang.Integer" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where CONVERT(date,GETDATE()) > order_start and plan_type = 'inspection' and del_flag = '0' and order_status != '1' and order_code in (
select order_code from equ_order_person where del_flag = '0' and user_id = #{userId} GROUP BY order_code
)
</select>
<select id="selectTaskRecord" resultType="java.lang.Integer" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where del_flag = '0' and order_status = '1' and order_code in (
select order_code from equ_order_person where del_flag = '0' and user_id = '12' GROUP BY order_code
)
</select>
<insert id="insertEquOrder" parameterType="EquOrder">
insert into equ_order
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -42,6 +42,10 @@
where id = #{id}
</select>
<select id="selectEquOrderPersonByOrderCode" resultType="java.lang.String">
SELECT user_id FROM equ_order_person where order_code = #{orderCode}
</select>
<insert id="insertEquOrderPerson" parameterType="EquOrderPerson">
insert into equ_order_person
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -26,10 +26,11 @@
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="picturePath" column="picture_path" />
</resultMap>
<sql id="selectEquOrderStandardVo">
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_standard
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,picture_path from equ_order_standard
</sql>
<select id="selectEquOrderStandardList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
@ -50,6 +51,7 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="picturePath != null and picturePath != ''"> and picture_path = #{picturePath}</if>
</where>
</select>
@ -87,6 +89,7 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="picturePath != null">picture_path,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -110,6 +113,7 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="picturePath != null">#{picturePath},</if>
</trim>
</insert>
@ -136,6 +140,7 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="picturePath != null">picture_path = #{picturePath},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save