Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhengqiaowen 2022-11-01 10:48:37 +08:00
commit 6e623b4f5d
13 changed files with 352 additions and 22 deletions

View File

@ -33,7 +33,7 @@ public interface EntDeviceMapper extends BaseMapper<EntDevice> {
* @param deviceId 设备id * @param deviceId 设备id
* @return EntDevice * @return EntDevice
* */ * */
EntDevice entEquipmentStatistic(String enterpriseId, String deviceId); EntDevice entEquipmentStatistic(@Param("enterpriseId") String enterpriseId, @Param("deviceId")String deviceId);

View File

@ -2,6 +2,7 @@ package com.rzyc.mapper;
import com.rzyc.model.EntPostList; import com.rzyc.model.EntPostList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rzyc.model.EntPostTask;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -20,13 +21,30 @@ public interface EntPostListMapper extends BaseMapper<EntPostList> {
/** /**
* 查询企业用户工作要务 * 查询企业用户工作要务
*
* @param enterpriseId 企业id * @param enterpriseId 企业id
* @param entUserId 企业用户id * @param entUserId 企业用户id
* @param postId 岗位id * @param postId 岗位id
* @param page 页码 * @param page 页码
* @param pageSize 条数 * @param pageSize 条数
* @return EntPostList 企业用户工作要务 * @return EntPostList 企业用户工作要务
* */ */
List<EntPostList>selectEntPostList(@Param("enterpriseId") String enterpriseId,@Param("entUserId") String entUserId,@Param("postId")String postId,Integer page,Integer pageSize); List<EntPostList> 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);
} }

View File

@ -36,4 +36,21 @@ public interface EntPostTaskMapper extends BaseMapper<EntPostTask> {
@Param("content")String content,@Param("taskState") Integer taskState, @Param("content")String content,@Param("taskState") Integer taskState,
@Param("page") Integer page,@Param("pageSize") Integer pageSize); @Param("page") Integer page,@Param("pageSize") Integer pageSize);
/**
* 查询企业用户清单任务主要筛选项listId
* @param enterpriseId 企业id
* @param listId 清单id
* @param content 内容模糊搜索
* @param page 页码
* @param pageSize 条数
* @return EntPostTask 企业用户清单任务
* */
List<EntPostTask>selectEntUserPostTaskByListId(@Param("enterpriseId") String enterpriseId, @Param("listId")String listId, @Param("content")String content,
@Param("page") Integer page,@Param("pageSize") Integer pageSize);
} }

View File

@ -2,6 +2,9 @@ package com.rzyc.mapper.ent;
import com.rzyc.model.ent.InEntList; import com.rzyc.model.ent.InEntList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* <p> * <p>
@ -11,6 +14,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author * @author
* @since 2022-09-20 * @since 2022-09-20
*/ */
@Repository
public interface InEntListMapper extends BaseMapper<InEntList> { public interface InEntListMapper extends BaseMapper<InEntList> {
} }

View File

@ -28,7 +28,7 @@ public class EntInspectionRecord implements Serializable {
@ApiModelProperty(value = "送检设备id") @ApiModelProperty(value = "送检设备id")
@TableField("inspection_device_id") @TableField("inspection_device_id")
private Integer inspectionDeviceId; private String inspectionDeviceId;
@ApiModelProperty(value = "送检组织") @ApiModelProperty(value = "送检组织")
@TableField("inspection_organization") @TableField("inspection_organization")
@ -69,13 +69,15 @@ public class EntInspectionRecord implements Serializable {
public void setInspectionId(Integer inspectionId) { public void setInspectionId(Integer inspectionId) {
this.inspectionId = inspectionId; this.inspectionId = inspectionId;
} }
public Integer getInspectionDeviceId() {
public String getInspectionDeviceId() {
return inspectionDeviceId; return inspectionDeviceId;
} }
public void setInspectionDeviceId(Integer inspectionDeviceId) { public void setInspectionDeviceId(String inspectionDeviceId) {
this.inspectionDeviceId = inspectionDeviceId; this.inspectionDeviceId = inspectionDeviceId;
} }
public String getInspectionOrganization() { public String getInspectionOrganization() {
return inspectionOrganization; return inspectionOrganization;
} }

View File

@ -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;
}
}

View File

@ -36,7 +36,17 @@
<select id="entEquipmentStatistic" resultMap="BaseResultMap"> <select id="entEquipmentStatistic" resultMap="BaseResultMap">
生命周期中的统计 select count(edmr.record_id) as entDeviceMaintenanceRecord ,count(eir.ins_record_id) as entInsRecord,
count(err.repair_record_id)as entRepairRecord,count(eisr.inspection_id) as entInspectionRecord
from ent_device ed
left join ent_device_maintenance_record edmr on ed.device_id = edmr.device_id
left join ent_ins_record eir on ed.device_id = eir.device_id
left join ent_repair_record err on ed.device_id = err.device_id
left join ent_inspection_record eisr on ed.device_id = eisr.inspection_device_id
where ed.device_id = #{deviceId}
<if test="null != enterpriseId and '' != enterpriseId ">
and ed.enterprise_id = #{enterpriseId}
</if>
</select> </select>
<update id="updateEntDevice" parameterType="com.rzyc.model.EntDevice"> <update id="updateEntDevice" parameterType="com.rzyc.model.EntDevice">

View File

@ -41,4 +41,13 @@
group by epl.post_list_id group by epl.post_list_id
</select> </select>
<select id="selectEntPostListCount" resultType="java.lang.Integer">
select * from ent_post_list where enterprise_id = #{enterpriseId} and list_id = #{listId}
</select>
<select id="selectEntPostListFinishedCount" resultType="java.lang.Integer">
select * from ent_post_list where enterprise_id = #{enterpriseId} and list_id = #{listId} and finish_satte = #{state}
</select>
</mapper> </mapper>

View File

@ -42,4 +42,17 @@
</if> </if>
</select> </select>
<select id="selectEntUserPostTaskByListId" resultMap="BaseResultMap">
select * from ent_post_task where enterprise_id = #{enterpriseId}
<if test="null != listId and '' != listId">
and list_id = #{listId}
</if>
<if test="null != content and '' != content">
and item_content like concat('%',#{content},'%')
</if>
limit #{page},#{pageSize}
</select>
</mapper> </mapper>

View File

@ -523,7 +523,9 @@ public class BaseController {
@Autowired @Autowired
protected EntOperatingInstructionMapper entOperatingInstructionMapper; protected EntOperatingInstructionMapper entOperatingInstructionMapper;
//企业行业清单
@Autowired
protected InEntListMapper inEntListMapper;
/** /**
* 新都文件地址处理 * 新都文件地址处理

View File

@ -280,7 +280,7 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')") @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录") @MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录")
@ResponseBody @ResponseBody
public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{ public Object entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{
return pcBusinessService.entDeviceMaintenanceRecord(page,pageSize); return pcBusinessService.entDeviceMaintenanceRecord(page,pageSize);
} }

View File

@ -1,6 +1,5 @@
package com.rzyc.controller; package com.rzyc.controller;
import com.alibaba.fastjson.JSONObject;
import com.common.utils.model.Code; import com.common.utils.model.Code;
import com.common.utils.model.Message; import com.common.utils.model.Message;
import com.alibaba.fastjson.JSONArray; 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 * @param addOrUpdateEntPostDto
@ -333,12 +351,39 @@ public class PersonalController extends BaseController{
@PreAuthorize("hasAnyAuthority('addOrUpdateEntPost:update')") @PreAuthorize("hasAnyAuthority('addOrUpdateEntPost:update')")
@MethodAnnotation(authorizations = {"addOrUpdateEntPost:update"},name = "新增和修改公司岗位") @MethodAnnotation(authorizations = {"addOrUpdateEntPost:update"},name = "新增和修改公司岗位")
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class)
public SingleResult addOrUpdateEntPost(@RequestBody AddOrUpdateEntPostDto addOrUpdateEntPostDto)throws Exception{ public SingleResult addOrUpdateEntPost(@RequestBody AddOrUpdateEntPostDto addOrUpdateEntPostDto)throws Exception{
return pcBusinessService.addOrUpdateEntPost(addOrUpdateEntPostDto); 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);
}

View File

@ -6,7 +6,6 @@ import com.common.utils.*;
import com.common.utils.encryption.MD5; import com.common.utils.encryption.MD5;
import com.common.utils.model.Code; import com.common.utils.model.Code;
import com.common.utils.model.Message; import com.common.utils.model.Message;
import com.common.utils.model.Pager;
import com.common.utils.model.SingleResult; import com.common.utils.model.SingleResult;
import com.common.utils.pager.PageOperation; import com.common.utils.pager.PageOperation;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
@ -311,7 +310,8 @@ public class PcBusinessService extends BaseController {
public SingleResult entEquipmentStatistic(String enterpriseId, String deviceId){ public SingleResult entEquipmentStatistic(String enterpriseId, String deviceId){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
entDeviceMapper.entEquipmentStatistic(enterpriseId,deviceId); EntDevice data = entDeviceMapper.entEquipmentStatistic(enterpriseId,deviceId);
singleResult.setData(data);
return singleResult; return singleResult;
} }
@ -498,11 +498,10 @@ public class PcBusinessService extends BaseController {
return singleResult; return singleResult;
} }
public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize){ @PageOperation
SingleResult singleResult = new SingleResult(); public Object entDeviceMaintenanceRecord(Integer page,Integer pageSize){
List<EntDeviceMaintenanceRecord>list = entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord(); Page<EntDeviceMaintenanceRecord> list = (Page<EntDeviceMaintenanceRecord>) entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord();
singleResult.setData(list); return list;
return singleResult;
} }
public Object inspectionRecord(String startTime,String endTime,Integer page,Integer pageSize){ 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);
List<EntPostTask>tasks = entPostTaskMapper.selectEntUserPostTaskByListId(enterpriseId,listId,keyWord,page,pageSize);
map.put("list",tasks);
singleResult.setData(map);
return singleResult;
}