Merge branch 'develop_master' of http://gitlab.91isoft.com:90/LiuChao/foton-slrs-system-rest into develop_master
This commit is contained in:
@@ -138,7 +138,7 @@ stand.edit.file.path = /data/slrs/file/
|
|||||||
file.downloadUrl=https://srms.foton.com.cn/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 配置
|
# elasticsearch 配置
|
||||||
|
|||||||
@@ -17,9 +17,10 @@ public class importExcelDTO {
|
|||||||
@Excel(name = "制修订类型",orderNum = "2", width = 20.0)
|
@Excel(name = "制修订类型",orderNum = "2", width = 20.0)
|
||||||
private String reviseStatus;
|
private String reviseStatus;
|
||||||
|
|
||||||
|
@Excel(name = "起草责任单位" , orderNum = "3", width = 20.0)
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
@Excel(name = "起草责任单位" , orderNum = "3", width = 20.0)
|
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
private String drafterName;
|
private String drafterName;
|
||||||
|
|||||||
+3
-3
@@ -73,9 +73,9 @@ public class IExportServiceImpl implements IExportService {
|
|||||||
stringBuilder.append("第" + i + "行第7列工作组组长填写不符合格式要求请检查;");
|
stringBuilder.append("第" + i + "行第7列工作组组长填写不符合格式要求请检查;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (null!=importExcelDTO.getUnit() && !"".equals(importExcelDTO.getUnit())){
|
if (null!=importExcelDTO.getUnitName() && !"".equals(importExcelDTO.getUnitName())){
|
||||||
importExcelDTO.setUnitName(tsInstitutionMap.get(importExcelDTO.getUnit()));
|
importExcelDTO.setUnit(tsInstitutionMap.get(importExcelDTO.getUnitName()));
|
||||||
if (null==tsInstitutionMap.get(importExcelDTO.getUnit())){
|
if (null==tsInstitutionMap.get(importExcelDTO.getUnitName())){
|
||||||
stringBuilder.append("第"+i+"行第4列起草责任单位填写不符合格式要求请检查;");
|
stringBuilder.append("第"+i+"行第4列起草责任单位填写不符合格式要求请检查;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-13
@@ -61,6 +61,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.sql.Clob;
|
import java.sql.Clob;
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -550,18 +551,30 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
map.put("standEnName",verifyObj(sarStandardsInfoEO.getStandEnName()));
|
map.put("standEnName",verifyObj(sarStandardsInfoEO.getStandEnName()));
|
||||||
map.put("standNature",verifyObj(sarStandardsInfoEO.getStandNature()));
|
map.put("standNature",verifyObj(sarStandardsInfoEO.getStandNature()));
|
||||||
map.put("standState",verifyObj(sarStandardsInfoEO.getStandStatus()));
|
map.put("standState",verifyObj(sarStandardsInfoEO.getStandStatus()));
|
||||||
// if (sarStandardsInfoEO.getIssueTime() != null) {
|
if (sarStandardsInfoEO.getIssueTime() != null) {
|
||||||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
// String issueStr = format.format(sarStandardsInfoEO.getIssueTime());
|
SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
// map.put("issueTime",issueStr);
|
String issueStr = "";
|
||||||
// }
|
try {
|
||||||
map.put("issueTime", verifyObj(sarStandardsInfoEO.getIssueTime()));
|
issueStr = format2.format(format.parse(sarStandardsInfoEO.getIssueTime()));
|
||||||
map.put("putTime", verifyObj(sarStandardsInfoEO.getPutTime()));
|
}catch (Exception e){
|
||||||
// if (sarStandardsInfoEO.getPutTime() != null) {
|
}
|
||||||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
map.put("issueTime",issueStr);
|
||||||
// String issueStr = format.format(sarStandardsInfoEO.getPutTime());
|
}else{
|
||||||
// map.put("putTime",issueStr);
|
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("replaceStandNum",sarStandardsInfoEO.getReplaceStandNum());
|
||||||
map.put("replacedStandNum",sarStandardsInfoEO.getReplacedStandNum());
|
map.put("replacedStandNum",sarStandardsInfoEO.getReplacedStandNum());
|
||||||
return map;
|
return map;
|
||||||
@@ -822,7 +835,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
convert.setFileSuffix(fileInfo.getFileSuffix());
|
convert.setFileSuffix(fileInfo.getFileSuffix());
|
||||||
convert.setStandFileClassify(field);
|
convert.setStandFileClassify(field);
|
||||||
convert.setConvertType(SarTypeEnum.BUSINESS.getValue());
|
convert.setConvertType(SarTypeEnum.BUSINESS.getValue());
|
||||||
convertMq.sendMQ(convert);
|
// convertMq.sendMQ(convert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-18
@@ -151,12 +151,12 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
qw.isNull("PARENT_ID");
|
qw.isNull("PARENT_ID");
|
||||||
List<TsResource> children = iTsResourceService.list(qw);
|
List<TsResource> children = iTsResourceService.list(qw);
|
||||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||||
List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
|
// List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
|
||||||
if (!getMenuIdList.isEmpty()) {
|
// if (!getMenuIdList.isEmpty()) {
|
||||||
page.setMenuRoleList(getMenuIdList);
|
// page.setMenuRoleList(getMenuIdList);
|
||||||
} else {
|
// } else {
|
||||||
page.setMenuRoleList(null);
|
// page.setMenuRoleList(null);
|
||||||
}
|
// }
|
||||||
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
||||||
if (ids != null && !ids.isEmpty()) {
|
if (ids != null && !ids.isEmpty()) {
|
||||||
page.setMenuAllChildrenIdList(ids);
|
page.setMenuAllChildrenIdList(ids);
|
||||||
@@ -180,12 +180,12 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
qw.isNull("PARENT_ID");
|
qw.isNull("PARENT_ID");
|
||||||
List<TsResource> children = iTsResourceService.list(qw);
|
List<TsResource> children = iTsResourceService.list(qw);
|
||||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||||
List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
|
// List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
|
||||||
if (!getMenuIdList.isEmpty()) {
|
// if (!getMenuIdList.isEmpty()) {
|
||||||
page.setMenuRoleList(getMenuIdList);
|
// page.setMenuRoleList(getMenuIdList);
|
||||||
} else {
|
// } else {
|
||||||
page.setMenuRoleList(null);
|
// page.setMenuRoleList(null);
|
||||||
}
|
// }
|
||||||
List<String> ids = iTsResourceService.getChildMenuList(userId);
|
List<String> ids = iTsResourceService.getChildMenuList(userId);
|
||||||
if (ids != null && !ids.isEmpty()) {
|
if (ids != null && !ids.isEmpty()) {
|
||||||
page.setMenuAllChildrenIdList(ids);
|
page.setMenuAllChildrenIdList(ids);
|
||||||
@@ -429,12 +429,12 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
qw.isNull("PARENT_ID");
|
qw.isNull("PARENT_ID");
|
||||||
List<TsResource> children = iTsResourceService.list(qw);
|
List<TsResource> children = iTsResourceService.list(qw);
|
||||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||||
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
// List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
// if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||||
page.setMenuRoleList(getMenuIdList);
|
// page.setMenuRoleList(getMenuIdList);
|
||||||
} else {
|
// } else {
|
||||||
page.setMenuRoleList(null);
|
// page.setMenuRoleList(null);
|
||||||
}
|
// }
|
||||||
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
||||||
if (ids != null && !ids.isEmpty()) {
|
if (ids != null && !ids.isEmpty()) {
|
||||||
page.setMenuAllChildrenIdList(ids);
|
page.setMenuAllChildrenIdList(ids);
|
||||||
|
|||||||
+77
-77
@@ -1,77 +1,77 @@
|
|||||||
package com.adc.da.slrs.sarPosition.controller;
|
package com.adc.da.slrs.sarPosition.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import com.adc.da.base.web.BaseController;
|
import com.adc.da.base.web.BaseController;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author zyl
|
* @author zyl
|
||||||
* @since 2021-06-23
|
* @since 2021-06-23
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "|岗位管理|")
|
@Api(tags = "|岗位管理|")
|
||||||
@RequestMapping("/api/sarPosition/position")
|
@RequestMapping("/api/sarPosition/position")
|
||||||
public class TsPositionController extends BaseController<TsPosition> {
|
public class TsPositionController extends BaseController<TsPosition> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ITsPositionService tsPositionService;
|
private ITsPositionService tsPositionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询岗位(可通过name筛选)
|
* 查询岗位(可通过name筛选)
|
||||||
* @param tsPosition:筛选信息
|
* @param tsPosition:筛选信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询岗位")
|
@ApiOperation("查询岗位")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResponseMessage<IPage<TsPosition>> getPosition(TsPosition tsPosition){
|
public ResponseMessage<IPage<TsPosition>> getPosition(TsPosition tsPosition){
|
||||||
IPage<TsPosition> positions=tsPositionService.getPosition(tsPosition);
|
IPage<TsPosition> positions=tsPositionService.getPosition(tsPosition);
|
||||||
return Result.success(positions);
|
return Result.success(positions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增岗位")
|
@ApiOperation("新增岗位")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResponseMessage<Object> addPosition(@Validated(TsPosition.insert.class) TsPosition tsPosition){
|
public ResponseMessage<Object> addPosition(@Validated(TsPosition.insert.class) TsPosition tsPosition){
|
||||||
return tsPositionService.addPosition(tsPosition);
|
return tsPositionService.addPosition(tsPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("配置角色")
|
@ApiOperation("配置角色")
|
||||||
@PostMapping("/role")
|
@PostMapping("/role")
|
||||||
public ResponseMessage<List<TsRole>> setRole(@Valid @RequestBody TsPositionRoleVO tsPositionRoleVO){
|
public ResponseMessage<List<TsRole>> setRole(@Valid @RequestBody TsPositionRoleVO tsPositionRoleVO){
|
||||||
return tsPositionService.setRole(tsPositionRoleVO);
|
return tsPositionService.setRole(tsPositionRoleVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询角色")
|
@ApiOperation("查询角色")
|
||||||
@GetMapping("/role")
|
@GetMapping("/role")
|
||||||
public ResponseMessage<List<TsRole>> getRole(@RequestParam String positionId){
|
public ResponseMessage<List<TsRole>> getRole(@RequestParam String positionId){
|
||||||
List<TsRole> roles=tsPositionService.getRole(positionId);
|
List<TsRole> roles=tsPositionService.getRole(positionId);
|
||||||
return Result.success(roles);
|
return Result.success(roles);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("编辑岗位")
|
@ApiOperation("编辑岗位")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public ResponseMessage<Object> updatePosition(@Validated(TsPosition.update.class) TsPosition tsPosition){
|
public ResponseMessage<Object> updatePosition(@Validated(TsPosition.update.class) TsPosition tsPosition){
|
||||||
return tsPositionService.updatePosition(tsPosition);
|
return tsPositionService.updatePosition(tsPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除岗位")
|
@ApiOperation("删除岗位")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseMessage<Object> deletePosition(@RequestParam String positionId){
|
public ResponseMessage<Object> deletePosition(@RequestParam String positionId){
|
||||||
return tsPositionService.deletePosition(positionId);
|
return tsPositionService.deletePosition(positionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,95 +1,97 @@
|
|||||||
package com.adc.da.slrs.sarPosition.entity;
|
package com.adc.da.slrs.sarPosition.entity;
|
||||||
|
|
||||||
import com.adc.da.base.entity.BaseEntity;
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author zyl
|
* @author zyl
|
||||||
* @since 2021-06-23
|
* @since 2021-06-23
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value="TsPosition对象", description="")
|
@ApiModel(value="TsPosition对象", description="")
|
||||||
public class TsPosition extends BaseEntity {
|
public class TsPosition extends BaseEntity {
|
||||||
public interface insert{
|
public interface insert{
|
||||||
}
|
}
|
||||||
public interface update{
|
public interface update{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "操作时间")
|
@ApiModelProperty(value = "操作时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Timestamp operateTime;
|
private Timestamp operateTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "操作人")
|
@ApiModelProperty(value = "操作人")
|
||||||
private String operator;
|
private String operator;
|
||||||
|
|
||||||
@NotNull(message = "name不能为空",groups = {insert.class})
|
@NotNull(message = "name不能为空",groups = {insert.class})
|
||||||
@ApiModelProperty(value = "岗位名称")
|
@ApiModelProperty(value = "岗位名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建部门ID")
|
@ApiModelProperty(value = "创建部门ID")
|
||||||
private String createDeptId;
|
private String createDeptId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建人ID")
|
@ApiModelProperty(value = "创建人ID")
|
||||||
private String createById;
|
private String createById;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型(1为导入,2为新建)")
|
@ApiModelProperty(value = "类型(1为导入,2为新建)")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@NotNull(message = "id不能为空",groups = {update.class})
|
@NotNull(message = "id不能为空",groups = {update.class})
|
||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
@TableId(value = "id",type = IdType.UUID)
|
@TableId(value = "id",type = IdType.UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "绑定角色")
|
@ApiModelProperty(value = "绑定角色")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<TsRole> roles;
|
private List<TsRole> roles;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<TsUser> tsUser;
|
private List<TsUser> tsUser;
|
||||||
|
|
||||||
@ApiModelProperty(value = "操作人中文")
|
@ApiModelProperty(value = "操作人中文")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String uname;
|
private String uname;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Timestamp createTime;
|
private Timestamp createTime;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer current;
|
private Integer current;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer total;
|
private Integer total;
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+17
-15
@@ -1,15 +1,17 @@
|
|||||||
package com.adc.da.slrs.sarPosition.entity;
|
package com.adc.da.slrs.sarPosition.entity;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TsPositionRoleVO {
|
public class TsPositionRoleVO {
|
||||||
@NotNull(message = "positionId不能为空")
|
@NotNull(message = "positionId不能为空")
|
||||||
private String positionId;
|
private String positionId;
|
||||||
@NotNull(message = "roleIds不能为空")
|
@NotNull(message = "roleIds不能为空")
|
||||||
private List<String> roleIds;
|
private List<String> roleIds;
|
||||||
}
|
|
||||||
|
private String operator;
|
||||||
|
}
|
||||||
|
|||||||
+77
-77
@@ -1,77 +1,77 @@
|
|||||||
package com.adc.da.slrs.sarPosition.service;
|
package com.adc.da.slrs.sarPosition.service;
|
||||||
|
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务类
|
* 服务类
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author zyl
|
* @author zyl
|
||||||
* @since 2021-06-23
|
* @since 2021-06-23
|
||||||
*/
|
*/
|
||||||
public interface ITsPositionService extends IService<TsPosition> {
|
public interface ITsPositionService extends IService<TsPosition> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询岗位
|
* 查询岗位
|
||||||
* @param tsPosition:查询信息
|
* @param tsPosition:查询信息
|
||||||
* @return List<TsPosition>
|
* @return List<TsPosition>
|
||||||
*/
|
*/
|
||||||
IPage<TsPosition> getPosition(TsPosition tsPosition);
|
IPage<TsPosition> getPosition(TsPosition tsPosition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置角色
|
* 配置角色
|
||||||
* @param tsPositionRoleVO :角色ID
|
* @param tsPositionRoleVO :角色ID
|
||||||
* @return ResponseMessage<Object>
|
* @return ResponseMessage<Object>
|
||||||
*/
|
*/
|
||||||
ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO);
|
ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询角色
|
* 查询角色
|
||||||
* @param positionId :岗位ID
|
* @param positionId :岗位ID
|
||||||
* @return List<TsRole>
|
* @return List<TsRole>
|
||||||
*/
|
*/
|
||||||
List<TsRole> getRole(String positionId);
|
List<TsRole> getRole(String positionId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加岗位
|
* 添加岗位
|
||||||
* @param tsPosition:岗位信息
|
* @param tsPosition:岗位信息
|
||||||
* @return ResponseMessage<Object>
|
* @return ResponseMessage<Object>
|
||||||
*/
|
*/
|
||||||
ResponseMessage<Object> addPosition(TsPosition tsPosition);
|
ResponseMessage<Object> addPosition(TsPosition tsPosition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改岗位
|
* 修改岗位
|
||||||
* @param tsPosition:岗位信息
|
* @param tsPosition:岗位信息
|
||||||
* @return ResponseMessage<Object>
|
* @return ResponseMessage<Object>
|
||||||
*/
|
*/
|
||||||
ResponseMessage<Object> updatePosition(TsPosition tsPosition);
|
ResponseMessage<Object> updatePosition(TsPosition tsPosition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除岗位
|
* 删除岗位
|
||||||
* @param positionId:岗位ID
|
* @param positionId:岗位ID
|
||||||
* @return ResponseMessage<Object>
|
* @return ResponseMessage<Object>
|
||||||
*/
|
*/
|
||||||
ResponseMessage<Object> deletePosition(String positionId);
|
ResponseMessage<Object> deletePosition(String positionId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位列表查询绑定的角色列表
|
* 通过岗位列表查询绑定的角色列表
|
||||||
* @param positionIds:岗位列表
|
* @param positionIds:岗位列表
|
||||||
* @return List<String>
|
* @return List<String>
|
||||||
*/
|
*/
|
||||||
List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
List<String> getRoleIdsByPositionIds(List<String> positionIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过roleId查询岗位ID列表
|
* 通过roleId查询岗位ID列表
|
||||||
* @param roleId:角色ID
|
* @param roleId:角色ID
|
||||||
* @return List<String>
|
* @return List<String>
|
||||||
*/
|
*/
|
||||||
List<String> getPositionIdsByRoleId(String roleId);
|
List<String> getPositionIdsByRoleId(String roleId);
|
||||||
}
|
}
|
||||||
|
|||||||
+194
-182
@@ -1,182 +1,194 @@
|
|||||||
package com.adc.da.slrs.sarPosition.service.impl;
|
package com.adc.da.slrs.sarPosition.service.impl;
|
||||||
|
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||||
import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
|
import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
import com.adc.da.slrs.sarPosition.entity.TsPositionRoleVO;
|
||||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||||
import com.adc.da.slrs.sarRole.entity.TsRole;
|
import com.adc.da.slrs.sarRole.entity.TsRole;
|
||||||
import com.adc.da.utils.util.ListUtil;
|
import com.adc.da.utils.util.ListUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import javax.management.relation.Role;
|
|
||||||
import javax.xml.crypto.Data;
|
import javax.management.relation.Role;
|
||||||
import java.sql.Timestamp;
|
import javax.xml.crypto.Data;
|
||||||
import java.util.Date;
|
import java.sql.Timestamp;
|
||||||
import java.util.List;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
/**
|
|
||||||
* <p>
|
/**
|
||||||
* 服务实现类
|
* <p>
|
||||||
* </p>
|
* 服务实现类
|
||||||
*
|
* </p>
|
||||||
* @author zyl
|
*
|
||||||
* @since 2021-06-23
|
* @author zyl
|
||||||
*/
|
* @since 2021-06-23
|
||||||
@Service
|
*/
|
||||||
public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition> implements ITsPositionService {
|
@Service
|
||||||
@Autowired
|
public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition> implements ITsPositionService {
|
||||||
private TsPositionDao tsPositionDao;
|
@Autowired
|
||||||
|
private TsPositionDao tsPositionDao;
|
||||||
/**
|
|
||||||
* 查询岗位
|
/**
|
||||||
* @param tsPosition:查询信息
|
* 查询岗位
|
||||||
* @return List<TsPosition>
|
* @param tsPosition:查询信息
|
||||||
*/
|
* @return List<TsPosition>
|
||||||
@Override
|
*/
|
||||||
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
@Override
|
||||||
IPage page=new Page();
|
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
||||||
// page.setTotal(tsPositionDao.pageTotal());
|
IPage page=new Page();
|
||||||
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
|
// page.setTotal(tsPositionDao.pageTotal());
|
||||||
List<TsPosition> list = tsPositionDao.selectPositionAndRole(tsPosition);
|
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
|
||||||
for (TsPosition tsPositions:list){
|
List<TsPosition> list = tsPositionDao.selectPositionAndRole(tsPosition);
|
||||||
tsPositions.getTsUser().forEach(res->{
|
for (TsPosition tsPositions:list){
|
||||||
tsPositions.setOperator(res.getUname());
|
tsPositions.getTsUser().forEach(res->{
|
||||||
});
|
tsPositions.setOperator(res.getUname());
|
||||||
}
|
});
|
||||||
page.setRecords(list);
|
}
|
||||||
page.setTotal(page.getTotal());
|
page.setRecords(list);
|
||||||
page.setCurrent(tsPosition.getCurrent());
|
page.setTotal(page.getTotal());
|
||||||
page.setSize(tsPosition.getPageSize());
|
page.setCurrent(tsPosition.getCurrent());
|
||||||
System.out.println(page.getTotal());
|
page.setSize(tsPosition.getPageSize());
|
||||||
|
System.out.println(page.getTotal());
|
||||||
return page;
|
|
||||||
}
|
return page;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 配置角色
|
/**
|
||||||
* @param tsPositionRoleVO :角色ID
|
* 配置角色
|
||||||
* @return ResponseMessage<Object>
|
* @param tsPositionRoleVO :角色ID
|
||||||
*/
|
* @return ResponseMessage<Object>
|
||||||
@Override
|
*/
|
||||||
@Transactional
|
@Override
|
||||||
public ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO) {
|
@Transactional
|
||||||
TsPosition position=tsPositionDao.selectById(tsPositionRoleVO.getPositionId());
|
public ResponseMessage<List<TsRole>> setRole(TsPositionRoleVO tsPositionRoleVO) {
|
||||||
if(position==null){
|
TsPosition position=tsPositionDao.selectById(tsPositionRoleVO.getPositionId());
|
||||||
return Result.error("该岗位不存在");
|
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> oldRoleIds=tsPositionDao.getRoleId(tsPositionRoleVO.getPositionId());
|
||||||
List<String> insertIds=updateRoleIds.get("insert");
|
Map<String,List<String>> updateRoleIds= ListUtil.difList(tsPositionRoleVO.getRoleIds(),oldRoleIds);
|
||||||
List<String> deleteIds=updateRoleIds.get("delete");
|
List<String> insertIds=updateRoleIds.get("insert");
|
||||||
for(String id:insertIds){
|
List<String> deleteIds=updateRoleIds.get("delete");
|
||||||
tsPositionDao.insertRole(tsPositionRoleVO.getPositionId(),id);
|
TsPosition tsPosition = new TsPosition();
|
||||||
}
|
UpdateWrapper<TsPosition> updateWrapper = new UpdateWrapper<>();
|
||||||
for(String id:deleteIds){
|
for(String id:insertIds){
|
||||||
tsPositionDao.deleteRole(tsPositionRoleVO.getPositionId(),id);
|
tsPositionDao.insertRole(tsPositionRoleVO.getPositionId(),id);
|
||||||
}
|
updateWrapper.eq("id", tsPositionRoleVO.getPositionId());
|
||||||
List<TsRole> roles=getRole(tsPositionRoleVO.getPositionId());
|
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
return Result.success(roles);
|
tsPosition.setOperator(tsPositionRoleVO.getOperator());
|
||||||
}
|
baseMapper.update(tsPosition,updateWrapper);
|
||||||
|
}
|
||||||
/**
|
for(String id:deleteIds){
|
||||||
* 查询角色
|
tsPositionDao.deleteRole(tsPositionRoleVO.getPositionId(),id);
|
||||||
* @param positionId :岗位ID
|
updateWrapper.eq("id", tsPositionRoleVO.getPositionId());
|
||||||
* @return List<TsRole>
|
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
*/
|
tsPosition.setOperator(tsPositionRoleVO.getOperator());
|
||||||
@Override
|
baseMapper.update(tsPosition,updateWrapper);
|
||||||
public List<TsRole> getRole(String positionId) {
|
}
|
||||||
return tsPositionDao.getRole(positionId);
|
List<TsRole> roles=getRole(tsPositionRoleVO.getPositionId());
|
||||||
}
|
return Result.success(roles);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 添加岗位
|
/**
|
||||||
* @param tsPosition:岗位信息
|
* 查询角色
|
||||||
* @return ResponseMessage<Object>
|
* @param positionId :岗位ID
|
||||||
*/
|
* @return List<TsRole>
|
||||||
@Override
|
*/
|
||||||
public ResponseMessage<Object> addPosition(TsPosition tsPosition) {
|
@Override
|
||||||
QueryWrapper<TsPosition> positionQueryWrapper=new QueryWrapper<>();
|
public List<TsRole> getRole(String positionId) {
|
||||||
positionQueryWrapper.eq("name",tsPosition.getName());
|
return tsPositionDao.getRole(positionId);
|
||||||
List<TsPosition> tsPositions=tsPositionDao.selectList(positionQueryWrapper);
|
}
|
||||||
if(tsPositions!=null&&tsPositions.size()>0){
|
|
||||||
return Result.error("该岗位已存在");
|
/**
|
||||||
}
|
* 添加岗位
|
||||||
//设置操作时间为当前系统时间
|
* @param tsPosition:岗位信息
|
||||||
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
* @return ResponseMessage<Object>
|
||||||
tsPosition.setType("2");
|
*/
|
||||||
tsPositionDao.insert(tsPosition);
|
@Override
|
||||||
return Result.success();
|
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){
|
||||||
* @param tsPosition:岗位信息
|
return Result.error("该岗位已存在");
|
||||||
* @return ResponseMessage<Object>
|
}
|
||||||
*/
|
//设置操作时间为当前系统时间
|
||||||
@Override
|
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
public ResponseMessage<Object> updatePosition(TsPosition tsPosition) {
|
tsPosition.setType("2");
|
||||||
TsPosition oldPosition=tsPositionDao.selectById(tsPosition.getId());
|
tsPositionDao.insert(tsPosition);
|
||||||
if(oldPosition==null){
|
return Result.success();
|
||||||
return Result.error("该岗位不存在");
|
}
|
||||||
}
|
|
||||||
if(!oldPosition.getType().equals("2")){
|
/**
|
||||||
return Result.error("该岗位不可修改");
|
* 修改岗位
|
||||||
}
|
* @param tsPosition:岗位信息
|
||||||
tsPositionDao.updateById(tsPosition);
|
* @return ResponseMessage<Object>
|
||||||
return Result.success();
|
*/
|
||||||
}
|
@Override
|
||||||
|
public ResponseMessage<Object> updatePosition(TsPosition tsPosition) {
|
||||||
/**
|
TsPosition oldPosition=tsPositionDao.selectById(tsPosition.getId());
|
||||||
* 删除岗位
|
if(oldPosition==null){
|
||||||
* @param positionId:岗位ID
|
return Result.error("该岗位不存在");
|
||||||
* @return ResponseMessage<Object>
|
}
|
||||||
*/
|
if(!oldPosition.getType().equals("2")){
|
||||||
@Override
|
return Result.error("该岗位不可修改");
|
||||||
public ResponseMessage<Object> deletePosition(String positionId) {
|
}
|
||||||
TsPosition oldPosition=tsPositionDao.selectById(positionId);
|
tsPosition.setOperateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
if(oldPosition==null){
|
tsPositionDao.updateById(tsPosition);
|
||||||
return Result.error("该岗位不存在");
|
return Result.success();
|
||||||
}
|
}
|
||||||
if(!oldPosition.getType().equals("2")){
|
|
||||||
return Result.error("该岗位不可删除");
|
/**
|
||||||
}
|
* 删除岗位
|
||||||
List<String> roleIds=tsPositionDao.getRoleId(positionId);
|
* @param positionId:岗位ID
|
||||||
if(roleIds!=null&&roleIds.size()>0){
|
* @return ResponseMessage<Object>
|
||||||
return Result.error("该岗位已绑定角色,无法删除");
|
*/
|
||||||
}
|
@Override
|
||||||
tsPositionDao.deleteById(positionId);
|
public ResponseMessage<Object> deletePosition(String positionId) {
|
||||||
return Result.success();
|
TsPosition oldPosition=tsPositionDao.selectById(positionId);
|
||||||
}
|
if(oldPosition==null){
|
||||||
|
return Result.error("该岗位不存在");
|
||||||
/**
|
}
|
||||||
* 通过岗位列表查询绑定的角色列表
|
if(!oldPosition.getType().equals("2")){
|
||||||
* @param positionIds:岗位列表
|
return Result.error("该岗位不可删除");
|
||||||
* @return List<String>
|
}
|
||||||
*/
|
List<String> roleIds=tsPositionDao.getRoleId(positionId);
|
||||||
@Override
|
if(roleIds!=null&&roleIds.size()>0){
|
||||||
public List<String> getRoleIdsByPositionIds(List<String> positionIds) {
|
return Result.error("该岗位已绑定角色,无法删除");
|
||||||
if(positionIds!=null&&positionIds.size()>0){
|
}
|
||||||
return tsPositionDao.getRoleIdsByPositionIds(positionIds);
|
tsPositionDao.deleteById(positionId);
|
||||||
}
|
return Result.success();
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 通过岗位列表查询绑定的角色列表
|
||||||
* 通过roleId查询岗位ID列表
|
* @param positionIds:岗位列表
|
||||||
* @param roleId:角色ID
|
* @return List<String>
|
||||||
* @return List<String>
|
*/
|
||||||
*/
|
@Override
|
||||||
@Override
|
public List<String> getRoleIdsByPositionIds(List<String> positionIds) {
|
||||||
public List<String> getPositionIdsByRoleId(String roleId) {
|
if(positionIds!=null&&positionIds.size()>0){
|
||||||
return tsPositionDao.getPositionIdsByRoleId(roleId);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+21
@@ -3,12 +3,16 @@ package com.adc.da.slrs.sarStandIdea.controller;
|
|||||||
|
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
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.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.ISarPublicIdeaService;
|
||||||
import com.adc.da.slrs.sarStandIdea.service.Impl.SarPublicIdeaServiceImpl;
|
import com.adc.da.slrs.sarStandIdea.service.Impl.SarPublicIdeaServiceImpl;
|
||||||
import com.adc.da.sys.util.DateUtil;
|
import com.adc.da.sys.util.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
|
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
|
||||||
@@ -36,6 +40,9 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISarPublicIdeaService sarPublicIdeaService;
|
private ISarPublicIdeaService sarPublicIdeaService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarPublicIdeaAllService sarPublicIdeaAllService;
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询")
|
@ApiOperation(value = "分页查询")
|
||||||
@GetMapping("/SelectAllPage")
|
@GetMapping("/SelectAllPage")
|
||||||
public ResponseMessage selectAllPage(@RequestParam(defaultValue="1")Integer page,@RequestParam(defaultValue="10")Integer size,String categorg, String cname,
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -280,6 +280,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
|||||||
Integer count=dao.sarItemCount(page);
|
Integer count=dao.sarItemCount(page);
|
||||||
page.getPager().setRowCount(count);
|
page.getPager().setRowCount(count);
|
||||||
List<SarStandItems> sarStandItems = dao.querySarItemAndInterpretation(page);
|
List<SarStandItems> sarStandItems = dao.querySarItemAndInterpretation(page);
|
||||||
|
sarStandItems.forEach(sarStandItems1 -> sarStandItems1.setTermsConditions(StringUtils.replace(sarStandItems1.getTermsConditions(),"''","'")));
|
||||||
return sarStandItems;
|
return sarStandItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -69,6 +69,12 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
|
|
||||||
head.setBIZTRANSACTIONID(HEAD.get("BIZTRANSACTIONID").getAsString());
|
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
|
//LIST是数组,所以强转成JSONArray
|
||||||
JsonArray LIST = (JsonArray) jsonObject.get("LIST");
|
JsonArray LIST = (JsonArray) jsonObject.get("LIST");
|
||||||
@@ -105,13 +111,15 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
.setProjectEndDate(targetEndOn);
|
.setProjectEndDate(targetEndOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
projectInfo.setId(UUIDUtils.randomUUID20());
|
projectInfo.setId(UUIDUtils.randomUUID20());
|
||||||
QueryWrapper<SarStandProjectLibrary> updateCondition = new QueryWrapper<SarStandProjectLibrary>();
|
QueryWrapper<SarStandProjectLibrary> updateCondition = new QueryWrapper<SarStandProjectLibrary>();
|
||||||
updateCondition.eq("project_number",projectInfo.getProjectNumber());
|
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);
|
// .eq("project_start_date",targetBeginOn);
|
||||||
|
|
||||||
|
|
||||||
this.saveOrUpdate(projectInfo,updateCondition);
|
this.saveOrUpdate(projectInfo,updateCondition);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -55,8 +55,8 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
|
||||||
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||||
queryWrapper.select(" STAND_ID,ANY_VALUE(STAND_NUMBER) as STAND_NUMBER, STAND_NAME, STAND_TYPE");
|
queryWrapper.select(" STAND_ID,ANY_VALUE(STAND_NUMBER) as STAND_NUMBER, STAND_NAME, STAND_TYPE");
|
||||||
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
|
if (eo.getStandName() != null ) {
|
||||||
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
|
queryWrapper.like("STAND_NAME", eo.getStandName().replace(" ",""));
|
||||||
}
|
}
|
||||||
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
|
||||||
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
|
||||||
@@ -219,8 +219,7 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
|
|
||||||
for (SarStandardComplianceProductAssess s:sarStandardCompliance) {
|
for (SarStandardComplianceProductAssess s:sarStandardCompliance) {
|
||||||
if (null!=s.getStandardItem()) {
|
if (null!=s.getStandardItem()) {
|
||||||
String gos= StringUtils.replace(s.getStandardItem(),".",",");
|
String[] as=(s.getStandardItem()+",").split(",");
|
||||||
String[] as=(gos+",").split(",");
|
|
||||||
if (orderKey.contains(Integer.valueOf(as[0].trim().toString()))) {
|
if (orderKey.contains(Integer.valueOf(as[0].trim().toString()))) {
|
||||||
stringMap.get(Integer.valueOf(as[0].trim().toString())).add(s);
|
stringMap.get(Integer.valueOf(as[0].trim().toString())).add(s);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -233,7 +233,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
|||||||
// sarAdvanceSearchVO.setField("STAND_SYSTEM");
|
// 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)) {
|
if (StringUtils.isNotBlank(advanceStr)) {
|
||||||
page.setAdvanceSearchStr(advanceStr);
|
page.setAdvanceSearchStr(advanceStr);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -239,7 +239,7 @@ public class SarUpdLogServiceImpl extends ServiceImpl<SarUpdLogDao, SarUpdLog> i
|
|||||||
// case "country": return "适用区域";
|
// case "country": return "适用区域";
|
||||||
// case "isRelateAccess": return "重要度";
|
// case "isRelateAccess": return "重要度";
|
||||||
case "issueTime": return "发布日期";
|
case "issueTime": return "发布日期";
|
||||||
case "putTime": return "标准实施日期";
|
case "putTime": return "企标实施日期";
|
||||||
// case "standYear": return "标准年份";
|
// case "standYear": return "标准年份";
|
||||||
// case "standNature": return "标准性质";
|
// case "standNature": return "标准性质";
|
||||||
case "standEnName": return "英文名称";
|
case "standEnName": return "英文名称";
|
||||||
|
|||||||
@@ -1,26 +1,29 @@
|
|||||||
package com.adc.da.slrs.wgCommittee.dao;
|
package com.adc.da.slrs.wgCommittee.dao;
|
||||||
|
|
||||||
|
|
||||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import java.util.List;
|
|
||||||
|
import java.util.List;
|
||||||
/**
|
|
||||||
* <p>
|
/**
|
||||||
* 标准委员会 Mapper 接口
|
* <p>
|
||||||
* </p>
|
* 标准委员会 Mapper 接口
|
||||||
*
|
* </p>
|
||||||
* @author yzh
|
*
|
||||||
* @since 2022-03-10
|
* @author yzh
|
||||||
*/
|
* @since 2022-03-10
|
||||||
public interface WgCommitteeDao extends BaseMapper<WgCommittee> {
|
*/
|
||||||
|
public interface WgCommitteeDao extends BaseMapper<WgCommittee> {
|
||||||
List<WgCommitteeDTO> getData(WgCommittee wgCommittee);
|
|
||||||
Integer getDataCount(WgCommittee wgCommittee);
|
List<WgCommitteeDTO> getData(WgCommittee wgCommittee);
|
||||||
|
Integer getDataCount(WgCommittee wgCommittee);
|
||||||
List<WgCommitteeDTO> getDataWk(WgCommittee wgCommittee);
|
|
||||||
Integer getDataCountWk(WgCommittee wgCommittee);
|
List<WgCommitteeDTO> getDataWk(WgCommittee wgCommittee);
|
||||||
|
Integer getDataCountWk(WgCommittee wgCommittee);
|
||||||
}
|
|
||||||
|
String selectCommittor(@Param("str") List<String> str);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+97
-93
@@ -1,93 +1,97 @@
|
|||||||
package com.adc.da.slrs.wgCommittee.service.impl;
|
package com.adc.da.slrs.wgCommittee.service.impl;
|
||||||
|
|
||||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||||
import com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao;
|
import com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao;
|
||||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||||
import com.adc.da.slrs.wgCommittee.service.IWgCommitteeService;
|
import com.adc.da.slrs.wgCommittee.service.IWgCommitteeService;
|
||||||
import com.adc.da.slrs.wgCommitteeUser.entity.WgCommitteeUser;
|
import com.adc.da.slrs.wgCommitteeUser.entity.WgCommitteeUser;
|
||||||
import com.adc.da.slrs.wgCommitteeUser.service.IWgCommitteeUserService;
|
import com.adc.da.slrs.wgCommitteeUser.service.IWgCommitteeUserService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
/**
|
||||||
import java.util.UUID;
|
* <p>
|
||||||
|
* 标准委员会 服务实现类
|
||||||
/**
|
* </p>
|
||||||
* <p>
|
*
|
||||||
* 标准委员会 服务实现类
|
* @author yzh
|
||||||
* </p>
|
* @since 2022-03-10
|
||||||
*
|
*/
|
||||||
* @author yzh
|
@Service
|
||||||
* @since 2022-03-10
|
public class WgCommitteeServiceImpl extends ServiceImpl<WgCommitteeDao, WgCommittee> implements IWgCommitteeService {
|
||||||
*/
|
|
||||||
@Service
|
@Autowired
|
||||||
public class WgCommitteeServiceImpl extends ServiceImpl<WgCommitteeDao, WgCommittee> implements IWgCommitteeService {
|
IWgCommitteeUserService iWgCommitteeUserService;
|
||||||
|
@Autowired
|
||||||
@Autowired
|
IWgCommitteeService iWgCommitteeService;
|
||||||
IWgCommitteeUserService iWgCommitteeUserService;
|
@Autowired
|
||||||
@Autowired
|
WgCommitteeDao wgCommitteeDao;
|
||||||
IWgCommitteeService iWgCommitteeService;
|
|
||||||
@Autowired
|
@Transactional
|
||||||
WgCommitteeDao wgCommitteeDao;
|
@Override
|
||||||
|
public boolean add(WgCommittee wgCommittee) {
|
||||||
@Transactional
|
wgCommittee.setId(String.valueOf(UUID.randomUUID()));
|
||||||
@Override
|
String id=String.valueOf(UUID.randomUUID());
|
||||||
public boolean add(WgCommittee wgCommittee) {
|
wgCommittee.setCommitteer(id);
|
||||||
wgCommittee.setId(String.valueOf(UUID.randomUUID()));
|
List<WgCommitteeUser> list=new ArrayList<>();
|
||||||
String id=String.valueOf(UUID.randomUUID());
|
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()) {
|
||||||
wgCommittee.setCommitteer(id);
|
List<String> res=new ArrayList<>(Collections.singletonList(wgCommittee.getCommitteeIds()));
|
||||||
List<WgCommitteeUser> list=new ArrayList<>();
|
res.stream().forEach(s -> list.add(new WgCommitteeUser().setCommitterId(s).setId(wgCommittee.getCommitteer())));
|
||||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()) {
|
iWgCommitteeUserService.saveOrUpdateBatch(list);
|
||||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
}
|
||||||
res.stream().forEach(s -> list.add(new WgCommitteeUser().setCommitterId(s).setId(wgCommittee.getCommitteer())));
|
if (iWgCommitteeService.saveOrUpdate(wgCommittee)) {
|
||||||
iWgCommitteeUserService.saveOrUpdateBatch(list);
|
return true;
|
||||||
}
|
}else {
|
||||||
if (iWgCommitteeService.saveOrUpdate(wgCommittee)) {
|
return false;
|
||||||
return true;
|
}
|
||||||
}else {
|
}
|
||||||
return false;
|
|
||||||
}
|
@Transactional
|
||||||
}
|
@Override
|
||||||
|
public boolean update(WgCommittee wgCommittee) {
|
||||||
@Transactional
|
iWgCommitteeService.updateById(wgCommittee);
|
||||||
@Override
|
List<WgCommitteeUser> save=new ArrayList<>();
|
||||||
public boolean update(WgCommittee wgCommittee) {
|
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()){
|
||||||
iWgCommitteeService.updateById(wgCommittee);
|
List<String> res=new ArrayList<>(Collections.singletonList(wgCommittee.getCommitteeIds()));
|
||||||
List<WgCommitteeUser> save=new ArrayList<>();
|
res.forEach(s ->
|
||||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()){
|
save.add(new WgCommitteeUser().setId(wgCommittee.getCommitteer()).setCommitterId(s))
|
||||||
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)) {
|
||||||
if (iWgCommitteeUserService.updateBatchById(save)) {
|
return true;
|
||||||
return true;
|
}else {
|
||||||
}else {
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
@Override
|
public IPage<WgCommitteeDTO> getWgCommittee(WgCommittee wgCommittee) {
|
||||||
public IPage<WgCommitteeDTO> getWgCommittee(WgCommittee wgCommittee) {
|
Page page=new Page();
|
||||||
Page page=new Page();
|
List<WgCommitteeDTO> list = wgCommitteeDao.getData(wgCommittee);
|
||||||
page.setRecords(wgCommitteeDao.getData(wgCommittee));
|
for (WgCommitteeDTO wgCommitteeDTO : list){
|
||||||
page.setCurrent(wgCommittee.getPage());
|
List<String> str = Arrays.asList(wgCommitteeDTO.getCommittorId().split(","));
|
||||||
page.setSize(wgCommittee.getPageSize());
|
wgCommitteeDTO.setCommittor(wgCommitteeDao.selectCommittor(str));
|
||||||
page.setTotal(wgCommitteeDao.getDataCount(wgCommittee));
|
}
|
||||||
return page;
|
page.setRecords(list);
|
||||||
}
|
page.setCurrent(wgCommittee.getPage());
|
||||||
|
page.setSize(wgCommittee.getPageSize());
|
||||||
@Override
|
page.setTotal(wgCommitteeDao.getDataCount(wgCommittee));
|
||||||
public IPage<WgCommitteeDTO> getWgCommitteeWk(WgCommittee wgCommittee) {
|
return page;
|
||||||
Page page=new Page();
|
}
|
||||||
page.setRecords(wgCommitteeDao.getDataWk(wgCommittee));
|
|
||||||
page.setCurrent(wgCommittee.getPage());
|
@Override
|
||||||
page.setSize(wgCommittee.getPageSize());
|
public IPage<WgCommitteeDTO> getWgCommitteeWk(WgCommittee wgCommittee) {
|
||||||
page.setTotal(wgCommitteeDao.getDataCountWk(wgCommittee));
|
Page page=new Page();
|
||||||
return 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":
|
case "BETWEEN":
|
||||||
String[] boundaryArray = searchVO.getValue().split(",");
|
String[] boundaryArray = searchVO.getValue().split(",");
|
||||||
if (i == 0) {
|
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 {
|
} 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;
|
break;
|
||||||
case "equals":
|
case "equals":
|
||||||
|
|||||||
@@ -1,69 +1,73 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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">
|
<mapper namespace="com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao">
|
||||||
|
|
||||||
<select id="getData" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
<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
|
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,
|
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
||||||
wg_committee.committeer ,
|
wg_committee.committeer , wg_committee_user.committer_id as committorId
|
||||||
(
|
from wg_committee
|
||||||
SELECT GROUP_CONCAT(t3.UNAME) FROM wg_committee_user
|
LEFT JOIN wg_committee_user ON wg_committee.committeer = wg_committee_user.id
|
||||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||||
WHERE wg_committee_user.id = wg_committee.committeer
|
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||||
) as committor,
|
where 1=1
|
||||||
(
|
<if test="committeeName != null and ''!=committeeName">
|
||||||
SELECT GROUP_CONCAT(t3.USID) FROM wg_committee_user
|
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
</if>
|
||||||
WHERE wg_committee_user.id = wg_committee.committeer
|
limit ${(page-1)*pageSize},${pageSize}
|
||||||
) as committorId
|
</select>
|
||||||
from wg_committee
|
|
||||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
<select id="getDataCount" resultType="java.lang.Integer">
|
||||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
SELECT count(wg_committee.id)
|
||||||
where 1=1
|
from wg_committee
|
||||||
<if test="committeeName != null and ''!=committeeName">
|
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||||
</if>
|
where 1=1
|
||||||
limit ${(page-1)*pageSize},${pageSize}
|
<if test="committeeName != null and ''!=committeeName">
|
||||||
</select>
|
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||||
|
</if>
|
||||||
<select id="getDataCount" resultType="java.lang.Integer">
|
</select>
|
||||||
SELECT count(wg_committee.id)
|
|
||||||
from wg_committee
|
<select id="getDataWk" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
||||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
|
||||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
||||||
where 1=1
|
t3.UNAME as committor,t3.USID as committorId,wg_committee.committeer ,
|
||||||
<if test="committeeName != null and ''!=committeeName">
|
from wg_committee
|
||||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||||
</if>
|
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||||
</select>
|
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
|
||||||
<select id="getDataWk" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
|
where 1=1
|
||||||
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
|
<if test="committeeName != null and ''!=committeeName">
|
||||||
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
|
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||||
t3.UNAME as committor,t3.USID as committorId,wg_committee.committeer ,
|
</if>
|
||||||
from wg_committee
|
limit ${(page-1)*pageSize},${pageSize}
|
||||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
</select>
|
||||||
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
|
<select id="getDataCountWk" resultType="java.lang.Integer">
|
||||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
SELECT count(wg_committee.id)
|
||||||
where 1=1
|
from wg_committee
|
||||||
<if test="committeeName != null and ''!=committeeName">
|
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
||||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
||||||
</if>
|
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
|
||||||
limit ${(page-1)*pageSize},${pageSize}
|
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
||||||
</select>
|
where 1=1
|
||||||
|
<if test="committeeName != null and ''!=committeeName">
|
||||||
<select id="getDataCountWk" resultType="java.lang.Integer">
|
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
||||||
SELECT count(wg_committee.id)
|
</if>
|
||||||
from wg_committee
|
</select>
|
||||||
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
|
<select id="selectCommittor" resultType="java.lang.String">
|
||||||
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
|
SELECT
|
||||||
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
|
group_concat( tu.UNAME SEPARATOR ',' ) as committor
|
||||||
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
|
FROM
|
||||||
where 1=1
|
ts_user tu
|
||||||
<if test="committeeName != null and ''!=committeeName">
|
WHERE
|
||||||
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
|
tu.USID
|
||||||
</if>
|
IN
|
||||||
</select>
|
<foreach collection="str" item="USID" open="(" close=")" separator=",">
|
||||||
|
<!-- 每个遍历需要生成的串 -->
|
||||||
</mapper>
|
#{USID}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user