diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java index 67f674e..d648672 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java @@ -33,7 +33,7 @@ public interface EntDeviceMapper extends BaseMapper { * @param deviceId 设备id * @return EntDevice * */ - EntDevice entEquipmentStatistic(String enterpriseId, String deviceId); + EntDevice entEquipmentStatistic(@Param("enterpriseId") String enterpriseId, @Param("deviceId")String deviceId); diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java index 8bc209d..4b62cc3 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java @@ -2,6 +2,7 @@ package com.rzyc.mapper; import com.rzyc.model.EntPostList; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.rzyc.model.EntPostTask; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -20,13 +21,30 @@ public interface EntPostListMapper extends BaseMapper { /** * 查询企业用户工作要务 + * * @param enterpriseId 企业id - * @param entUserId 企业用户id - * @param postId 岗位id - * @param page 页码 - * @param pageSize 条数 + * @param entUserId 企业用户id + * @param postId 岗位id + * @param page 页码 + * @param pageSize 条数 * @return EntPostList 企业用户工作要务 - * */ - ListselectEntPostList(@Param("enterpriseId") String enterpriseId,@Param("entUserId") String entUserId,@Param("postId")String postId,Integer page,Integer pageSize); + */ + List selectEntPostList(@Param("enterpriseId") String enterpriseId, @Param("entUserId") String entUserId, @Param("postId") String postId, Integer page, Integer pageSize); + /** + * 企业清单条数 + * @param enterpriseId 企业id + * @param listId 企业用户id + * @return int 企业岗位条数 + */ + Integer selectEntPostListCount(@Param("enterpriseId") String enterpriseId,@Param("listId")String listId); + + /** + * 企业清单完成条数 + * @param enterpriseId 企业id + * @param listId 企业用户id + * @param state 状态 + * @return int 企业清单完成条数 + */ + Integer selectEntPostListFinishedCount(@Param("enterpriseId") String enterpriseId,@Param("listId")String listId,@Param("state")Integer state); } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java index 0235d84..4959f71 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java @@ -36,4 +36,21 @@ public interface EntPostTaskMapper extends BaseMapper { @Param("content")String content,@Param("taskState") Integer taskState, @Param("page") Integer page,@Param("pageSize") Integer pageSize); + + /** + * 查询企业用户清单任务,主要筛选项listId + * @param enterpriseId 企业id + * @param listId 清单id + * @param content 内容模糊搜索 + * @param page 页码 + * @param pageSize 条数 + * @return EntPostTask 企业用户清单任务 + * */ + ListselectEntUserPostTaskByListId(@Param("enterpriseId") String enterpriseId, @Param("listId")String listId, @Param("content")String content, + @Param("page") Integer page,@Param("pageSize") Integer pageSize); + + + + + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/ent/InEntListMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/ent/InEntListMapper.java index c621f77..4b62c9d 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/ent/InEntListMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/ent/InEntListMapper.java @@ -2,6 +2,9 @@ package com.rzyc.mapper.ent; import com.rzyc.model.ent.InEntList; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; /** *

@@ -11,6 +14,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author * @since 2022-09-20 */ +@Repository public interface InEntListMapper extends BaseMapper { + } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java b/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java index 39f55ba..eb9fc42 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java @@ -28,7 +28,7 @@ public class EntInspectionRecord implements Serializable { @ApiModelProperty(value = "送检设备id") @TableField("inspection_device_id") - private Integer inspectionDeviceId; + private String inspectionDeviceId; @ApiModelProperty(value = "送检组织") @TableField("inspection_organization") @@ -69,13 +69,15 @@ public class EntInspectionRecord implements Serializable { public void setInspectionId(Integer inspectionId) { this.inspectionId = inspectionId; } - public Integer getInspectionDeviceId() { + + public String getInspectionDeviceId() { return inspectionDeviceId; } - public void setInspectionDeviceId(Integer inspectionDeviceId) { + public void setInspectionDeviceId(String inspectionDeviceId) { this.inspectionDeviceId = inspectionDeviceId; } + public String getInspectionOrganization() { return inspectionOrganization; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserPostListDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserPostListDto.java new file mode 100644 index 0000000..a60f842 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserPostListDto.java @@ -0,0 +1,181 @@ +package com.rzyc.model.dto; + + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * 企业用户任务清单新增参数模型 + * @author Xuwanxin + * @date 2022/10/31 + * */ +public class AddOrUpdateEntUserPostListDto { + + @ApiModelProperty(value = "岗位清单id") + private String postListId; + + @ApiModelProperty(value = "岗位id") + private String postId; + + @ApiModelProperty(value = "企业用户id") + private String entUserId; + + @ApiModelProperty(value = "企业id") + private String enterpriseId; + + @ApiModelProperty(value = "企业清单项id") + private String entListId; + + @ApiModelProperty(value = "清单id") + private String listId; + + @ApiModelProperty(value = "清单标题") + private String itemTitle; + + @ApiModelProperty(value = "清单内容") + private String itemContent; + + @ApiModelProperty(value = "排序") + private Integer sortId; + + @ApiModelProperty(value = "年份") + private Integer yearNum; + + @ApiModelProperty(value = "考核指标 1:每年 2:每半年 4:每季度 12:每月") + private Integer standard; + + @ApiModelProperty(value = "频率") + private Integer frequency; + + @ApiModelProperty(value = "完成状态 1:未完成 2:已完成") + private Integer finishState; + + @ApiModelProperty(value = "红色提醒天数") + private Integer redAlert; + + @ApiModelProperty(value = "黄色提醒天数") + private Integer yellowAlert; + + public String getPostListId() { + return postListId; + } + + public void setPostListId(String postListId) { + this.postListId = postListId; + } + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public String getEntUserId() { + return entUserId; + } + + public void setEntUserId(String entUserId) { + this.entUserId = entUserId; + } + + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEntListId() { + return entListId; + } + + public void setEntListId(String entListId) { + this.entListId = entListId; + } + + public String getListId() { + return listId; + } + + public void setListId(String listId) { + this.listId = listId; + } + + public String getItemTitle() { + return itemTitle; + } + + public void setItemTitle(String itemTitle) { + this.itemTitle = itemTitle; + } + + public String getItemContent() { + return itemContent; + } + + public void setItemContent(String itemContent) { + this.itemContent = itemContent; + } + + public Integer getSortId() { + return sortId; + } + + public void setSortId(Integer sortId) { + this.sortId = sortId; + } + + public Integer getYearNum() { + return yearNum; + } + + public void setYearNum(Integer yearNum) { + this.yearNum = yearNum; + } + + public Integer getStandard() { + return standard; + } + + public void setStandard(Integer standard) { + this.standard = standard; + } + + public Integer getFrequency() { + return frequency; + } + + public void setFrequency(Integer frequency) { + this.frequency = frequency; + } + + public Integer getFinishState() { + return finishState; + } + + public void setFinishState(Integer finishState) { + this.finishState = finishState; + } + + public Integer getRedAlert() { + return redAlert; + } + + public void setRedAlert(Integer redAlert) { + this.redAlert = redAlert; + } + + public Integer getYellowAlert() { + return yellowAlert; + } + + public void setYellowAlert(Integer yellowAlert) { + this.yellowAlert = yellowAlert; + } +} diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml index 82a60ba..811680b 100644 --- a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml @@ -36,7 +36,17 @@ diff --git a/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml index 5ee657d..4cc5469 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml @@ -41,4 +41,13 @@ group by epl.post_list_id + + + + + diff --git a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml index bff8313..c567a77 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml @@ -42,4 +42,17 @@ + + + + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java index 7c93cdd..7dd2430 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java @@ -523,7 +523,9 @@ public class BaseController { @Autowired protected EntOperatingInstructionMapper entOperatingInstructionMapper; - + //企业行业清单 + @Autowired + protected InEntListMapper inEntListMapper; /** * 新都文件地址处理 diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java index 9aca86c..01f9f29 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java @@ -280,7 +280,7 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')") @MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录") @ResponseBody - public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{ + public Object entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{ return pcBusinessService.entDeviceMaintenanceRecord(page,pageSize); } diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java index bd7834b..cf5b978 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java @@ -1,6 +1,5 @@ package com.rzyc.controller; -import com.alibaba.fastjson.JSONObject; import com.common.utils.model.Code; import com.common.utils.model.Message; import com.alibaba.fastjson.JSONArray; @@ -322,6 +321,25 @@ public class PersonalController extends BaseController{ } + + /** + * 手动企业分配任务 + * @param listDto + * @return list + * @throws Exception + */ + @ApiOperation(value = "手动企业分配任务", notes = "手动企业分配任务") + @PostMapping(value = "/manualAssignmentTask") + @PreAuthorize("hasAnyAuthority('entUserPostTask:update')") + @MethodAnnotation(authorizations = {"entUserPostTask:update"},name = "手动企业分配任务") + @ResponseBody + public SingleResult manualAssignmentTask(AddOrUpdateEntUserPostListDto listDto)throws Exception{ + return pcBusinessService.manualAssignmentTask(listDto); + } + + + + /** * 新增和修改公司岗位 * @param addOrUpdateEntPostDto @@ -333,12 +351,39 @@ public class PersonalController extends BaseController{ @PreAuthorize("hasAnyAuthority('addOrUpdateEntPost:update')") @MethodAnnotation(authorizations = {"addOrUpdateEntPost:update"},name = "新增和修改公司岗位") @ResponseBody - @Transactional(rollbackFor = Exception.class) public SingleResult addOrUpdateEntPost(@RequestBody AddOrUpdateEntPostDto addOrUpdateEntPostDto)throws Exception{ return pcBusinessService.addOrUpdateEntPost(addOrUpdateEntPostDto); } + /** + * 企业清单统计 + * @param listId + * @return list + * @throws Exception + */ + @ApiOperation(value = "企业清单统计", notes = "企业清单统计") + @ApiImplicitParams({ + @ApiImplicitParam(name = "listId", value = "清单Id",required = true, dataType = "string"), + @ApiImplicitParam(name = "keyWord", value = "关键字",required = true, dataType = "string"), + @ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"), + @ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"), + }) + @GetMapping(value = "/inListStatistic") + @PreAuthorize("hasAnyAuthority('inListStatistic')") + @MethodAnnotation(authorizations = {"inListStatistic"},name = "企业清单统计") + @ResponseBody + public SingleResult entUserList(String listId, + @NotNull(message = "企业Id") String enterpriseId, + String keyWord, + @NotNull(message = "页码不能为null") Integer page, + @NotNull(message = "条数不能为null") Integer pageSize)throws Exception{ + return pcBusinessService.inListStatistic(enterpriseId,listId,keyWord,page,pageSize); + } + + + + diff --git a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java index 584abd6..6c00c96 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -6,7 +6,6 @@ import com.common.utils.*; import com.common.utils.encryption.MD5; import com.common.utils.model.Code; import com.common.utils.model.Message; -import com.common.utils.model.Pager; import com.common.utils.model.SingleResult; import com.common.utils.pager.PageOperation; import com.github.pagehelper.Page; @@ -311,7 +310,8 @@ public class PcBusinessService extends BaseController { public SingleResult entEquipmentStatistic(String enterpriseId, String deviceId){ SingleResult singleResult = new SingleResult(); - entDeviceMapper.entEquipmentStatistic(enterpriseId,deviceId); + EntDevice data = entDeviceMapper.entEquipmentStatistic(enterpriseId,deviceId); + singleResult.setData(data); return singleResult; } @@ -498,11 +498,10 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize){ - SingleResult singleResult = new SingleResult(); - Listlist = entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord(); - singleResult.setData(list); - return singleResult; + @PageOperation + public Object entDeviceMaintenanceRecord(Integer page,Integer pageSize){ + Page list = (Page) entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord(); + return list; } public Object inspectionRecord(String startTime,String endTime,Integer page,Integer pageSize){ @@ -602,6 +601,35 @@ public class PcBusinessService extends BaseController { } + public SingleResult manualAssignmentTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto) throws Exception { + SingleResult singleResult = new SingleResult(); + EntPostList entPostList = new EntPostList(); + BeanUtils.copyProperties(addOrUpdateEntUserPostTaskDto,entPostList); + entPostList.setPostListId(RandomNumber.getUUid()); + entPostList.setCreateBy(getUserId()); + entPostList.setCreateTime(new Date()); + int result = entPostListMapper.insert(entPostList); + if (result != 1 ){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + + public SingleResult inListStatistic(String enterpriseId,String listId,String keyWord,Integer page,Integer pageSize){ + SingleResult singleResult = new SingleResult(); + HashMap map = new HashMap(); + Integer total = entPostListMapper.selectEntPostListCount(enterpriseId,listId); + //2代表已完成状态 + Integer finishCount = entPostListMapper.selectEntPostListFinishedCount(enterpriseId,listId,2); + double finishPercent = Arith.div(total,finishCount) * 100; + map.put("finishPercent",finishPercent); + Listtasks = entPostTaskMapper.selectEntUserPostTaskByListId(enterpriseId,listId,keyWord,page,pageSize); + map.put("list",tasks); + singleResult.setData(map); + return singleResult; + }