Merge branch 'develop_3' into 'develop_master'
Develop 3 See merge request LiuChao/foton-slrs-system-rest!375
This commit is contained in:
@@ -111,7 +111,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
|
|
||||||
// //测试接口使用
|
// //测试接口使用
|
||||||
// addInterceptor.excludePathPatterns("/api/**");
|
addInterceptor.excludePathPatterns("/api/**");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
|||||||
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
|
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
|
||||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||||
|
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||||
import com.adc.da.util.UUIDUtils;
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -175,7 +176,8 @@ public class ScheduledJob {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarUpdLogService sarUpdLogEOService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -299,6 +301,7 @@ public class ScheduledJob {
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// sarUpdLogEOService.createUpdateLog(sarStandardsInfoEO.getStandType() + "_STAND", sarStandardsInfoEO.getId(), oldMap, newMap, content);
|
||||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
System.out.println("代替标准状态更新:id为"+key+"文本状态更新失败");
|
System.out.println("代替标准状态更新:id为"+key+"文本状态更新失败");
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.adc.da.scheduled.controller;
|
|||||||
import com.adc.da.scheduled.ScheduledJob;
|
import com.adc.da.scheduled.ScheduledJob;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -16,8 +17,15 @@ public class Controller {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ScheduledJob scheduledJob;
|
ScheduledJob scheduledJob;
|
||||||
|
|
||||||
@PostMapping
|
@PutMapping("/warning")
|
||||||
public void run(){
|
public void warning(){
|
||||||
scheduledJob.warningSchedulingTasks();
|
scheduledJob.warningSchedulingTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("textStatus")
|
||||||
|
public void textStatus(){
|
||||||
|
scheduledJob.TextStatusSchedulingTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+71
@@ -0,0 +1,71 @@
|
|||||||
|
package com.adc.da.slrs.customWorkGroup.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.http.ResponseMessage;
|
||||||
|
import com.adc.da.http.Result;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroupQueryPage;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.service.IWorkGroupService;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import org.apache.ibatis.annotations.Delete;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroup;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import com.adc.da.base.web.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhaokaiyao
|
||||||
|
* @since 2022-01-18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api(description = "|WorkGroup|")
|
||||||
|
@RequestMapping("/${restPath}/workGroup/work-group")
|
||||||
|
public class WorkGroupController extends BaseController<WorkGroup> {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
IWorkGroupService iWorkGroupService;
|
||||||
|
|
||||||
|
@ApiModelProperty("新增工作组")
|
||||||
|
@PostMapping
|
||||||
|
public ResponseMessage addWorkGroup(WorkGroup workGroup) {
|
||||||
|
boolean add = iWorkGroupService.add(workGroup);
|
||||||
|
|
||||||
|
return Result.success(add);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("删除工作组")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseMessage deleteWorkGroup(String id){
|
||||||
|
boolean delete = iWorkGroupService.delete(id);
|
||||||
|
|
||||||
|
return Result.success(delete);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty("根据组长民或者组名查询工作组")
|
||||||
|
@GetMapping
|
||||||
|
public ResponseMessage<IPage<WorkGroup>> getWorkGroupLists(WorkGroupQueryPage queryPage){
|
||||||
|
IPage<WorkGroup> workGroup = iWorkGroupService.getWorkGroup(queryPage);
|
||||||
|
|
||||||
|
return Result.success(workGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("修改工作组")
|
||||||
|
@PutMapping
|
||||||
|
public ResponseMessage updateWorkGroup(WorkGroup workGroup){
|
||||||
|
boolean update = iWorkGroupService.update(workGroup);
|
||||||
|
|
||||||
|
return Result.success(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.adc.da.slrs.customWorkGroup.dao;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroup;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroupQueryPage;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhaokaiyao
|
||||||
|
* @since 2022-01-18
|
||||||
|
*/
|
||||||
|
public interface WorkGroupDao extends BaseMapper<WorkGroup> {
|
||||||
|
|
||||||
|
|
||||||
|
public IPage<WorkGroup> getWorkGroup( @Param("page")IPage<WorkGroup> page,
|
||||||
|
@Param(Constants.WRAPPER) Wrapper<WorkGroupQueryPage> queryWrapper,
|
||||||
|
@Param("queryCondition")WorkGroupQueryPage queryCondition);
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getUserName(String userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.adc.da.slrs.customWorkGroup.entity;
|
||||||
|
|
||||||
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhaokaiyao
|
||||||
|
* @since 2022-01-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="WorkGroup对象", description="")
|
||||||
|
public class WorkGroup extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
private String workGroup;
|
||||||
|
|
||||||
|
private String workLeader;
|
||||||
|
|
||||||
|
private String workLeaderId;
|
||||||
|
|
||||||
|
private String workPeople;
|
||||||
|
|
||||||
|
private String workPeopleId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.adc.da.slrs.customWorkGroup.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 22501
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WorkGroupQueryPage {
|
||||||
|
|
||||||
|
private Integer page;
|
||||||
|
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
private String leaderName;
|
||||||
|
|
||||||
|
private String workGroupName;
|
||||||
|
|
||||||
|
|
||||||
|
public int getPage() {
|
||||||
|
return Optional.ofNullable(this.page)
|
||||||
|
.orElse(1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPageSize() {
|
||||||
|
return Optional.ofNullable(this.pageSize)
|
||||||
|
.orElse(20);
|
||||||
|
}
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
package com.adc.da.slrs.customWorkGroup.service;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroup;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroupQueryPage;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhaokaiyao
|
||||||
|
* @since 2022-01-18
|
||||||
|
*/
|
||||||
|
public interface IWorkGroupService extends IService<WorkGroup> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param workGroup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean add(WorkGroup workGroup);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param workGroupId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean delete(String workGroupId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param queryPage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public IPage<WorkGroup> getWorkGroup(WorkGroupQueryPage queryPage);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @param workGroup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean update(WorkGroup workGroup);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
package com.adc.da.slrs.customWorkGroup.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroup;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.dao.WorkGroupDao;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.entity.WorkGroupQueryPage;
|
||||||
|
import com.adc.da.slrs.customWorkGroup.service.IWorkGroupService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhaokaiyao
|
||||||
|
* @since 2022-01-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class WorkGroupServiceImpl extends ServiceImpl<WorkGroupDao, WorkGroup> implements IWorkGroupService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
WorkGroupDao workGroupDao;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean add(WorkGroup workGroup) {
|
||||||
|
return this.save(workGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delete(String workGroupId) {
|
||||||
|
return this.removeById(workGroupId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<WorkGroup> getWorkGroup(WorkGroupQueryPage queryPage) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<WorkGroupQueryPage> wrapper = new QueryWrapper<>();
|
||||||
|
if (queryPage.getWorkGroupName()!=null && !"".equals(queryPage.getWorkGroupName())){
|
||||||
|
wrapper.eq("work_group_name",queryPage.getWorkGroupName());
|
||||||
|
}
|
||||||
|
//可以通过组长名称模糊查询
|
||||||
|
IPage<WorkGroup> workGroupList = workGroupDao.getWorkGroup(new Page<>(queryPage.getPage(), queryPage.getPageSize()), wrapper,queryPage);
|
||||||
|
//需要把组长的id和组员的id转换为其名称
|
||||||
|
for (WorkGroup record : workGroupList.getRecords()) {
|
||||||
|
|
||||||
|
record.setWorkLeader( String.join(",",workGroupDao.getUserName(record.getWorkLeaderId())) );
|
||||||
|
record.setWorkPeople( String.join(",",workGroupDao.getUserName(record.getWorkPeopleId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
return workGroupList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean update(WorkGroup workGroup) {
|
||||||
|
return this.updateById(workGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?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.adc.da.slrs.customWorkGroup.dao.WorkGroupDao">
|
||||||
|
|
||||||
|
<select id="getWorkGroup" resultType="com.adc.da.slrs.customWorkGroup.entity.WorkGroup">
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
work_group_name AS workGroup,
|
||||||
|
work_leader_id AS workLeaderId,
|
||||||
|
work_people_id AS workPeopleId
|
||||||
|
FROM
|
||||||
|
work_group
|
||||||
|
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<if test="queryCondition.leaderName != null and queryCondition.leaderName != ''">
|
||||||
|
work_leader_id REGEXP (
|
||||||
|
SELECT
|
||||||
|
GROUP_CONCAT(USID SEPARATOR '|')
|
||||||
|
FROM
|
||||||
|
ts_user
|
||||||
|
WHERE
|
||||||
|
UNAME LIKE CONCAT('%', #{queryCondition.leaderName}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="ew != null">
|
||||||
|
<if test="ew.nonEmptyOfWhere">
|
||||||
|
AND
|
||||||
|
</if>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getUserName" resultType="java.lang.String">
|
||||||
|
SELECT UNAME from ts_user WHERE FIND_IN_SET(USID,#{userId})
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user