Merge branch 'develop_3' into 'develop_master'

Develop 3

See merge request LiuChao/foton-slrs-system-rest!251
This commit is contained in:
super_liu
2021-11-26 08:58:00 +08:00
12 changed files with 334 additions and 50 deletions
@@ -31,5 +31,6 @@ public class WarningEO extends EarlyWarningEO {
private String standYear;
private String issueTime;
}
@@ -5,6 +5,7 @@ import com.adc.da.base.web.BaseController;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -41,7 +42,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
* @author zj
* date 2021-06-15
**/
@GetMapping("/StandWarning")
@GetMapping("/${restPath}/StandWarning")
@ApiOperation("标准预警查询")
public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize,
@RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize,
@@ -53,6 +54,16 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警
return getResponseMessage(list1, list2, list3, list4);
}
@GetMapping("/getStandWarning")
@ApiOperation("标准预警查询")
public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
return Result.success(standWarning);
}
private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) {
List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
Map<String, Object> map = new HashMap<String, Object>();
@@ -71,7 +82,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
* date 2021-06-15
**/
@GetMapping("/ChangePermissions")
@ApiOperation("更改权限")
@ApiOperation("取消预警")
public ResponseMessage ChangePermissions(String id) {
String power = earlyWarningEOService.ChangePermissions(id);
return Result.success("200",power);
@@ -2,14 +2,13 @@ package com.adc.da.slrs.sarStandWarning.dao;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
IPage<EarlyWarningEO> selectWarningPage(IPage<EarlyWarningEO> page, @Param(Constants.WRAPPER) QueryWrapper<EarlyWarningEO> queryWrapper);
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
}
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@@ -23,21 +25,27 @@ public class EarlyWarningEO extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableId("ID")
private String id;
@ApiModelProperty("标准id")
@TableField("STAND_ID")
private String standId;
@ApiModelProperty("标准类别")
@TableField("STAND_TYPE")
private String standType;
@ApiModelProperty("标准号")
@TableField("STAND_CODE")
private String standCode;
@ApiModelProperty("标准名称")
@TableField("STAND_NAME")
private String standName;
@ApiModelProperty("发布日期")
@TableField("PUT_TIME")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date putTime;
@@ -45,18 +53,23 @@ public class EarlyWarningEO extends BaseEntity {
@TableField(exist = false)
private Date lastTime;
@ApiModelProperty("适用车型")
@TableField("APPLY_TYPE")
private String applyType;
@ApiModelProperty("责任工程师")
@TableField("DUTY_ENGINEER")
private String dutyEngineer;
@ApiModelProperty("条款(分解单)id")
@TableField("ITEMS_ID")
private String itemsId;
@ApiModelProperty("条款(分解单)编号")
@TableField("ITEMS_NUM")
private String itemsNum;
@ApiModelProperty("条款(分解单)名称")
@TableField("ITEMS_NAME")
private String itemsName;
@@ -72,7 +85,6 @@ public class EarlyWarningEO extends BaseEntity {
@TableField("POWER")
private String power;
@TableField(exist = false)
private String issueTime;
}
@@ -0,0 +1,73 @@
package com.adc.da.slrs.sarStandWarning.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@Accessors(chain = true)
public class StandWarningEO extends EarlyWarningEO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("新车型实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String XCXSSRQ;
@ApiModelProperty("在产车实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String ZCCSSRQ;
@ApiModelProperty("实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String SSRQ;
private String standNum;
private String standSort;
private String standYear;
private String issueTime;
private Integer page;
private Integer pageSize;
@ApiModelProperty("范围查询新车型实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startXCXSSRQ;
@ApiModelProperty("范围查询新车型实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endXCXSSRQ;
@ApiModelProperty("范围查询在产车实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startZCCSSRQ;
@ApiModelProperty("范围查询在产车实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endZCCSSRQ;
@ApiModelProperty("范围查询实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startSSRQ;
@ApiModelProperty("范围查询实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endSSRQ;
@ApiModelProperty("范围查询发布日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startPutTime;
@ApiModelProperty("范围查询发布日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endPutTime;
}
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandWarning.service;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -16,4 +17,7 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
IPage<EarlyWarningEO> oldPolicyQuery(int current,int pageSize);
String batchSave(List<EarlyWarningEO> earlyWarningEOS);
String ChangePermissions(String id);
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
}
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarStandWarning.service.Impl;
import com.adc.da.scheduled.entity.DataDTO;
import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
import com.adc.da.sys.util.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -106,6 +107,17 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
}
return "更改成功";
}
/**
* 分页查询标准预警
* @return
*/
@Override
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
}
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
wrapper.eq("power",1);
Page<EarlyWarningEO> page = new Page<>(current, pageSize);
@@ -144,4 +156,8 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
wrapper.like("APPLY_TYPE", earlyWarningEO.getApplyType());
}
}
}
@@ -40,10 +40,10 @@ public class SarVppsTreeController extends BaseController<SarVppsTree> {
@ApiOperation("根据父ID查询子所有资源")
@GetMapping("/childByList")
public ResponseMessage<List<SarVppsTree>> childByList(String ids){
SarVppsTree tree = new SarVppsTree();
tree.setId(ids);
List<SarVppsTree> tsResources = iSarVppsTreeService.recursionGetChildren(tree);
public ResponseMessage<List<SarVppsTree>> childByList(SarVppsTree parent){
// SarVppsTree tree = new SarVppsTree();
// tree.setId(ids);
List<SarVppsTree> tsResources = iSarVppsTreeService.recursionGetChildren(parent);
return Result.success(tsResources);
}
@@ -13,7 +13,7 @@ import java.util.List;
/**
* <p>
*
*
* </p>
*
* @author super_liu
@@ -66,6 +66,15 @@ public class SarVppsTree extends BaseEntity {
@TableField(exist = false)
private String parentIdsName;
@ApiModelProperty("层级")
@TableField("LEVEL")
private Integer level;
@ApiModelProperty("类型")
@TableField("TYPE")
private String type;
@TableField(exist=false)
private List<String> roleIds;
@@ -27,8 +27,11 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
@Override
public List<SarVppsTree> getAll(SarVppsTree sarVppsTree) {
QueryWrapper<SarVppsTree> tsResourceQueryWrapper=new QueryWrapper<>();
tsResourceQueryWrapper.isNull("PID");
tsResourceQueryWrapper.eq("TYPE",sarVppsTree.getType())
.eq("LEVEL",0);
List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper);
list.forEach(item->item.setVppsCode("10"));
// for(SarVppsTree tree:list){
// tree.setChildren(recursionGetChildren((tree)));
// }
@@ -44,11 +47,14 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
public List<SarVppsTree> recursionGetChildren(SarVppsTree parent){
QueryWrapper<SarVppsTree> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.orderByAsc("SORT");
sarMenuQueryWrapper.in("PID",parent.getId());
// sarMenuQueryWrapper.in("PID",parent.getId());
sarMenuQueryWrapper.eq("LEVEL", parent.getLevel()+1)
.eq("TYPE",parent.getType())
.like("VPPS_CODE",parent.getVppsCode());
List<SarVppsTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
for(SarVppsTree sarMenu:children){
sarMenu.setChildren(recursionGetChildren((sarMenu)));
}
// for(SarVppsTree sarMenu:children){
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
// }
return children;
}
}