Merge branch 'develop_master' of http://gitlab.91isoft.com:90/LiuChao/foton-slrs-system-rest into develop_master

This commit is contained in:
zhangyanduan
2022-03-23 16:30:21 +08:00
20 changed files with 751 additions and 681 deletions
@@ -138,7 +138,7 @@ stand.edit.file.path = /data/slrs/file/
file.downloadUrl=https://srms.foton.com.cn/file/
#上传文件白名单-以,分隔
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt,pdg
# =============================================================================
# elasticsearch 配置
@@ -17,9 +17,10 @@ public class importExcelDTO {
@Excel(name = "制修订类型",orderNum = "2", width = 20.0)
private String reviseStatus;
@Excel(name = "起草责任单位" , orderNum = "3", width = 20.0)
private String unitName;
@Excel(name = "起草责任单位" , orderNum = "3", width = 20.0)
private String unit;
private String drafterName;
@@ -73,9 +73,9 @@ public class IExportServiceImpl implements IExportService {
stringBuilder.append("" + i + "行第7列工作组组长填写不符合格式要求请检查;");
}
}
if (null!=importExcelDTO.getUnit() && !"".equals(importExcelDTO.getUnit())){
importExcelDTO.setUnitName(tsInstitutionMap.get(importExcelDTO.getUnit()));
if (null==tsInstitutionMap.get(importExcelDTO.getUnit())){
if (null!=importExcelDTO.getUnitName() && !"".equals(importExcelDTO.getUnitName())){
importExcelDTO.setUnit(tsInstitutionMap.get(importExcelDTO.getUnitName()));
if (null==tsInstitutionMap.get(importExcelDTO.getUnitName())){
stringBuilder.append(""+i+"行第4列起草责任单位填写不符合格式要求请检查;");
}
}
@@ -61,6 +61,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.sql.Clob;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -550,18 +551,30 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
map.put("standEnName",verifyObj(sarStandardsInfoEO.getStandEnName()));
map.put("standNature",verifyObj(sarStandardsInfoEO.getStandNature()));
map.put("standState",verifyObj(sarStandardsInfoEO.getStandStatus()));
// if (sarStandardsInfoEO.getIssueTime() != null) {
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// String issueStr = format.format(sarStandardsInfoEO.getIssueTime());
// map.put("issueTime",issueStr);
// }
map.put("issueTime", verifyObj(sarStandardsInfoEO.getIssueTime()));
map.put("putTime", verifyObj(sarStandardsInfoEO.getPutTime()));
// if (sarStandardsInfoEO.getPutTime() != null) {
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// String issueStr = format.format(sarStandardsInfoEO.getPutTime());
// map.put("putTime",issueStr);
// }
if (sarStandardsInfoEO.getIssueTime() != null) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
String issueStr = "";
try {
issueStr = format2.format(format.parse(sarStandardsInfoEO.getIssueTime()));
}catch (Exception e){
}
map.put("issueTime",issueStr);
}else{
map.put("issueTime", "");
}
if (sarStandardsInfoEO.getPutTime() != null) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
String issueStr = "";
try {
issueStr = format2.format(format.parse(sarStandardsInfoEO.getPutTime()));
}catch (Exception e){
}
map.put("putTime",issueStr);
}else {
map.put("putTime", "");
}
map.put("replaceStandNum",sarStandardsInfoEO.getReplaceStandNum());
map.put("replacedStandNum",sarStandardsInfoEO.getReplacedStandNum());
return map;
@@ -822,7 +835,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
convert.setFileSuffix(fileInfo.getFileSuffix());
convert.setStandFileClassify(field);
convert.setConvertType(SarTypeEnum.BUSINESS.getValue());
convertMq.sendMQ(convert);
// convertMq.sendMQ(convert);
}
}
}
@@ -151,12 +151,12 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
if (!getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
// List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
// if (!getMenuIdList.isEmpty()) {
// page.setMenuRoleList(getMenuIdList);
// } else {
// page.setMenuRoleList(null);
// }
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
@@ -180,12 +180,12 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
if (!getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
// List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
// if (!getMenuIdList.isEmpty()) {
// page.setMenuRoleList(getMenuIdList);
// } else {
// page.setMenuRoleList(null);
// }
List<String> ids = iTsResourceService.getChildMenuList(userId);
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
@@ -429,12 +429,12 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
// List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
// if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
// page.setMenuRoleList(getMenuIdList);
// } else {
// page.setMenuRoleList(null);
// }
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
@@ -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;
}
@@ -1,15 +1,17 @@
package com.adc.da.slrs.sarPosition.entity;
import com.adc.da.slrs.sarRole.entity.TsRole;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class TsPositionRoleVO {
@NotNull(message = "positionId不能为空")
private String positionId;
@NotNull(message = "roleIds不能为空")
private List<String> roleIds;
}
package com.adc.da.slrs.sarPosition.entity;
import com.adc.da.slrs.sarRole.entity.TsRole;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class TsPositionRoleVO {
@NotNull(message = "positionId不能为空")
private String positionId;
@NotNull(message = "roleIds不能为空")
private List<String> roleIds;
private String operator;
}
@@ -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);
}
@@ -1,182 +1,194 @@
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()));
tsPosition.setOperator(tsPositionRoleVO.getOperator());
baseMapper.update(tsPosition,updateWrapper);
}
for(String id:deleteIds){
tsPositionDao.deleteRole(tsPositionRoleVO.getPositionId(),id);
updateWrapper.eq("id", tsPositionRoleVO.getPositionId());
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
tsPosition.setOperator(tsPositionRoleVO.getOperator());
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);
}
}
@@ -3,12 +3,16 @@ package com.adc.da.slrs.sarStandIdea.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll;
import com.adc.da.slrs.sarStandIdea.entity.SeByoDto;
import com.adc.da.slrs.sarStandIdea.service.ISarPublicIdeaAllService;
import com.adc.da.slrs.sarStandIdea.service.ISarPublicIdeaService;
import com.adc.da.slrs.sarStandIdea.service.Impl.SarPublicIdeaServiceImpl;
import com.adc.da.sys.util.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
@@ -36,6 +40,9 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
@Autowired
private ISarPublicIdeaService sarPublicIdeaService;
@Autowired
private ISarPublicIdeaAllService sarPublicIdeaAllService;
@ApiOperation(value = "分页查询")
@GetMapping("/SelectAllPage")
public ResponseMessage selectAllPage(@RequestParam(defaultValue="1")Integer page,@RequestParam(defaultValue="10")Integer size,String categorg, String cname,
@@ -87,4 +94,18 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
}
@ApiOperation(value = "动态查询")
@GetMapping("/deletePublicIdea")
public ResponseMessage delete(@RequestParam("id") String id){
QueryWrapper<SarPublicIdea> wrapper=new QueryWrapper<>();
wrapper.eq("uniques",id);
SarPublicIdea sarPublicIdea=sarPublicIdeaService.getOne(wrapper);
sarPublicIdeaService.remove(wrapper);
QueryWrapper<SarPublicIdeaAll> wrapper1=new QueryWrapper<>();
wrapper1.eq("idea_id",sarPublicIdea.getId());
sarPublicIdeaAllService.remove(wrapper1);
return Result.success();
}
}
@@ -280,6 +280,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
Integer count=dao.sarItemCount(page);
page.getPager().setRowCount(count);
List<SarStandItems> sarStandItems = dao.querySarItemAndInterpretation(page);
sarStandItems.forEach(sarStandItems1 -> sarStandItems1.setTermsConditions(StringUtils.replace(sarStandItems1.getTermsConditions(),"''","'")));
return sarStandItems;
}
@@ -69,6 +69,12 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
head.setBIZTRANSACTIONID(HEAD.get("BIZTRANSACTIONID").getAsString());
List<String> strings=new ArrayList<>();
strings.add("G4");
strings.add("G9");
strings.add("G8");
strings.add("G7");
//LIST是数组,所以强转成JSONArray
JsonArray LIST = (JsonArray) jsonObject.get("LIST");
@@ -105,13 +111,15 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
.setProjectEndDate(targetEndOn);
}
projectInfo.setId(UUIDUtils.randomUUID20());
QueryWrapper<SarStandProjectLibrary> updateCondition = new QueryWrapper<SarStandProjectLibrary>();
updateCondition.eq("project_number",projectInfo.getProjectNumber());
SarStandProjectLibrary res=this.getOne(updateCondition);
if (strings.contains(projectInfo.getCurrentNode().trim()) && !res.getCurrentNode().trim().equals(projectInfo.getCurrentNode())){
projectInfo.setFlag("0");
}
// .eq("project_start_date",targetBeginOn);
this.saveOrUpdate(projectInfo,updateCondition);
}
@@ -55,8 +55,8 @@ public class SarStandardComplianceAssessResultController {
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.getStandName() != null ) {
queryWrapper.like("STAND_NAME", eo.getStandName().replace(" ",""));
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
@@ -219,8 +219,7 @@ public class SarStandardComplianceAssessResultController {
for (SarStandardComplianceProductAssess s:sarStandardCompliance) {
if (null!=s.getStandardItem()) {
String gos= StringUtils.replace(s.getStandardItem(),".",",");
String[] as=(gos+",").split(",");
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 {
@@ -233,7 +233,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
// sarAdvanceSearchVO.setField("STAND_SYSTEM");
// }
// });
String advanceStr = SarAdvanceSearchUtil.createStandSql(searchList,"sar_standards_info");
String advanceStr = SarAdvanceSearchUtil.createStandSql(searchList,"sar_stand_attr_info");
if (StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
@@ -239,7 +239,7 @@ public class SarUpdLogServiceImpl extends ServiceImpl<SarUpdLogDao, SarUpdLog> i
// case "country": return "适用区域";
// case "isRelateAccess": return "重要度";
case "issueTime": return "发布日期";
case "putTime": return "实施日期";
case "putTime": return "标实施日期";
// case "standYear": return "标准年份";
// case "standNature": return "标准性质";
case "standEnName": return "英文名称";
@@ -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);
}
@@ -1,93 +1,97 @@
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.*;
/**
* <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<>(Collections.singletonList(wgCommittee.getCommitteeIds()));
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<>(Collections.singletonList(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;
}
}
@@ -121,9 +121,9 @@ public class SarAdvanceSearchUtil {
case "BETWEEN":
String[] boundaryArray = searchVO.getValue().split(",");
if (i == 0) {
sql += "DATE_FORMAT(" + tableName + searchVO.getField() + ",'%Y-%m-%d')" + " " + "BETWEEN" + " " + "DATE_FORMAT(" + "\'" + boundaryArray[0].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')" + " AND " + "DATE_FORMAT(" + "\'" + boundaryArray[1].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')";
sql += "DATE_FORMAT(left(" + tableName + searchVO.getField() + ",10),'%Y-%m-%d')" + " " + "BETWEEN" + " " + "DATE_FORMAT(" + "\'" + boundaryArray[0].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')" + " AND " + "DATE_FORMAT(" + "\'" + boundaryArray[1].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')";
} else {
sql += " AND " + " " + "DATE_FORMAT(" + tableName + searchVO.getField() + ",'%Y-%m-%d')" + " " + "BETWEEN" + " " + "DATE_FORMAT(" + "\'" + boundaryArray[0].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')" + " AND " + "DATE_FORMAT(" + "\'" + boundaryArray[1].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')";
sql += " AND " + " " + "DATE_FORMAT(left(" + tableName + searchVO.getField() + ",10),'%Y-%m-%d')" + " " + "BETWEEN" + " " + "DATE_FORMAT(" + "\'" + boundaryArray[0].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')" + " AND " + "DATE_FORMAT(" + "\'" + boundaryArray[1].replaceAll("\\s*", "") + "\'" + ",'%Y-%m-%d')";
}
break;
case "equals":
@@ -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>