岗位:操作时间,机构:委员会编辑,项目合规:查询
This commit is contained in:
+77
-77
@@ -1,77 +1,77 @@
|
||||
package com.adc.da.slrs.sarPosition.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|岗位管理|")
|
||||
@RequestMapping("/api/sarPosition/position")
|
||||
public class TsPositionController extends BaseController<TsPosition> {
|
||||
@Autowired
|
||||
private ITsPositionService tsPositionService;
|
||||
|
||||
/**
|
||||
* 查询岗位(可通过name筛选)
|
||||
* @param tsPosition:筛选信息
|
||||
*/
|
||||
@ApiOperation("查询岗位")
|
||||
@GetMapping
|
||||
public ResponseMessage<IPage<TsPosition>> getPosition(TsPosition tsPosition){
|
||||
IPage<TsPosition> positions=tsPositionService.getPosition(tsPosition);
|
||||
return Result.success(positions);
|
||||
}
|
||||
|
||||
@ApiOperation("新增岗位")
|
||||
@PostMapping
|
||||
public ResponseMessage<Object> addPosition(@Validated(TsPosition.insert.class) TsPosition tsPosition){
|
||||
return tsPositionService.addPosition(tsPosition);
|
||||
}
|
||||
|
||||
@ApiOperation("配置角色")
|
||||
@PostMapping("/role")
|
||||
public ResponseMessage<List<TsRole>> setRole(@Valid @RequestBody TsPositionRoleVO tsPositionRoleVO){
|
||||
return tsPositionService.setRole(tsPositionRoleVO);
|
||||
}
|
||||
|
||||
@ApiOperation("查询角色")
|
||||
@GetMapping("/role")
|
||||
public ResponseMessage<List<TsRole>> getRole(@RequestParam String positionId){
|
||||
List<TsRole> roles=tsPositionService.getRole(positionId);
|
||||
return Result.success(roles);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑岗位")
|
||||
@PutMapping
|
||||
public ResponseMessage<Object> updatePosition(@Validated(TsPosition.update.class) TsPosition tsPosition){
|
||||
return tsPositionService.updatePosition(tsPosition);
|
||||
}
|
||||
|
||||
@ApiOperation("删除岗位")
|
||||
@DeleteMapping
|
||||
public ResponseMessage<Object> deletePosition(@RequestParam String positionId){
|
||||
return tsPositionService.deletePosition(positionId);
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.sarPosition.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|岗位管理|")
|
||||
@RequestMapping("/api/sarPosition/position")
|
||||
public class TsPositionController extends BaseController<TsPosition> {
|
||||
@Autowired
|
||||
private ITsPositionService tsPositionService;
|
||||
|
||||
/**
|
||||
* 查询岗位(可通过name筛选)
|
||||
* @param tsPosition:筛选信息
|
||||
*/
|
||||
@ApiOperation("查询岗位")
|
||||
@GetMapping
|
||||
public ResponseMessage<IPage<TsPosition>> getPosition(TsPosition tsPosition){
|
||||
IPage<TsPosition> positions=tsPositionService.getPosition(tsPosition);
|
||||
return Result.success(positions);
|
||||
}
|
||||
|
||||
@ApiOperation("新增岗位")
|
||||
@PostMapping
|
||||
public ResponseMessage<Object> addPosition(@Validated(TsPosition.insert.class) TsPosition tsPosition){
|
||||
return tsPositionService.addPosition(tsPosition);
|
||||
}
|
||||
|
||||
@ApiOperation("配置角色")
|
||||
@PostMapping("/role")
|
||||
public ResponseMessage<List<TsRole>> setRole(@Valid @RequestBody TsPositionRoleVO tsPositionRoleVO){
|
||||
return tsPositionService.setRole(tsPositionRoleVO);
|
||||
}
|
||||
|
||||
@ApiOperation("查询角色")
|
||||
@GetMapping("/role")
|
||||
public ResponseMessage<List<TsRole>> getRole(@RequestParam String positionId){
|
||||
List<TsRole> roles=tsPositionService.getRole(positionId);
|
||||
return Result.success(roles);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑岗位")
|
||||
@PutMapping
|
||||
public ResponseMessage<Object> updatePosition(@Validated(TsPosition.update.class) TsPosition tsPosition){
|
||||
return tsPositionService.updatePosition(tsPosition);
|
||||
}
|
||||
|
||||
@ApiOperation("删除岗位")
|
||||
@DeleteMapping
|
||||
public ResponseMessage<Object> deletePosition(@RequestParam String positionId){
|
||||
return tsPositionService.deletePosition(positionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,95 +1,97 @@
|
||||
package com.adc.da.slrs.sarPosition.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsPosition对象", description="")
|
||||
public class TsPosition extends BaseEntity {
|
||||
public interface insert{
|
||||
}
|
||||
public interface update{
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp operateTime;
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String operator;
|
||||
|
||||
@NotNull(message = "name不能为空",groups = {insert.class})
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "创建部门ID")
|
||||
private String createDeptId;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private String createById;
|
||||
|
||||
@ApiModelProperty(value = "类型(1为导入,2为新建)")
|
||||
private String type;
|
||||
|
||||
@NotNull(message = "id不能为空",groups = {update.class})
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id",type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "绑定角色")
|
||||
@TableField(exist = false)
|
||||
private List<TsRole> roles;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<TsUser> tsUser;
|
||||
|
||||
@ApiModelProperty(value = "操作人中文")
|
||||
@TableField(exist = false)
|
||||
private String uname;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp createTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer current;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer total;
|
||||
}
|
||||
package com.adc.da.slrs.sarPosition.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsPosition对象", description="")
|
||||
public class TsPosition extends BaseEntity {
|
||||
public interface insert{
|
||||
}
|
||||
public interface update{
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp operateTime;
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String operator;
|
||||
|
||||
@NotNull(message = "name不能为空",groups = {insert.class})
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "创建部门ID")
|
||||
private String createDeptId;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private String createById;
|
||||
|
||||
@ApiModelProperty(value = "类型(1为导入,2为新建)")
|
||||
private String type;
|
||||
|
||||
@NotNull(message = "id不能为空",groups = {update.class})
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id",type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "绑定角色")
|
||||
@TableField(exist = false)
|
||||
private List<TsRole> roles;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<TsUser> tsUser;
|
||||
|
||||
@ApiModelProperty(value = "操作人中文")
|
||||
@TableField(exist = false)
|
||||
private String uname;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp createTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer current;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer total;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+77
-77
@@ -1,77 +1,77 @@
|
||||
package com.adc.da.slrs.sarPosition.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
public interface ITsPositionService extends IService<TsPosition> {
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
* @param tsPosition:查询信息
|
||||
* @return List<TsPosition>
|
||||
*/
|
||||
IPage<TsPosition> getPosition(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 配置角色
|
||||
* @param tsPositionRoleVO :角色ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO);
|
||||
|
||||
/**
|
||||
* 查询角色
|
||||
* @param positionId :岗位ID
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
List<TsRole> getRole(String positionId);
|
||||
|
||||
/**
|
||||
* 添加岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> addPosition(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> updatePosition(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param positionId:岗位ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> deletePosition(String positionId);
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getPositionIdsByRoleId(String roleId);
|
||||
}
|
||||
package com.adc.da.slrs.sarPosition.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
public interface ITsPositionService extends IService<TsPosition> {
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
* @param tsPosition:查询信息
|
||||
* @return List<TsPosition>
|
||||
*/
|
||||
IPage<TsPosition> getPosition(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 配置角色
|
||||
* @param tsPositionRoleVO :角色ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO);
|
||||
|
||||
/**
|
||||
* 查询角色
|
||||
* @param positionId :岗位ID
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
List<TsRole> getRole(String positionId);
|
||||
|
||||
/**
|
||||
* 添加岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> addPosition(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> updatePosition(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param positionId:岗位ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
ResponseMessage<Object> deletePosition(String positionId);
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getPositionIdsByRoleId(String roleId);
|
||||
}
|
||||
|
||||
+192
-182
@@ -1,182 +1,192 @@
|
||||
package com.adc.da.slrs.sarPosition.service.impl;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.adc.da.utils.util.ListUtil;
|
||||
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;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.management.relation.Role;
|
||||
import javax.xml.crypto.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
@Service
|
||||
public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition> implements ITsPositionService {
|
||||
@Autowired
|
||||
private TsPositionDao tsPositionDao;
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
* @param tsPosition:查询信息
|
||||
* @return List<TsPosition>
|
||||
*/
|
||||
@Override
|
||||
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
||||
IPage page=new Page();
|
||||
// page.setTotal(tsPositionDao.pageTotal());
|
||||
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
|
||||
List<TsPosition> list = tsPositionDao.selectPositionAndRole(tsPosition);
|
||||
for (TsPosition tsPositions:list){
|
||||
tsPositions.getTsUser().forEach(res->{
|
||||
tsPositions.setOperator(res.getUname());
|
||||
});
|
||||
}
|
||||
page.setRecords(list);
|
||||
page.setTotal(page.getTotal());
|
||||
page.setCurrent(tsPosition.getCurrent());
|
||||
page.setSize(tsPosition.getPageSize());
|
||||
System.out.println(page.getTotal());
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置角色
|
||||
* @param tsPositionRoleVO :角色ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO) {
|
||||
TsPosition position=tsPositionDao.selectById(tsPositionRoleVO.getPositionId());
|
||||
if(position==null){
|
||||
return Result.error("该岗位不存在");
|
||||
}
|
||||
List<String> oldRoleIds=tsPositionDao.getRoleId(tsPositionRoleVO.getPositionId());
|
||||
Map<String,List<String>> updateRoleIds= ListUtil.difList(tsPositionRoleVO.getRoleIds(),oldRoleIds);
|
||||
List<String> insertIds=updateRoleIds.get("insert");
|
||||
List<String> deleteIds=updateRoleIds.get("delete");
|
||||
for(String id:insertIds){
|
||||
tsPositionDao.insertRole(tsPositionRoleVO.getPositionId(),id);
|
||||
}
|
||||
for(String id:deleteIds){
|
||||
tsPositionDao.deleteRole(tsPositionRoleVO.getPositionId(),id);
|
||||
}
|
||||
List<TsRole> roles=getRole(tsPositionRoleVO.getPositionId());
|
||||
return Result.success(roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色
|
||||
* @param positionId :岗位ID
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
@Override
|
||||
public List<TsRole> getRole(String positionId) {
|
||||
return tsPositionDao.getRole(positionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> addPosition(TsPosition tsPosition) {
|
||||
QueryWrapper<TsPosition> positionQueryWrapper=new QueryWrapper<>();
|
||||
positionQueryWrapper.eq("name",tsPosition.getName());
|
||||
List<TsPosition> tsPositions=tsPositionDao.selectList(positionQueryWrapper);
|
||||
if(tsPositions!=null&&tsPositions.size()>0){
|
||||
return Result.error("该岗位已存在");
|
||||
}
|
||||
//设置操作时间为当前系统时间
|
||||
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tsPosition.setType("2");
|
||||
tsPositionDao.insert(tsPosition);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> updatePosition(TsPosition tsPosition) {
|
||||
TsPosition oldPosition=tsPositionDao.selectById(tsPosition.getId());
|
||||
if(oldPosition==null){
|
||||
return Result.error("该岗位不存在");
|
||||
}
|
||||
if(!oldPosition.getType().equals("2")){
|
||||
return Result.error("该岗位不可修改");
|
||||
}
|
||||
tsPositionDao.updateById(tsPosition);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param positionId:岗位ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> deletePosition(String positionId) {
|
||||
TsPosition oldPosition=tsPositionDao.selectById(positionId);
|
||||
if(oldPosition==null){
|
||||
return Result.error("该岗位不存在");
|
||||
}
|
||||
if(!oldPosition.getType().equals("2")){
|
||||
return Result.error("该岗位不可删除");
|
||||
}
|
||||
List<String> roleIds=tsPositionDao.getRoleId(positionId);
|
||||
if(roleIds!=null&&roleIds.size()>0){
|
||||
return Result.error("该岗位已绑定角色,无法删除");
|
||||
}
|
||||
tsPositionDao.deleteById(positionId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRoleIdsByPositionIds(List<String> positionIds) {
|
||||
if(positionIds!=null&&positionIds.size()>0){
|
||||
return tsPositionDao.getRoleIdsByPositionIds(positionIds);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPositionIdsByRoleId(String roleId) {
|
||||
return tsPositionDao.getPositionIdsByRoleId(roleId);
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.sarPosition.service.impl;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||
import com.adc.da.utils.util.ListUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
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;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.management.relation.Role;
|
||||
import javax.xml.crypto.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-23
|
||||
*/
|
||||
@Service
|
||||
public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition> implements ITsPositionService {
|
||||
@Autowired
|
||||
private TsPositionDao tsPositionDao;
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
* @param tsPosition:查询信息
|
||||
* @return List<TsPosition>
|
||||
*/
|
||||
@Override
|
||||
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
||||
IPage page=new Page();
|
||||
// page.setTotal(tsPositionDao.pageTotal());
|
||||
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
|
||||
List<TsPosition> list = tsPositionDao.selectPositionAndRole(tsPosition);
|
||||
for (TsPosition tsPositions:list){
|
||||
tsPositions.getTsUser().forEach(res->{
|
||||
tsPositions.setOperator(res.getUname());
|
||||
});
|
||||
}
|
||||
page.setRecords(list);
|
||||
page.setTotal(page.getTotal());
|
||||
page.setCurrent(tsPosition.getCurrent());
|
||||
page.setSize(tsPosition.getPageSize());
|
||||
System.out.println(page.getTotal());
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置角色
|
||||
* @param tsPositionRoleVO :角色ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO) {
|
||||
TsPosition position=tsPositionDao.selectById(tsPositionRoleVO.getPositionId());
|
||||
if(position==null){
|
||||
return Result.error("该岗位不存在");
|
||||
}
|
||||
List<String> oldRoleIds=tsPositionDao.getRoleId(tsPositionRoleVO.getPositionId());
|
||||
Map<String,List<String>> updateRoleIds= ListUtil.difList(tsPositionRoleVO.getRoleIds(),oldRoleIds);
|
||||
List<String> insertIds=updateRoleIds.get("insert");
|
||||
List<String> deleteIds=updateRoleIds.get("delete");
|
||||
TsPosition tsPosition = new TsPosition();
|
||||
UpdateWrapper<TsPosition> updateWrapper = new UpdateWrapper<>();
|
||||
for(String id:insertIds){
|
||||
tsPositionDao.insertRole(tsPositionRoleVO.getPositionId(),id);
|
||||
updateWrapper.eq("id", tsPositionRoleVO.getPositionId());
|
||||
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||
baseMapper.update(tsPosition,updateWrapper);
|
||||
}
|
||||
for(String id:deleteIds){
|
||||
tsPositionDao.deleteRole(tsPositionRoleVO.getPositionId(),id);
|
||||
updateWrapper.eq("id", tsPositionRoleVO.getPositionId());
|
||||
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||
baseMapper.update(tsPosition,updateWrapper);
|
||||
}
|
||||
List<TsRole> roles=getRole(tsPositionRoleVO.getPositionId());
|
||||
return Result.success(roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色
|
||||
* @param positionId :岗位ID
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
@Override
|
||||
public List<TsRole> getRole(String positionId) {
|
||||
return tsPositionDao.getRole(positionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> addPosition(TsPosition tsPosition) {
|
||||
QueryWrapper<TsPosition> positionQueryWrapper=new QueryWrapper<>();
|
||||
positionQueryWrapper.eq("name",tsPosition.getName());
|
||||
List<TsPosition> tsPositions=tsPositionDao.selectList(positionQueryWrapper);
|
||||
if(tsPositions!=null&&tsPositions.size()>0){
|
||||
return Result.error("该岗位已存在");
|
||||
}
|
||||
//设置操作时间为当前系统时间
|
||||
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tsPosition.setType("2");
|
||||
tsPositionDao.insert(tsPosition);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
* @param tsPosition:岗位信息
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> updatePosition(TsPosition tsPosition) {
|
||||
TsPosition oldPosition=tsPositionDao.selectById(tsPosition.getId());
|
||||
if(oldPosition==null){
|
||||
return Result.error("该岗位不存在");
|
||||
}
|
||||
if(!oldPosition.getType().equals("2")){
|
||||
return Result.error("该岗位不可修改");
|
||||
}
|
||||
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tsPositionDao.updateById(tsPosition);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param positionId:岗位ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<Object> deletePosition(String positionId) {
|
||||
TsPosition oldPosition=tsPositionDao.selectById(positionId);
|
||||
if(oldPosition==null){
|
||||
return Result.error("该岗位不存在");
|
||||
}
|
||||
if(!oldPosition.getType().equals("2")){
|
||||
return Result.error("该岗位不可删除");
|
||||
}
|
||||
List<String> roleIds=tsPositionDao.getRoleId(positionId);
|
||||
if(roleIds!=null&&roleIds.size()>0){
|
||||
return Result.error("该岗位已绑定角色,无法删除");
|
||||
}
|
||||
tsPositionDao.deleteById(positionId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
* @return List<String>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRoleIdsByPositionIds(List<String> positionIds) {
|
||||
if(positionIds!=null&&positionIds.size()>0){
|
||||
return tsPositionDao.getRoleIdsByPositionIds(positionIds);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过roleId查询岗位ID列表
|
||||
* @param roleId:角色ID
|
||||
* @return List<String>
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPositionIdsByRoleId(String roleId) {
|
||||
return tsPositionDao.getPositionIdsByRoleId(roleId);
|
||||
}
|
||||
}
|
||||
|
||||
+341
-341
@@ -1,341 +1,341 @@
|
||||
package com.adc.da.slrs.sarStandardComplianceAssessResult.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.*;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretationForeignStandardService;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretationNationalStandardService;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarStandardComplianceProductAssessService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准法规准入清单详情表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--标准法规库--标准合规评估结果")
|
||||
@RequestMapping("/${restPath}/sarStandardComplianceAssessResult")
|
||||
public class SarStandardComplianceAssessResultController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandardComplianceAssessResultController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISarStandardComplianceProductAssessService iSarStandardComplianceProductAssessService;
|
||||
|
||||
@Autowired
|
||||
private ISarInterpretationForeignStandardService iSarInterpretationForeignStandardService;
|
||||
@Autowired
|
||||
private ISarInterpretationNationalStandardService iSarInterpretationNationalStandardService;
|
||||
|
||||
@ApiOperation(value = "条件查询标准清单")
|
||||
@GetMapping("/standard")
|
||||
public ResponseMessage<Object> selectStandard(SarStandardsInfoEO eo) throws Exception {
|
||||
|
||||
if (eo.getStandApplicationType() == 1) {
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
queryWrapper.select(" STAND_ID,ANY_VALUE(STAND_NUMBER) as STAND_NUMBER, STAND_NAME, STAND_TYPE");
|
||||
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
|
||||
}
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||
}
|
||||
if (eo.getType() != null && !eo.getType().trim().equals("")) {
|
||||
queryWrapper.like("type", eo.getType().trim());
|
||||
}
|
||||
queryWrapper.groupBy("STAND_ID,STAND_NAME,STAND_TYPE");
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
|
||||
while (page.getRecords().remove(null)) ;
|
||||
|
||||
return Result.success(page);
|
||||
} else {
|
||||
if (eo.getPosition() == 1) {
|
||||
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,risk_degree");
|
||||
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
|
||||
}
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||
}
|
||||
|
||||
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
|
||||
|
||||
while (page.getRecords().remove(null)) ;
|
||||
|
||||
return Result.success(page);
|
||||
} else {
|
||||
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME");
|
||||
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
|
||||
}
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||
}
|
||||
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while(page.getRecords().remove(null));
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class InsertEntity<T>{
|
||||
List<Map> entityList;
|
||||
T eo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "(插入/更新)标准清单")
|
||||
@PostMapping("/standard")
|
||||
public ResponseMessage insertStandard(@RequestBody InsertEntity<SarStandardsInfoEO> insertEntity) throws InvocationTargetException, IllegalAccessException {
|
||||
|
||||
SarStandardsInfoEO eo = insertEntity.eo;
|
||||
|
||||
if (eo.getStandApplicationType() == 1) {
|
||||
|
||||
List<SarStandardComplianceProductAssess> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarStandardComplianceProductAssess obj = new SarStandardComplianceProductAssess();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
|
||||
iSarStandardComplianceProductAssessService.saveOrUpdateBatch(entityList);
|
||||
|
||||
} else {
|
||||
if (eo.getPosition() == 1) {
|
||||
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationNationalStandard obj = new SarInterpretationNationalStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
|
||||
|
||||
}else{
|
||||
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationForeignStandardService.saveOrUpdateBatch(entityList);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "条件查询标准涉及项目符合性清单")
|
||||
@GetMapping("/product")
|
||||
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
|
||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||
if (eo.getType() != null) queryWrapper.eq("type", eo.getType());
|
||||
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
|
||||
if (eo.getProductId() != null) queryWrapper.like("product_id", eo.getProductId());
|
||||
queryWrapper.orderByAsc("product_name");
|
||||
queryWrapper.orderByAsc("standard_item");
|
||||
|
||||
// if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "标准涉及项目复合性详情")
|
||||
@GetMapping("/productNewDetail")
|
||||
public ResponseMessage<Map<String,IPage<SarStandardComplianceProductAssess>>> selectProductDetail(SarStandardComplianceProductAssessEO eo) throws Exception {
|
||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
Map<String,IPage<SarStandardComplianceProductAssess>> map=new HashMap<>();
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper.eq("product_id", eo.getProductId());
|
||||
queryWrapper.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.eq("no_involve","").or().isNull("no_involve"));
|
||||
queryWrapper.isNotNull("research_completion_time");
|
||||
queryWrapper.orderByAsc("product_name");
|
||||
queryWrapper.orderByAsc("standard_item");
|
||||
Page p1=new Page();
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
BeanUtils.copyProperties(page,p1);
|
||||
p1.setRecords(orderUtils(page.getRecords()));
|
||||
p1.setTotal(page.getTotal());
|
||||
map.put("unfit",p1);
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper1.eq("product_id", eo.getProductId());
|
||||
queryWrapper1.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.ne("research_compliance","").or().isNotNull("research_compliance"));
|
||||
queryWrapper1.orderByAsc("product_name");
|
||||
queryWrapper1.orderByAsc("standard_item");
|
||||
IPage<SarStandardComplianceProductAssess> page1 = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper1);
|
||||
Page p2=new Page();
|
||||
BeanUtils.copyProperties(page1,p2);
|
||||
p2.setRecords(orderUtils(page1.getRecords()));
|
||||
p2.setTotal(page1.getTotal());
|
||||
map.put("fit",p2);
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper2.eq("product_id", eo.getProductId());
|
||||
queryWrapper2.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.ne("no_involve","").and(sarStandardComplianceProductAssessQueryWrapper1 -> sarStandardComplianceProductAssessQueryWrapper1.isNotNull("no_involve")));
|
||||
queryWrapper2.orderByAsc("product_name");
|
||||
queryWrapper2.orderByAsc("standard_item");
|
||||
IPage<SarStandardComplianceProductAssess> page2 = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper2);
|
||||
page2.setRecords(orderUtils(page2.getRecords()));
|
||||
map.put("noFit",page2);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
private List<SarStandardComplianceProductAssess> orderUtils(List<SarStandardComplianceProductAssess> sarStandardCompliance){
|
||||
Map<Integer,List<SarStandardComplianceProductAssess>> stringMap=new HashMap<>();
|
||||
List<Integer> orderKey=new ArrayList<>();
|
||||
|
||||
for (SarStandardComplianceProductAssess s:sarStandardCompliance) {
|
||||
if (null!=s.getStandardItem()) {
|
||||
String[] as=(s.getStandardItem()+",").split(",");
|
||||
if (orderKey.contains(Integer.valueOf(as[0].trim().toString()))) {
|
||||
stringMap.get(Integer.valueOf(as[0].trim().toString())).add(s);
|
||||
} else {
|
||||
orderKey.add(Integer.valueOf(as[0].trim().toString()));
|
||||
List<SarStandardComplianceProductAssess> assesses2 = new ArrayList<>();
|
||||
assesses2.add(s);
|
||||
stringMap.put(Integer.valueOf(as[0].trim().toString()), assesses2);
|
||||
}
|
||||
}else {
|
||||
if (null!=stringMap.get(0)) {
|
||||
stringMap.get(0).add(s);
|
||||
}else {
|
||||
List<SarStandardComplianceProductAssess> assesses = new ArrayList<>();
|
||||
assesses.add(s);
|
||||
stringMap.put(0,assesses);
|
||||
orderKey.add(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Collections.sort(orderKey,(o1, o2) -> {
|
||||
return (o1 -o2);
|
||||
});
|
||||
List<SarStandardComplianceProductAssess> res=new ArrayList<>();
|
||||
orderKey.forEach(integer -> {
|
||||
res.addAll(stringMap.get(integer));
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "标准涉及项目复合性")
|
||||
@GetMapping("/productNew")
|
||||
public ResponseMessage<IPage<unCountDTO>> selectProduct(unCountDTO eo) throws Exception {
|
||||
Page iPage = new Page<>();
|
||||
iPage.setCurrent(eo.getCurrent());
|
||||
iPage.setSize(eo.getSize());
|
||||
|
||||
IPage<unCountDTO> page = iSarStandardComplianceProductAssessService.selectPages(iPage, eo);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "插入标准涉及项目符合性清单")
|
||||
@PostMapping("/add")
|
||||
public ResponseMessage insertProduct(@RequestBody List<SarStandardComplianceProductAssess> eo) throws Exception {
|
||||
|
||||
eo.forEach(sarStandardComplianceProductAssess -> {
|
||||
sarStandardComplianceProductAssess.setId(UUIDUtils.randomUUID(32));
|
||||
sarStandardComplianceProductAssess.setInterpretationTime(new Date());
|
||||
});
|
||||
iSarStandardComplianceProductAssessService.saveBatch(eo);
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "条件查询技术审核符合性清单")
|
||||
@GetMapping("/interpretation")
|
||||
public ResponseMessage<Object> selectNationalStandard(InterpretationEO eo) throws Exception {
|
||||
if (eo.getPosition() == 1) {
|
||||
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
List<SarInterpretationNationalStandard> standards=iSarInterpretationNationalStandardService.getAllDatas(eo);
|
||||
Integer datasCount=iSarInterpretationNationalStandardService.getAllDatasCount(eo);
|
||||
iPage.setTotal(datasCount);
|
||||
iPage.setRecords(standards);
|
||||
while (iPage.getRecords().remove(null)) ;
|
||||
return Result.success(iPage);
|
||||
} else {
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
|
||||
//如果查询条件里标准编号不为空,查询
|
||||
if (eo.getStandNumber() != null) queryWrapper.like("STAND_NUMBER",eo.getStandNumber());
|
||||
//如果查询条件里标准名称不为空,查询
|
||||
if (eo.getStandName() != null) queryWrapper.like("STAND_NAME",eo.getStandName());
|
||||
//如果查询条件里具体章条不为空,查询
|
||||
if (eo.getSpecificItem() != null) queryWrapper.like("specific_item",eo.getSpecificItem());
|
||||
|
||||
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while (page.getRecords().remove(null)) ;
|
||||
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "插入技术审核符合性清单")
|
||||
@PostMapping("/interpretation")
|
||||
public ResponseMessage insertInterpretation(InsertEntity<InterpretationEO> insertEntity) throws Exception {
|
||||
|
||||
InterpretationEO eo = insertEntity.eo;
|
||||
|
||||
if (eo.getPosition() == 1) {
|
||||
|
||||
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationNationalStandard obj = new SarInterpretationNationalStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
|
||||
} else {
|
||||
|
||||
|
||||
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationForeignStandardService.saveOrUpdateBatch(entityList);
|
||||
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.sarStandardComplianceAssessResult.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.*;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretationForeignStandardService;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretationNationalStandardService;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarStandardComplianceProductAssessService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准法规准入清单详情表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--标准法规库--标准合规评估结果")
|
||||
@RequestMapping("/${restPath}/sarStandardComplianceAssessResult")
|
||||
public class SarStandardComplianceAssessResultController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandardComplianceAssessResultController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISarStandardComplianceProductAssessService iSarStandardComplianceProductAssessService;
|
||||
|
||||
@Autowired
|
||||
private ISarInterpretationForeignStandardService iSarInterpretationForeignStandardService;
|
||||
@Autowired
|
||||
private ISarInterpretationNationalStandardService iSarInterpretationNationalStandardService;
|
||||
|
||||
@ApiOperation(value = "条件查询标准清单")
|
||||
@GetMapping("/standard")
|
||||
public ResponseMessage<Object> selectStandard(SarStandardsInfoEO eo) throws Exception {
|
||||
|
||||
if (eo.getStandApplicationType() == 1) {
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
queryWrapper.select(" STAND_ID,ANY_VALUE(STAND_NUMBER) as STAND_NUMBER, STAND_NAME, STAND_TYPE");
|
||||
if (eo.getStandName() != null ) {
|
||||
queryWrapper.like("STAND_NAME", eo.getStandName().replace(" ",""));
|
||||
}
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||
}
|
||||
if (eo.getType() != null && !eo.getType().trim().equals("")) {
|
||||
queryWrapper.like("type", eo.getType().trim());
|
||||
}
|
||||
queryWrapper.groupBy("STAND_ID,STAND_NAME,STAND_TYPE");
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
|
||||
while (page.getRecords().remove(null)) ;
|
||||
|
||||
return Result.success(page);
|
||||
} else {
|
||||
if (eo.getPosition() == 1) {
|
||||
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,risk_degree");
|
||||
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
|
||||
}
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||
}
|
||||
|
||||
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
|
||||
|
||||
while (page.getRecords().remove(null)) ;
|
||||
|
||||
return Result.success(page);
|
||||
} else {
|
||||
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME");
|
||||
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
|
||||
}
|
||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||
}
|
||||
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while(page.getRecords().remove(null));
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class InsertEntity<T>{
|
||||
List<Map> entityList;
|
||||
T eo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "(插入/更新)标准清单")
|
||||
@PostMapping("/standard")
|
||||
public ResponseMessage insertStandard(@RequestBody InsertEntity<SarStandardsInfoEO> insertEntity) throws InvocationTargetException, IllegalAccessException {
|
||||
|
||||
SarStandardsInfoEO eo = insertEntity.eo;
|
||||
|
||||
if (eo.getStandApplicationType() == 1) {
|
||||
|
||||
List<SarStandardComplianceProductAssess> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarStandardComplianceProductAssess obj = new SarStandardComplianceProductAssess();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
|
||||
iSarStandardComplianceProductAssessService.saveOrUpdateBatch(entityList);
|
||||
|
||||
} else {
|
||||
if (eo.getPosition() == 1) {
|
||||
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationNationalStandard obj = new SarInterpretationNationalStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
|
||||
|
||||
}else{
|
||||
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationForeignStandardService.saveOrUpdateBatch(entityList);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "条件查询标准涉及项目符合性清单")
|
||||
@GetMapping("/product")
|
||||
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
|
||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||
if (eo.getType() != null) queryWrapper.eq("type", eo.getType());
|
||||
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
|
||||
if (eo.getProductId() != null) queryWrapper.like("product_id", eo.getProductId());
|
||||
queryWrapper.orderByAsc("product_name");
|
||||
queryWrapper.orderByAsc("standard_item");
|
||||
|
||||
// if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "标准涉及项目复合性详情")
|
||||
@GetMapping("/productNewDetail")
|
||||
public ResponseMessage<Map<String,IPage<SarStandardComplianceProductAssess>>> selectProductDetail(SarStandardComplianceProductAssessEO eo) throws Exception {
|
||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
Map<String,IPage<SarStandardComplianceProductAssess>> map=new HashMap<>();
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper.eq("product_id", eo.getProductId());
|
||||
queryWrapper.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.eq("no_involve","").or().isNull("no_involve"));
|
||||
queryWrapper.isNotNull("research_completion_time");
|
||||
queryWrapper.orderByAsc("product_name");
|
||||
queryWrapper.orderByAsc("standard_item");
|
||||
Page p1=new Page();
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
BeanUtils.copyProperties(page,p1);
|
||||
p1.setRecords(orderUtils(page.getRecords()));
|
||||
p1.setTotal(page.getTotal());
|
||||
map.put("unfit",p1);
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper1.eq("product_id", eo.getProductId());
|
||||
queryWrapper1.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.ne("research_compliance","").or().isNotNull("research_compliance"));
|
||||
queryWrapper1.orderByAsc("product_name");
|
||||
queryWrapper1.orderByAsc("standard_item");
|
||||
IPage<SarStandardComplianceProductAssess> page1 = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper1);
|
||||
Page p2=new Page();
|
||||
BeanUtils.copyProperties(page1,p2);
|
||||
p2.setRecords(orderUtils(page1.getRecords()));
|
||||
p2.setTotal(page1.getTotal());
|
||||
map.put("fit",p2);
|
||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.eq("STAND_ID", eo.getStandId());
|
||||
queryWrapper2.eq("product_id", eo.getProductId());
|
||||
queryWrapper2.and(sarStandardComplianceProductAssessQueryWrapper -> sarStandardComplianceProductAssessQueryWrapper.ne("no_involve","").and(sarStandardComplianceProductAssessQueryWrapper1 -> sarStandardComplianceProductAssessQueryWrapper1.isNotNull("no_involve")));
|
||||
queryWrapper2.orderByAsc("product_name");
|
||||
queryWrapper2.orderByAsc("standard_item");
|
||||
IPage<SarStandardComplianceProductAssess> page2 = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper2);
|
||||
page2.setRecords(orderUtils(page2.getRecords()));
|
||||
map.put("noFit",page2);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
private List<SarStandardComplianceProductAssess> orderUtils(List<SarStandardComplianceProductAssess> sarStandardCompliance){
|
||||
Map<Integer,List<SarStandardComplianceProductAssess>> stringMap=new HashMap<>();
|
||||
List<Integer> orderKey=new ArrayList<>();
|
||||
|
||||
for (SarStandardComplianceProductAssess s:sarStandardCompliance) {
|
||||
if (null!=s.getStandardItem()) {
|
||||
String[] as=(s.getStandardItem()+",").split(",");
|
||||
if (orderKey.contains(Integer.valueOf(as[0].trim().toString()))) {
|
||||
stringMap.get(Integer.valueOf(as[0].trim().toString())).add(s);
|
||||
} else {
|
||||
orderKey.add(Integer.valueOf(as[0].trim().toString()));
|
||||
List<SarStandardComplianceProductAssess> assesses2 = new ArrayList<>();
|
||||
assesses2.add(s);
|
||||
stringMap.put(Integer.valueOf(as[0].trim().toString()), assesses2);
|
||||
}
|
||||
}else {
|
||||
if (null!=stringMap.get(0)) {
|
||||
stringMap.get(0).add(s);
|
||||
}else {
|
||||
List<SarStandardComplianceProductAssess> assesses = new ArrayList<>();
|
||||
assesses.add(s);
|
||||
stringMap.put(0,assesses);
|
||||
orderKey.add(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Collections.sort(orderKey,(o1, o2) -> {
|
||||
return (o1 -o2);
|
||||
});
|
||||
List<SarStandardComplianceProductAssess> res=new ArrayList<>();
|
||||
orderKey.forEach(integer -> {
|
||||
res.addAll(stringMap.get(integer));
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "标准涉及项目复合性")
|
||||
@GetMapping("/productNew")
|
||||
public ResponseMessage<IPage<unCountDTO>> selectProduct(unCountDTO eo) throws Exception {
|
||||
Page iPage = new Page<>();
|
||||
iPage.setCurrent(eo.getCurrent());
|
||||
iPage.setSize(eo.getSize());
|
||||
|
||||
IPage<unCountDTO> page = iSarStandardComplianceProductAssessService.selectPages(iPage, eo);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "插入标准涉及项目符合性清单")
|
||||
@PostMapping("/add")
|
||||
public ResponseMessage insertProduct(@RequestBody List<SarStandardComplianceProductAssess> eo) throws Exception {
|
||||
|
||||
eo.forEach(sarStandardComplianceProductAssess -> {
|
||||
sarStandardComplianceProductAssess.setId(UUIDUtils.randomUUID(32));
|
||||
sarStandardComplianceProductAssess.setInterpretationTime(new Date());
|
||||
});
|
||||
iSarStandardComplianceProductAssessService.saveBatch(eo);
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "条件查询技术审核符合性清单")
|
||||
@GetMapping("/interpretation")
|
||||
public ResponseMessage<Object> selectNationalStandard(InterpretationEO eo) throws Exception {
|
||||
if (eo.getPosition() == 1) {
|
||||
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
List<SarInterpretationNationalStandard> standards=iSarInterpretationNationalStandardService.getAllDatas(eo);
|
||||
Integer datasCount=iSarInterpretationNationalStandardService.getAllDatasCount(eo);
|
||||
iPage.setTotal(datasCount);
|
||||
iPage.setRecords(standards);
|
||||
while (iPage.getRecords().remove(null)) ;
|
||||
return Result.success(iPage);
|
||||
} else {
|
||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
|
||||
//如果查询条件里标准编号不为空,查询
|
||||
if (eo.getStandNumber() != null) queryWrapper.like("STAND_NUMBER",eo.getStandNumber());
|
||||
//如果查询条件里标准名称不为空,查询
|
||||
if (eo.getStandName() != null) queryWrapper.like("STAND_NAME",eo.getStandName());
|
||||
//如果查询条件里具体章条不为空,查询
|
||||
if (eo.getSpecificItem() != null) queryWrapper.like("specific_item",eo.getSpecificItem());
|
||||
|
||||
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
|
||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||
while (page.getRecords().remove(null)) ;
|
||||
|
||||
return Result.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "插入技术审核符合性清单")
|
||||
@PostMapping("/interpretation")
|
||||
public ResponseMessage insertInterpretation(InsertEntity<InterpretationEO> insertEntity) throws Exception {
|
||||
|
||||
InterpretationEO eo = insertEntity.eo;
|
||||
|
||||
if (eo.getPosition() == 1) {
|
||||
|
||||
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationNationalStandard obj = new SarInterpretationNationalStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
|
||||
} else {
|
||||
|
||||
|
||||
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
|
||||
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
|
||||
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||
entityList.add(obj);
|
||||
}
|
||||
iSarInterpretationForeignStandardService.saveOrUpdateBatch(entityList);
|
||||
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
package com.adc.da.slrs.wgCommittee.dao;
|
||||
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
public interface WgCommitteeDao extends BaseMapper<WgCommittee> {
|
||||
|
||||
List<WgCommitteeDTO> getData(WgCommittee wgCommittee);
|
||||
Integer getDataCount(WgCommittee wgCommittee);
|
||||
|
||||
List<WgCommitteeDTO> getDataWk(WgCommittee wgCommittee);
|
||||
Integer getDataCountWk(WgCommittee wgCommittee);
|
||||
|
||||
}
|
||||
package com.adc.da.slrs.wgCommittee.dao;
|
||||
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
public interface WgCommitteeDao extends BaseMapper<WgCommittee> {
|
||||
|
||||
List<WgCommitteeDTO> getData(WgCommittee wgCommittee);
|
||||
Integer getDataCount(WgCommittee wgCommittee);
|
||||
|
||||
List<WgCommitteeDTO> getDataWk(WgCommittee wgCommittee);
|
||||
Integer getDataCountWk(WgCommittee wgCommittee);
|
||||
|
||||
String selectCommittor(@Param("str") List<String> str);
|
||||
|
||||
}
|
||||
|
||||
+100
-93
@@ -1,93 +1,100 @@
|
||||
package com.adc.da.slrs.wgCommittee.service.impl;
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.adc.da.slrs.wgCommittee.service.IWgCommitteeService;
|
||||
import com.adc.da.slrs.wgCommitteeUser.entity.WgCommitteeUser;
|
||||
import com.adc.da.slrs.wgCommitteeUser.service.IWgCommitteeUserService;
|
||||
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;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
@Service
|
||||
public class WgCommitteeServiceImpl extends ServiceImpl<WgCommitteeDao, WgCommittee> implements IWgCommitteeService {
|
||||
|
||||
@Autowired
|
||||
IWgCommitteeUserService iWgCommitteeUserService;
|
||||
@Autowired
|
||||
IWgCommitteeService iWgCommitteeService;
|
||||
@Autowired
|
||||
WgCommitteeDao wgCommitteeDao;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean add(WgCommittee wgCommittee) {
|
||||
wgCommittee.setId(String.valueOf(UUID.randomUUID()));
|
||||
String id=String.valueOf(UUID.randomUUID());
|
||||
wgCommittee.setCommitteer(id);
|
||||
List<WgCommitteeUser> list=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()) {
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
||||
res.stream().forEach(s -> list.add(new WgCommitteeUser().setCommitterId(s).setId(wgCommittee.getCommitteer())));
|
||||
iWgCommitteeUserService.saveOrUpdateBatch(list);
|
||||
}
|
||||
if (iWgCommitteeService.saveOrUpdate(wgCommittee)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean update(WgCommittee wgCommittee) {
|
||||
iWgCommitteeService.updateById(wgCommittee);
|
||||
List<WgCommitteeUser> save=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()){
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
||||
res.forEach(s -> save.add(new WgCommitteeUser().setId(wgCommittee.getCommitteer()).setCommitterId(s)));
|
||||
}
|
||||
if (iWgCommitteeUserService.updateBatchById(save)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommittee(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
page.setRecords(wgCommitteeDao.getData(wgCommittee));
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCount(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommitteeWk(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
page.setRecords(wgCommitteeDao.getDataWk(wgCommittee));
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCountWk(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgCommittee.service.impl;
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.adc.da.slrs.wgCommittee.service.IWgCommitteeService;
|
||||
import com.adc.da.slrs.wgCommitteeUser.entity.WgCommitteeUser;
|
||||
import com.adc.da.slrs.wgCommitteeUser.service.IWgCommitteeUserService;
|
||||
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;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
@Service
|
||||
public class WgCommitteeServiceImpl extends ServiceImpl<WgCommitteeDao, WgCommittee> implements IWgCommitteeService {
|
||||
|
||||
@Autowired
|
||||
IWgCommitteeUserService iWgCommitteeUserService;
|
||||
@Autowired
|
||||
IWgCommitteeService iWgCommitteeService;
|
||||
@Autowired
|
||||
WgCommitteeDao wgCommitteeDao;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean add(WgCommittee wgCommittee) {
|
||||
wgCommittee.setId(String.valueOf(UUID.randomUUID()));
|
||||
String id=String.valueOf(UUID.randomUUID());
|
||||
wgCommittee.setCommitteer(id);
|
||||
List<WgCommitteeUser> list=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()) {
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
||||
res.stream().forEach(s -> list.add(new WgCommitteeUser().setCommitterId(s).setId(wgCommittee.getCommitteer())));
|
||||
iWgCommitteeUserService.saveOrUpdateBatch(list);
|
||||
}
|
||||
if (iWgCommitteeService.saveOrUpdate(wgCommittee)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean update(WgCommittee wgCommittee) {
|
||||
iWgCommitteeService.updateById(wgCommittee);
|
||||
List<WgCommitteeUser> save=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()){
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds()));
|
||||
res.forEach(s ->
|
||||
save.add(new WgCommitteeUser().setId(wgCommittee.getCommitteer()).setCommitterId(s))
|
||||
);
|
||||
}
|
||||
if (iWgCommitteeUserService.updateBatchById(save)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommittee(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
List<WgCommitteeDTO> list = wgCommitteeDao.getData(wgCommittee);
|
||||
for (WgCommitteeDTO wgCommitteeDTO : list){
|
||||
List<String> str = Arrays.asList(wgCommitteeDTO.getCommittorId().split(","));
|
||||
wgCommitteeDTO.setCommittor(wgCommitteeDao.selectCommittor(str));
|
||||
}
|
||||
page.setRecords(list);
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCount(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommitteeWk(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
page.setRecords(wgCommitteeDao.getDataWk(wgCommittee));
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCountWk(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,73 @@
|
||||
<?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.wgCommittee.dao.WgCommitteeDao">
|
||||
|
||||
<select id="getData" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
||||
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
|
||||
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
||||
wg_committee.committeer ,
|
||||
(
|
||||
SELECT GROUP_CONCAT(t3.UNAME) FROM wg_committee_user
|
||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||
WHERE wg_committee_user.id = wg_committee.committeer
|
||||
) as committor,
|
||||
(
|
||||
SELECT GROUP_CONCAT(t3.USID) FROM wg_committee_user
|
||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||
WHERE wg_committee_user.id = wg_committee.committeer
|
||||
) as committorId
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
limit ${(page-1)*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<select id="getDataCount" resultType="java.lang.Integer">
|
||||
SELECT count(wg_committee.id)
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDataWk" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
||||
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
|
||||
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
||||
t3.UNAME as committor,t3.USID as committorId,wg_committee.committeer ,
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
|
||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
limit ${(page-1)*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<select id="getDataCountWk" resultType="java.lang.Integer">
|
||||
SELECT count(wg_committee.id)
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
|
||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<?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.wgCommittee.dao.WgCommitteeDao">
|
||||
|
||||
<select id="getData" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
||||
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
|
||||
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
||||
wg_committee.committeer , wg_committee_user.committer_id as committorId
|
||||
from wg_committee
|
||||
LEFT JOIN wg_committee_user ON wg_committee.committeer = wg_committee_user.id
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
limit ${(page-1)*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<select id="getDataCount" resultType="java.lang.Integer">
|
||||
SELECT count(wg_committee.id)
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDataWk" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
||||
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
|
||||
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
||||
t3.UNAME as committor,t3.USID as committorId,wg_committee.committeer ,
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
|
||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
limit ${(page-1)*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<select id="getDataCountWk" resultType="java.lang.Integer">
|
||||
SELECT count(wg_committee.id)
|
||||
from wg_committee
|
||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
|
||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||
where 1=1
|
||||
<if test="committeeName != null and ''!=committeeName">
|
||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectCommittor" resultType="java.lang.String">
|
||||
SELECT
|
||||
group_concat( tu.UNAME SEPARATOR ',' ) as committor
|
||||
FROM
|
||||
ts_user tu
|
||||
WHERE
|
||||
tu.USID
|
||||
IN
|
||||
<foreach collection="str" item="USID" open="(" close=")" separator=",">
|
||||
<!-- 每个遍历需要生成的串 -->
|
||||
#{USID}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user