Browse Source

Merge pull request 'master' (#14) from master into V3

Reviewed-on: http://git.lrdaiot.cn:9000/thing/thing_api/pulls/14
qingyuan_dev_new
李帅 2 years ago
parent
commit
dca72d528e
  1. 47
      help/sql/ddl_1.0.0.sql
  2. 4
      modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleLogServiceImpl.java
  3. 9
      modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleServiceImpl.java
  4. 6
      modules/alarm/src/main/resources/mapper/AlarmRuleEntityMapper.xml
  5. 6
      modules/alarm/src/main/resources/mapper/AlarmRuleLogMapper.xml
  6. 49
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/PubCockpitController.java
  7. 34
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitEnterpriseInfo.java
  8. 20
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitStatisticsDto.java
  9. 13
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/PubCockpitMapper.java
  10. 11
      modules/carbon-public/src/main/java/com/thing/carbon/pub/service/PubCockpitService.java
  11. 42
      modules/carbon-public/src/main/java/com/thing/carbon/pub/service/impl/PubCockpitServiceImpl.java
  12. 2
      modules/carbon-public/src/main/resources/mapper/CarbonPubSupplierMapper.xml
  13. 39
      modules/carbon-public/src/main/resources/mapper/PubCockpitMapper.xml
  14. 29
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonConsumables/controller/CqcCarbonConsumablesController.java
  15. 36
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonConsumables/dto/CqcCarbonConsumablesDTO.java
  16. 36
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonConsumables/entity/CqcCarbonConsumablesEntity.java
  17. 12
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/controller/CqcCarbonDiscardController.java
  18. 36
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/dto/CqcCarbonDiscardDTO.java
  19. 36
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/entity/CqcCarbonDiscardEntity.java
  20. 6
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/service/impl/CqcCarbonDiscardServiceImpl.java
  21. 29
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDistribution/controller/CqcCarbonDistributionController.java
  22. 24
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDistribution/dto/CqcCarbonDistributionDTO.java
  23. 24
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDistribution/entity/CqcCarbonDistributionEntity.java
  24. 29
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonEnergy/controller/CqcCarbonEnergyController.java
  25. 20
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonEnergy/dto/CqcCarbonEnergyDTO.java
  26. 20
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonEnergy/entity/CqcCarbonEnergyEntity.java
  27. 29
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonMake/controller/CqcCarbonMakeController.java
  28. 18
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonMake/dto/CqcCarbonMakeDTO.java
  29. 18
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonMake/entity/CqcCarbonMakeEntity.java
  30. 29
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonRaw/controller/CqcCarbonRawController.java
  31. 36
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonRaw/dto/CqcCarbonRawDTO.java
  32. 36
      modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonRaw/entity/CqcCarbonRawEntity.java
  33. 17
      modules/cqc-service/src/main/java/com/thing/cqc/rpcService/JsonCryptoUtils.java
  34. 4
      modules/filter-rule/src/main/java/com/thing/filter/rule/dto/FilterRuleDetailDTO.java
  35. 7
      modules/filter-rule/src/main/java/com/thing/filter/rule/enumeration/DataType.java
  36. 57
      modules/thing/src/main/java/com/thing/thing/dict/service/impl/IotThingDictServiceImpl.java

47
help/sql/ddl_1.0.0.sql

@ -2018,6 +2018,53 @@ COMMENT ON COLUMN "public"."filter_rule"."updater" IS '更新人';
COMMENT ON COLUMN "public"."filter_rule"."update_date" IS '更新时间'; COMMENT ON COLUMN "public"."filter_rule"."update_date" IS '更新时间';
COMMENT ON TABLE "public"."filter_rule" IS '过滤规则表'; COMMENT ON TABLE "public"."filter_rule" IS '过滤规则表';
-- ----------------------------
-- Table structure for filter_rule_detail
-- ----------------------------
create table if not exists public.filter_rule_detail
(
id bigint primary key,
filter_rule_id bigint not null,
thing_name varchar(100),
thing_code varchar(100) not null,
attr_name varchar(100),
attr_code varchar(100) not null,
attr_alias varchar(10),
data_type integer,
agg_type varchar(10),
agg_interval integer,
timeunit varchar(20),
tenant_code bigint not null,
company_id bigint,
dept_id bigint,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.filter_rule_detail is '过滤规则详情表';
comment on column public.filter_rule_detail.id is '主键';
comment on column public.filter_rule_detail.filter_rule_id is '过滤规则id';
comment on column public.filter_rule_detail.thing_name is '物名称';
comment on column public.filter_rule_detail.thing_code is '物编码';
comment on column public.filter_rule_detail.attr_name is '属性名称';
comment on column public.filter_rule_detail.attr_code is '属性编码';
comment on column public.filter_rule_detail.attr_alias is '属性在计算公式中的别名';
comment on column public.filter_rule_detail.data_type is '数据类型:1-最新,2-最近, 3-区间';
comment on column public.filter_rule_detail.agg_type is '聚合类型:SUM|AVG|MAX|MIN|COUNT';
comment on column public.filter_rule_detail.agg_interval is '聚合时间间隔';
comment on column public.filter_rule_detail.timeunit is '聚合时间单位:MINUTE|HOUR|DAY|MONTH';
comment on column public.filter_rule_detail.tenant_code is '租户编码';
comment on column public.filter_rule_detail.company_id is '企业id';
comment on column public.filter_rule_detail.dept_id is '部门id';
comment on column public.filter_rule_detail.creator is '创建人';
comment on column public.filter_rule_detail.create_date is '创建时间';
comment on column public.filter_rule_detail.updater is '更新人';
comment on column public.filter_rule_detail.update_date is '更新时间';
-- ---------------------------- -- ----------------------------
-- Table structure for gateway_component -- Table structure for gateway_component
-- ---------------------------- -- ----------------------------

4
modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleLogServiceImpl.java

@ -17,6 +17,7 @@ import com.thing.alarm.configuration.event.LogSaveActionEvent;
import com.thing.common.core.enumeration.AlarmStatus; import com.thing.common.core.enumeration.AlarmStatus;
import com.thing.common.core.exception.SysException; import com.thing.common.core.exception.SysException;
import com.thing.common.core.utils.DateTimeUtils; import com.thing.common.core.utils.DateTimeUtils;
import com.thing.common.core.utils.PageUtils;
import com.thing.common.core.web.response.PageData; import com.thing.common.core.web.response.PageData;
import com.thing.common.orm.annotation.DataFilter; import com.thing.common.orm.annotation.DataFilter;
import com.thing.common.orm.service.impl.BaseServiceImpl; import com.thing.common.orm.service.impl.BaseServiceImpl;
@ -79,7 +80,8 @@ public class AlarmRuleLogServiceImpl extends BaseServiceImpl<AlarmRuleLogMapper,
} }
List<AlarmRuleLogDTO> list = mapper.getList(params); List<AlarmRuleLogDTO> list = mapper.getList(params);
fillExtraInfo(list); fillExtraInfo(list);
return new PageData<>(list, count);
List<AlarmRuleLogDTO> alarmRuleLogDTOS = PageUtils.startPage(list, page, limit);
return new PageData<>(alarmRuleLogDTOS, count);
} }
private List<String> getThingCodesByPlantIds(Map<String, Object> params) { private List<String> getThingCodesByPlantIds(Map<String, Object> params) {

9
modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleServiceImpl.java

@ -98,10 +98,17 @@ public class AlarmRuleServiceImpl extends BaseServiceImpl<AlarmRuleMapper, Alarm
private void getIdByThingName(Map<String, Object> params) { private void getIdByThingName(Map<String, Object> params) {
String thingName = (String) params.get("thingName"); String thingName = (String) params.get("thingName");
if (StringUtils.isBlank(thingName)) {
String thingId = (String) params.get("thingId");
if (StringUtils.isBlank(thingName) && StringUtils.isBlank(thingId)) {
return; return;
} }
if (StringUtils.isNotBlank(thingName)) {
paramsToLike(params, "thingName"); paramsToLike(params, "thingName");
}
if (StringUtils.isNotBlank(thingId)) {
List<Long> thingList = Arrays.stream(thingId.split(",")).map(Long::parseLong).toList();
params.put("thingIds", thingList);
}
List<AlarmRuleEntityDTO> list = alarmRuleEntityService.getThingNameList(params); List<AlarmRuleEntityDTO> list = alarmRuleEntityService.getThingNameList(params);
List<Long> collect = list.stream().map(AlarmRuleEntityDTO::getRuleId).distinct().collect(Collectors.toList()); List<Long> collect = list.stream().map(AlarmRuleEntityDTO::getRuleId).distinct().collect(Collectors.toList());
params.put("ids", CollectionUtil.isNotEmpty(collect) ? collect : CollectionUtil.newArrayList(-1L)); params.put("ids", CollectionUtil.isNotEmpty(collect) ? collect : CollectionUtil.newArrayList(-1L));

6
modules/alarm/src/main/resources/mapper/AlarmRuleEntityMapper.xml

@ -31,6 +31,12 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
<if test="thingIds != null">
and a.thing_id in
<foreach item="thingId" collection="thingIds" open="(" separator="," close=")">
#{thingId}
</foreach>
</if>
</where> </where>
</select> </select>

6
modules/alarm/src/main/resources/mapper/AlarmRuleLogMapper.xml

@ -79,9 +79,9 @@
LEFT JOIN iot_thing_entity te ON ae.thing_id = te.id LEFT JOIN iot_thing_entity te ON ae.thing_id = te.id
</if> </if>
<include refid="pageCondition" /> <include refid="pageCondition" />
<if test="params.limit!=null and params.offset">
limit #{params.limit} offset #{params.offset}
</if>
<!-- <if test="params.limit!=null and params.offset">-->
<!-- limit #{params.limit} offset #{params.offset}-->
<!-- </if>-->
</select> </select>
<select id="getProcessingUserList" resultType="com.thing.alarm.alarm.dto.AlarmProcessingUserDTO"> <select id="getProcessingUserList" resultType="com.thing.alarm.alarm.dto.AlarmProcessingUserDTO">

49
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/PubCockpitController.java

@ -0,0 +1,49 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CockpitEnterpriseInfo;
import com.thing.carbon.pub.service.PubCockpitService;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 企业注册
*
* @author xc
* @since 3.0 2024-07-09
*/
@RestController
@RequestMapping("v2/pub/cockpit")
@Tag(name="公共服务侧大屏看板")
@RequiredArgsConstructor
public class PubCockpitController {
@Autowired
private PubCockpitService pubCockpitService;
@GetMapping("list")
@Operation(summary="左上角和地图得企业列表")
public Result<List<CockpitEnterpriseInfo>> list(){
List<CockpitEnterpriseInfo> list = pubCockpitService.cockpitEnterpriseInfoList();
return new Result<List<CockpitEnterpriseInfo>>().ok(list);
}
@GetMapping("statistics")
@Operation(summary="中间六个统计")
public Result<List<CockpitEnterpriseInfo>> statistics(){
List<CockpitEnterpriseInfo> list = pubCockpitService.cockpitEnterpriseInfoList();
return new Result<List<CockpitEnterpriseInfo>>().ok(list);
}
}

34
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitEnterpriseInfo.java

@ -0,0 +1,34 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 企业列表详情
*/
@Data
@Schema(description = "国网侧驾驶舱企业信息")
public class CockpitEnterpriseInfo {
@Schema(description = "企业名称")
private String name;
@Schema(description = "企业编码")
private String code;
@Schema(description = "企业区域id")
private String regionId;
@Schema(description = "碳足迹结果数量")
private String recordsCount;
@Schema(description = "产品数量")
private String productCount;
@Schema(description = "经纬度原始值")
private String lngLatStr;
@Schema(description = "经度")
private String lng;
@Schema(description = "纬度")
private String lat;
@Schema(description = "产品分类")
private String productType;
@Schema(description = "平均产品碳足迹")
private BigDecimal avgCarBon;
}

20
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitStatisticsDto.java

@ -0,0 +1,20 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 国网侧驾驶舱中间六个统计信息
*/
@Data
@Schema(description = "国网侧驾驶舱中间六个统计信息")
public class CockpitStatisticsDto {
}

13
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/PubCockpitMapper.java

@ -0,0 +1,13 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.dto.CockpitEnterpriseInfo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface PubCockpitMapper {
List<CockpitEnterpriseInfo> cockpitEnterpriseInfoList();
}

11
modules/carbon-public/src/main/java/com/thing/carbon/pub/service/PubCockpitService.java

@ -0,0 +1,11 @@
package com.thing.carbon.pub.service;
import com.thing.carbon.pub.dto.CockpitEnterpriseInfo;
import java.util.List;
public interface PubCockpitService {
List<CockpitEnterpriseInfo> cockpitEnterpriseInfoList();
}

42
modules/carbon-public/src/main/java/com/thing/carbon/pub/service/impl/PubCockpitServiceImpl.java

@ -0,0 +1,42 @@
package com.thing.carbon.pub.service.impl;
import com.thing.carbon.pub.dto.CockpitEnterpriseInfo;
import com.thing.carbon.pub.mapper.CarbonPubSupplierMapper;
import com.thing.carbon.pub.mapper.PubCockpitMapper;
import com.thing.carbon.pub.service.PubCockpitService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
@Service
public class PubCockpitServiceImpl implements PubCockpitService {
@Autowired
private PubCockpitMapper pubCockpitMapper;
@Autowired
private CarbonPubSupplierMapper carbonPubSupplierMapper;
@Override
public List<CockpitEnterpriseInfo> cockpitEnterpriseInfoList() {
List<CockpitEnterpriseInfo> infoList = pubCockpitMapper.cockpitEnterpriseInfoList();
infoList.forEach(temp->{
if(ObjectUtils.isNotEmpty(temp.getLngLatStr())){
String[] strs = temp.getLngLatStr().split(",");
temp.setLng(strs[0]);
temp.setLat(strs[1]);
}
//补全平均产品碳足迹值
BigDecimal avgCarbon = carbonPubSupplierMapper.avgCarbonOfAllProduct(Long.parseLong(temp.getCode()),null,null);
temp.setAvgCarBon(avgCarbon.setScale(4, RoundingMode.UP));
});
return infoList;
}
}

2
modules/carbon-public/src/main/resources/mapper/CarbonPubSupplierMapper.xml

@ -42,7 +42,7 @@
</select> </select>
<select id="avgCarbonOfAllProduct" resultType="java.math.BigDecimal"> <select id="avgCarbonOfAllProduct" resultType="java.math.BigDecimal">
select avg(carbon)
select COALESCE( avg(carbon), 0 ) AS carbon
from (select tenant_code, from (select tenant_code,
sum(type1_carbon_avg) sum(type1_carbon_avg)
+ sum(type1_usage_avg) + sum(type1_usage_avg)

39
modules/carbon-public/src/main/resources/mapper/PubCockpitMapper.xml

@ -0,0 +1,39 @@
<?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.thing.carbon.pub.mapper.PubCockpitMapper">
<select id="cockpitEnterpriseInfoList" resultType="com.thing.carbon.pub.dto.CockpitEnterpriseInfo">
SELECT
cps.NAME,
cps.code,
cps.region_id,
COALESCE ( t2.records_count, 0 ) AS records_count,
COALESCE ( t3.product_count, 0 ) AS product_count,
td.lng_lat as lngLatStr,
TEMP.product_type
FROM
carbon_pub_supplier cps
LEFT JOIN ( SELECT string_agg ( DISTINCT industry_sub, ',' ) AS product_type, tenant_code FROM iot_carbon_production_variety GROUP BY tenant_code ) TEMP ON cps.code = TEMP.tenant_code
LEFT JOIN (
SELECT SUM
( pr_unit ) AS records_count,
tenant_code
FROM
( SELECT COUNT ( DISTINCT pr_code ) AS pr_unit, tenant_code, pr_code FROM carbon_pub_production_result GROUP BY product_id, pr_code, tenant_code ) t1
GROUP BY
tenant_code
) t2 ON cps.code = t2.tenant_code
LEFT JOIN (
SELECT SUM
( product_count ) AS product_count,
tenant_code
FROM
( SELECT COUNT ( DISTINCT product_id ) AS product_count, tenant_code FROM carbon_pub_production_result GROUP BY product_id, tenant_code ) t1
GROUP BY
tenant_code
) t3 ON cps.code = t3.tenant_code
LEFT JOIN sys_tenant_detail td on cps.code = td.id
</select>
</mapper>

29
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonConsumables/controller/CqcCarbonConsumablesController.java

@ -1,15 +1,19 @@
package com.thing.cqc.cqcCarbonConsumables.controller; package com.thing.cqc.cqcCarbonConsumables.controller;
import com.thing.common.core.annotation.LogOperation; import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils; import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils; import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup; import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup; import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup; import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result; import com.thing.common.core.web.response.Result;
import com.thing.cqc.cqcCarbonConsumables.dto.CqcCarbonConsumablesDTO; import com.thing.cqc.cqcCarbonConsumables.dto.CqcCarbonConsumablesDTO;
import com.thing.cqc.cqcCarbonConsumables.service.CqcCarbonConsumablesService; import com.thing.cqc.cqcCarbonConsumables.service.CqcCarbonConsumablesService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -31,18 +35,19 @@ public class CqcCarbonConsumablesController {
private final CqcCarbonConsumablesService cqcCarbonConsumablesService; private final CqcCarbonConsumablesService cqcCarbonConsumablesService;
// @GetMapping("page")
// @Operation(summary="分页")
// @Parameters({
// @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
// @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
// @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
// @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
// })
// public Result<PageData<CqcCarbonConsumablesDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
// PageData<CqcCarbonConsumablesDTO> page = cqcCarbonConsumablesService.getPageData(params, CqcCarbonConsumablesDTO.class);
// return new Result<PageData<CqcCarbonConsumablesDTO>>().ok(page);
// }
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "applyNo", description = "applyNo,报表唯一编码")
})
public Result<PageData<CqcCarbonConsumablesDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CqcCarbonConsumablesDTO> page = cqcCarbonConsumablesService.getPageData(params, CqcCarbonConsumablesDTO.class);
return new Result<PageData<CqcCarbonConsumablesDTO>>().ok(page);
}
@GetMapping("list/{applyNo}") @GetMapping("list/{applyNo}")
@Operation(summary="信息") @Operation(summary="信息")

36
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonConsumables/dto/CqcCarbonConsumablesDTO.java

@ -23,39 +23,39 @@ public class CqcCarbonConsumablesDTO implements Serializable {
@Schema(description = "申请编号") @Schema(description = "申请编号")
private String applyNo; private String applyNo;
@Schema(description = "类别") @Schema(description = "类别")
private String cateid;
private String cateId;
@Schema(description = "中文名称") @Schema(description = "中文名称")
private String materialsnamecn;
private String materialsNameCn;
@Schema(description = "化学名称") @Schema(description = "化学名称")
private String materialsnameen;
private String materialsNameEn;
@Schema(description = "用途") @Schema(description = "用途")
private String materialsuse;
private String materialsUse;
@Schema(description = "材料组份") @Schema(description = "材料组份")
private String materialcomponent;
private String materialComponent;
@Schema(description = "产品使用耗材总投入量") @Schema(description = "产品使用耗材总投入量")
private String productcapacity;
private String productCapacity;
@Schema(description = "单位") @Schema(description = "单位")
private String productcapacityunit;
private String productCapacityUnit;
@Schema(description = "功能单位耗用量") @Schema(description = "功能单位耗用量")
private String rawmaterialsinput;
private String rawMaterialsInput;
@Schema(description = "单位") @Schema(description = "单位")
private String rawmaterialsunit;
private String rawMaterialsUnit;
@Schema(description = "供货商名称") @Schema(description = "供货商名称")
private String suppliername;
private String supplierName;
@Schema(description = "供货商地址") @Schema(description = "供货商地址")
private String supplieraddress;
private String supplierAddress;
@Schema(description = "运输方式") @Schema(description = "运输方式")
private String transmode;
private String transMode;
@Schema(description = "运输工具载重量") @Schema(description = "运输工具载重量")
private String transloadcapacity;
private String transLoadCapacity;
@Schema(description = "运输距离") @Schema(description = "运输距离")
private String transdistance;
private String transDistance;
@Schema(description = "单位") @Schema(description = "单位")
private String transdistanceunit;
private String transDistanceUnit;
@Schema(description = "运输数据来源") @Schema(description = "运输数据来源")
private String transdatasource;
private String transDataSource;
@Schema(description = "活动数据来源") @Schema(description = "活动数据来源")
private String activitydatasource;
private String activityDataSource;
@Schema(description = "部门") @Schema(description = "部门")
private String dept; private String dept;
@Schema(description = "人员") @Schema(description = "人员")
@ -65,6 +65,6 @@ public class CqcCarbonConsumablesDTO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remake; private String remake;
@Schema(description = "能源编号") @Schema(description = "能源编号")
private String energyno;
private String energyNo;
} }

36
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonConsumables/entity/CqcCarbonConsumablesEntity.java

@ -35,71 +35,71 @@ public class CqcCarbonConsumablesEntity implements Serializable {
/** /**
* 类别 * 类别
*/ */
private String cateid;
private String cateId;
/** /**
* 中文名称 * 中文名称
*/ */
private String materialsnamecn;
private String materialsNameCn;
/** /**
* 化学名称 * 化学名称
*/ */
private String materialsnameen;
private String materialsNameEn;
/** /**
* 用途 * 用途
*/ */
private String materialsuse;
private String materialsUse;
/** /**
* 材料组份 * 材料组份
*/ */
private String materialcomponent;
private String materialComponent;
/** /**
* 产品使用耗材总投入量 * 产品使用耗材总投入量
*/ */
private String productcapacity;
private String productCapacity;
/** /**
* 单位 * 单位
*/ */
private String productcapacityunit;
private String productCapacityUnit;
/** /**
* 功能单位耗用量 * 功能单位耗用量
*/ */
private String rawmaterialsinput;
private String rawMaterialsInput;
/** /**
* 单位 * 单位
*/ */
private String rawmaterialsunit;
private String rawMaterialsUnit;
/** /**
* 供货商名称 * 供货商名称
*/ */
private String suppliername;
private String supplierName;
/** /**
* 供货商地址 * 供货商地址
*/ */
private String supplieraddress;
private String supplierAddress;
/** /**
* 运输方式 * 运输方式
*/ */
private String transmode;
private String transMode;
/** /**
* 运输工具载重量 * 运输工具载重量
*/ */
private String transloadcapacity;
private String transLoadCapacity;
/** /**
* 运输距离 * 运输距离
*/ */
private String transdistance;
private String transDistance;
/** /**
* 单位 * 单位
*/ */
private String transdistanceunit;
private String transDistanceUnit;
/** /**
* 运输数据来源 * 运输数据来源
*/ */
private String transdatasource;
private String transDataSource;
/** /**
* 活动数据来源 * 活动数据来源
*/ */
private String activitydatasource;
private String activityDataSource;
/** /**
* 部门 * 部门
*/ */
@ -119,5 +119,5 @@ public class CqcCarbonConsumablesEntity implements Serializable {
/** /**
* 能源编号 * 能源编号
*/ */
private String energyno;
private String energyNo;
} }

12
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/controller/CqcCarbonDiscardController.java

@ -11,6 +11,7 @@ import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result; import com.thing.common.core.web.response.Result;
import com.thing.cqc.cqcCarbonDiscard.dto.CqcCarbonDiscardDTO; import com.thing.cqc.cqcCarbonDiscard.dto.CqcCarbonDiscardDTO;
import com.thing.cqc.cqcCarbonDiscard.service.CqcCarbonDiscardService; import com.thing.cqc.cqcCarbonDiscard.service.CqcCarbonDiscardService;
import com.thing.cqc.cqcCarbonDistribution.dto.CqcCarbonDistributionDTO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.Parameters;
@ -18,6 +19,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -40,13 +42,21 @@ public class CqcCarbonDiscardController {
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "applyNo", description = "applyNo,报表唯一编码")
}) })
public Result<PageData<CqcCarbonDiscardDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ public Result<PageData<CqcCarbonDiscardDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CqcCarbonDiscardDTO> page = cqcCarbonDiscardService.getPageData(params, CqcCarbonDiscardDTO.class); PageData<CqcCarbonDiscardDTO> page = cqcCarbonDiscardService.getPageData(params, CqcCarbonDiscardDTO.class);
return new Result<PageData<CqcCarbonDiscardDTO>>().ok(page); return new Result<PageData<CqcCarbonDiscardDTO>>().ok(page);
} }
@GetMapping("list/{applyNo}")
@Operation(summary="信息")
public Result<List<CqcCarbonDiscardDTO>> list(@PathVariable("applyNo") String applyNo){
List<CqcCarbonDiscardDTO> datas = cqcCarbonDiscardService.listAs(Map.of("applyNo",applyNo), CqcCarbonDiscardDTO.class);
return new Result<List<CqcCarbonDiscardDTO> >().ok(datas);
}
@GetMapping("{id}") @GetMapping("{id}")
@Operation(summary="信息") @Operation(summary="信息")
public Result<CqcCarbonDiscardDTO> get(@PathVariable("id") Long id){ public Result<CqcCarbonDiscardDTO> get(@PathVariable("id") Long id){

36
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/dto/CqcCarbonDiscardDTO.java

@ -23,39 +23,39 @@ public class CqcCarbonDiscardDTO implements Serializable {
@Schema(description = "申请编号") @Schema(description = "申请编号")
private String applyNo; private String applyNo;
@Schema(description = "类别") @Schema(description = "类别")
private String cateid;
private String cateId;
@Schema(description = "中文名称") @Schema(description = "中文名称")
private String materialsnamecn;
private String materialsNameCn;
@Schema(description = "化学名称") @Schema(description = "化学名称")
private String materialsnameen;
private String materialsNameEn;
@Schema(description = "材料组份") @Schema(description = "材料组份")
private String materialcomponent;
private String materialComponent;
@Schema(description = "废物处置材料总重量") @Schema(description = "废物处置材料总重量")
private String wastedisposal;
private String wasteDisposal;
@Schema(description = "单位") @Schema(description = "单位")
private String wastedisposalunit;
private String wasteDisposalUnit;
@Schema(description = "功能单位处置量") @Schema(description = "功能单位处置量")
private String rawmaterialsinput;
private String rawMaterialsInput;
@Schema(description = "单位") @Schema(description = "单位")
private String rawmaterialsunit;
private String rawMaterialsUnit;
@Schema(description = "处理方式") @Schema(description = "处理方式")
private String disposeway;
private String disposeWay;
@Schema(description = "处理商名称") @Schema(description = "处理商名称")
private String disposename;
private String disposeName;
@Schema(description = "处理商地址") @Schema(description = "处理商地址")
private String disposeaddress;
private String disposeAddress;
@Schema(description = "运输方式") @Schema(description = "运输方式")
private String transmode;
private String transMode;
@Schema(description = "运输工具载重量") @Schema(description = "运输工具载重量")
private String transloadcapacity;
private String transLoadCapacity;
@Schema(description = "运输距离") @Schema(description = "运输距离")
private String transdistance;
private String transDistance;
@Schema(description = "单位") @Schema(description = "单位")
private String transdistanceunit;
private String transDistanceUnit;
@Schema(description = "运输数据来源") @Schema(description = "运输数据来源")
private String transdatasource;
private String transDataSource;
@Schema(description = "活动数据来源") @Schema(description = "活动数据来源")
private String activitydatasource;
private String activityDataSource;
@Schema(description = "部门") @Schema(description = "部门")
private String dept; private String dept;
@Schema(description = "人员") @Schema(description = "人员")
@ -65,6 +65,6 @@ public class CqcCarbonDiscardDTO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remake; private String remake;
@Schema(description = "编号") @Schema(description = "编号")
private String wasteno;
private String wasteNo;
} }

36
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/entity/CqcCarbonDiscardEntity.java

@ -36,71 +36,71 @@ public class CqcCarbonDiscardEntity implements Serializable {
/** /**
* 类别 * 类别
*/ */
private String cateid;
private String cateId;
/** /**
* 中文名称 * 中文名称
*/ */
private String materialsnamecn;
private String materialsNameCn;
/** /**
* 化学名称 * 化学名称
*/ */
private String materialsnameen;
private String materialsNameEn;
/** /**
* 材料组份 * 材料组份
*/ */
private String materialcomponent;
private String materialComponent;
/** /**
* 废物处置材料总重量 * 废物处置材料总重量
*/ */
private String wastedisposal;
private String wasteDisposal;
/** /**
* 单位 * 单位
*/ */
private String wastedisposalunit;
private String wasteDisposalUnit;
/** /**
* 功能单位处置量 * 功能单位处置量
*/ */
private String rawmaterialsinput;
private String rawMaterialsInput;
/** /**
* 单位 * 单位
*/ */
private String rawmaterialsunit;
private String rawMaterialsUnit;
/** /**
* 处理方式 * 处理方式
*/ */
private String disposeway;
private String disposeWay;
/** /**
* 处理商名称 * 处理商名称
*/ */
private String disposename;
private String disposeName;
/** /**
* 处理商地址 * 处理商地址
*/ */
private String disposeaddress;
private String disposeAddress;
/** /**
* 运输方式 * 运输方式
*/ */
private String transmode;
private String transMode;
/** /**
* 运输工具载重量 * 运输工具载重量
*/ */
private String transloadcapacity;
private String transLoadCapacity;
/** /**
* 运输距离 * 运输距离
*/ */
private String transdistance;
private String transDistance;
/** /**
* 单位 * 单位
*/ */
private String transdistanceunit;
private String transDistanceUnit;
/** /**
* 运输数据来源 * 运输数据来源
*/ */
private String transdatasource;
private String transDataSource;
/** /**
* 活动数据来源 * 活动数据来源
*/ */
private String activitydatasource;
private String activityDataSource;
/** /**
* 部门 * 部门
*/ */
@ -120,5 +120,5 @@ public class CqcCarbonDiscardEntity implements Serializable {
/** /**
* 编号 * 编号
*/ */
private String wasteno;
private String wasteNo;
} }

6
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDiscard/service/impl/CqcCarbonDiscardServiceImpl.java

@ -2,9 +2,11 @@ package com.thing.cqc.cqcCarbonDiscard.service.impl;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
import com.thing.common.orm.service.impl.BaseServiceImpl; import com.thing.common.orm.service.impl.BaseServiceImpl;
import com.thing.cqc.cqcCarbonDiscard.mapper.CqcCarbonDiscardMapper;
import com.thing.cqc.cqcCarbonDiscard.entity.CqcCarbonDiscardEntity; import com.thing.cqc.cqcCarbonDiscard.entity.CqcCarbonDiscardEntity;
import com.thing.cqc.cqcCarbonDiscard.mapper.CqcCarbonDiscardMapper;
import com.thing.cqc.cqcCarbonDiscard.service.CqcCarbonDiscardService; import com.thing.cqc.cqcCarbonDiscard.service.CqcCarbonDiscardService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
@ -21,6 +23,8 @@ public class CqcCarbonDiscardServiceImpl extends BaseServiceImpl<CqcCarbonDiscar
@Override @Override
public QueryWrapper getWrapper(Map<String, Object> params){ public QueryWrapper getWrapper(Map<String, Object> params){
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
String applyNo = MapUtils.getString(params,"applyNo");
wrapper.eq(CqcCarbonDiscardEntity::getApplyNo,applyNo, StringUtils.isNotEmpty(applyNo));
return wrapper; return wrapper;
} }

29
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDistribution/controller/CqcCarbonDistributionController.java

@ -1,6 +1,7 @@
package com.thing.cqc.cqcCarbonDistribution.controller; package com.thing.cqc.cqcCarbonDistribution.controller;
import com.thing.common.core.annotation.LogOperation; import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils; import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils; import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup; import com.thing.common.core.validator.group.AddGroup;
@ -9,7 +10,10 @@ import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.Result; import com.thing.common.core.web.response.Result;
import com.thing.cqc.cqcCarbonDistribution.dto.CqcCarbonDistributionDTO; import com.thing.cqc.cqcCarbonDistribution.dto.CqcCarbonDistributionDTO;
import com.thing.cqc.cqcCarbonDistribution.service.CqcCarbonDistributionService; import com.thing.cqc.cqcCarbonDistribution.service.CqcCarbonDistributionService;
import com.thing.common.core.web.response.PageData;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -31,18 +35,19 @@ public class CqcCarbonDistributionController {
private final CqcCarbonDistributionService cqcCarbonDistributionService; private final CqcCarbonDistributionService cqcCarbonDistributionService;
// @GetMapping("page")
// @Operation(summary="分页")
// @Parameters({
// @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
// @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
// @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
// @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
// })
// public Result<PageData<CqcCarbonDistributionDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
// PageData<CqcCarbonDistributionDTO> page = cqcCarbonDistributionService.getPageData(params, CqcCarbonDistributionDTO.class);
// return new Result<PageData<CqcCarbonDistributionDTO>>().ok(page);
// }
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "applyNo", description = "applyNo,报表唯一编码")
})
public Result<PageData<CqcCarbonDistributionDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CqcCarbonDistributionDTO> page = cqcCarbonDistributionService.getPageData(params, CqcCarbonDistributionDTO.class);
return new Result<PageData<CqcCarbonDistributionDTO>>().ok(page);
}
@GetMapping("list/{applyNo}") @GetMapping("list/{applyNo}")
@Operation(summary="信息") @Operation(summary="信息")

24
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDistribution/dto/CqcCarbonDistributionDTO.java

@ -23,27 +23,27 @@ public class CqcCarbonDistributionDTO implements Serializable {
@Schema(description = "申请编号") @Schema(description = "申请编号")
private String applyNo; private String applyNo;
@Schema(description = "中文名称") @Schema(description = "中文名称")
private String materialsnamecn;
private String materialsNameCn;
@Schema(description = "产品出货重量") @Schema(description = "产品出货重量")
private String productweight;
private String productWeight;
@Schema(description = "单位") @Schema(description = "单位")
private String productweightunit;
private String productWeightUnit;
@Schema(description = "分销对象") @Schema(description = "分销对象")
private String distributionobject;
private String distributionObject;
@Schema(description = "分销地址") @Schema(description = "分销地址")
private String distributionaddress;
private String distributionAddress;
@Schema(description = "运输方式") @Schema(description = "运输方式")
private String transmode;
private String transMode;
@Schema(description = "运输工具载重量") @Schema(description = "运输工具载重量")
private String transloadcapacity;
private String transLoadCapacity;
@Schema(description = "运输距离") @Schema(description = "运输距离")
private String transdistance;
private String transDistance;
@Schema(description = "单位") @Schema(description = "单位")
private String transdistanceunit;
private String transDistanceUnit;
@Schema(description = "运输数据来源") @Schema(description = "运输数据来源")
private String transdatasource;
private String transDataSource;
@Schema(description = "活动数据来源") @Schema(description = "活动数据来源")
private String activitydatasource;
private String activityDataSource;
@Schema(description = "部门") @Schema(description = "部门")
private String dept; private String dept;
@Schema(description = "人员") @Schema(description = "人员")
@ -53,6 +53,6 @@ public class CqcCarbonDistributionDTO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remake; private String remake;
@Schema(description = "编号") @Schema(description = "编号")
private String disno;
private String disNo;
} }

24
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonDistribution/entity/CqcCarbonDistributionEntity.java

@ -35,47 +35,47 @@ public class CqcCarbonDistributionEntity implements Serializable {
/** /**
* 中文名称 * 中文名称
*/ */
private String materialsnamecn;
private String materialsNameCn;
/** /**
* 产品出货重量 * 产品出货重量
*/ */
private String productweight;
private String productWeight;
/** /**
* 单位 * 单位
*/ */
private String productweightunit;
private String productWeightUnit;
/** /**
* 分销对象 * 分销对象
*/ */
private String distributionobject;
private String distributionObject;
/** /**
* 分销地址 * 分销地址
*/ */
private String distributionaddress;
private String distributionAddress;
/** /**
* 运输方式 * 运输方式
*/ */
private String transmode;
private String transMode;
/** /**
* 运输工具载重量 * 运输工具载重量
*/ */
private String transloadcapacity;
private String transLoadCapacity;
/** /**
* 运输距离 * 运输距离
*/ */
private String transdistance;
private String transDistance;
/** /**
* 单位 * 单位
*/ */
private String transdistanceunit;
private String transDistanceUnit;
/** /**
* 运输数据来源 * 运输数据来源
*/ */
private String transdatasource;
private String transDataSource;
/** /**
* 活动数据来源 * 活动数据来源
*/ */
private String activitydatasource;
private String activityDataSource;
/** /**
* 部门 * 部门
*/ */
@ -95,5 +95,5 @@ public class CqcCarbonDistributionEntity implements Serializable {
/** /**
* 编号 * 编号
*/ */
private String disno;
private String disNo;
} }

29
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonEnergy/controller/CqcCarbonEnergyController.java

@ -1,16 +1,20 @@
package com.thing.cqc.cqcCarbonEnergy.controller; package com.thing.cqc.cqcCarbonEnergy.controller;
import com.thing.common.core.annotation.LogOperation; import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils; import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils; import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup; import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup; import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup; import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result; import com.thing.common.core.web.response.Result;
import com.thing.cqc.cqcCarbonEnergy.dto.CqcCarbonEnergyDTO; import com.thing.cqc.cqcCarbonEnergy.dto.CqcCarbonEnergyDTO;
import com.thing.cqc.cqcCarbonEnergy.service.CqcCarbonEnergyService; import com.thing.cqc.cqcCarbonEnergy.service.CqcCarbonEnergyService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -32,18 +36,19 @@ public class CqcCarbonEnergyController {
private final CqcCarbonEnergyService cqcCarbonEnergyService; private final CqcCarbonEnergyService cqcCarbonEnergyService;
// @GetMapping("page")
// @Operation(summary="分页")
// @Parameters({
// @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
// @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
// @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
// @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
// })
// public Result<PageData<CqcCarbonEnergyDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
// PageData<CqcCarbonEnergyDTO> page = cqcCarbonEnergyService.getPageData(params, CqcCarbonEnergyDTO.class);
// return new Result<PageData<CqcCarbonEnergyDTO>>().ok(page);
// }
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "applyNo", description = "applyNo,报表唯一编码")
})
public Result<PageData<CqcCarbonEnergyDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CqcCarbonEnergyDTO> page = cqcCarbonEnergyService.getPageData(params, CqcCarbonEnergyDTO.class);
return new Result<PageData<CqcCarbonEnergyDTO>>().ok(page);
}
@GetMapping("list/{applyNo}") @GetMapping("list/{applyNo}")
@Operation(summary="信息") @Operation(summary="信息")

20
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonEnergy/dto/CqcCarbonEnergyDTO.java

@ -24,23 +24,23 @@ public class CqcCarbonEnergyDTO implements Serializable {
@Schema(description = "申请编号") @Schema(description = "申请编号")
private String applyNo; private String applyNo;
@Schema(description = "类别") @Schema(description = "类别")
private String cateid;
private String cateId;
@Schema(description = "使用过程") @Schema(description = "使用过程")
private String useprocedure;
private String useProcedure;
@Schema(description = "排放源") @Schema(description = "排放源")
private String emissionsource;
private String emissionSource;
@Schema(description = "用途") @Schema(description = "用途")
private String materialsuse;
private String materialsUse;
@Schema(description = "产品使用能源总投入量") @Schema(description = "产品使用能源总投入量")
private String energycapacity;
private String energyCapacity;
@Schema(description = "单位") @Schema(description = "单位")
private String energycapacityunit;
private String energyCapacityUnit;
@Schema(description = "功能单位耗用量") @Schema(description = "功能单位耗用量")
private String rawmaterialsinput;
private String rawMaterialsInput;
@Schema(description = "单位") @Schema(description = "单位")
private String rawmaterialsunit;
private String rawMaterialsUnit;
@Schema(description = "活动数据来源") @Schema(description = "活动数据来源")
private String activitydatasource;
private String activityDataSource;
@Schema(description = "部门") @Schema(description = "部门")
private String dept; private String dept;
@Schema(description = "人员") @Schema(description = "人员")
@ -50,6 +50,6 @@ public class CqcCarbonEnergyDTO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remake; private String remake;
@Schema(description = "备注") @Schema(description = "备注")
private String consumeno;
private String consumeNo;
} }

20
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonEnergy/entity/CqcCarbonEnergyEntity.java

@ -36,39 +36,39 @@ public class CqcCarbonEnergyEntity implements Serializable {
/** /**
* 类别 * 类别
*/ */
private String cateid;
private String cateId;
/** /**
* 使用过程 * 使用过程
*/ */
private String useprocedure;
private String useProcedure;
/** /**
* 排放源 * 排放源
*/ */
private String emissionsource;
private String emissionSource;
/** /**
* 用途 * 用途
*/ */
private String materialsuse;
private String materialsUse;
/** /**
* 产品使用能源总投入量 * 产品使用能源总投入量
*/ */
private String energycapacity;
private String energyCapacity;
/** /**
* 单位 * 单位
*/ */
private String energycapacityunit;
private String energyCapacityUnit;
/** /**
* 功能单位耗用量 * 功能单位耗用量
*/ */
private String rawmaterialsinput;
private String rawMaterialsInput;
/** /**
* 单位 * 单位
*/ */
private String rawmaterialsunit;
private String rawMaterialsUnit;
/** /**
* 活动数据来源 * 活动数据来源
*/ */
private String activitydatasource;
private String activityDataSource;
/** /**
* 部门 * 部门
*/ */
@ -88,5 +88,5 @@ public class CqcCarbonEnergyEntity implements Serializable {
/** /**
* 备注 * 备注
*/ */
private String consumeno;
private String consumeNo;
} }

29
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonMake/controller/CqcCarbonMakeController.java

@ -1,16 +1,20 @@
package com.thing.cqc.cqcCarbonMake.controller; package com.thing.cqc.cqcCarbonMake.controller;
import com.thing.common.core.annotation.LogOperation; import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils; import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils; import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup; import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup; import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup; import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result; import com.thing.common.core.web.response.Result;
import com.thing.cqc.cqcCarbonMake.dto.CqcCarbonMakeDTO; import com.thing.cqc.cqcCarbonMake.dto.CqcCarbonMakeDTO;
import com.thing.cqc.cqcCarbonMake.service.CqcCarbonMakeService; import com.thing.cqc.cqcCarbonMake.service.CqcCarbonMakeService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -32,18 +36,19 @@ public class CqcCarbonMakeController {
private final CqcCarbonMakeService cqcCarbonMakeService; private final CqcCarbonMakeService cqcCarbonMakeService;
// @GetMapping("page")
// @Operation(summary="分页")
// @Parameters({
// @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
// @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
// @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
// @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
// })
// public Result<PageData<CqcCarbonMakeDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
// PageData<CqcCarbonMakeDTO> page = cqcCarbonMakeService.getPageData(params, CqcCarbonMakeDTO.class);
// return new Result<PageData<CqcCarbonMakeDTO>>().ok(page);
// }
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "applyNo", description = "applyNo,报表唯一编码")
})
public Result<PageData<CqcCarbonMakeDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CqcCarbonMakeDTO> page = cqcCarbonMakeService.getPageData(params, CqcCarbonMakeDTO.class);
return new Result<PageData<CqcCarbonMakeDTO>>().ok(page);
}
@GetMapping("list/{applyNo}") @GetMapping("list/{applyNo}")

18
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonMake/dto/CqcCarbonMakeDTO.java

@ -24,21 +24,21 @@ public class CqcCarbonMakeDTO implements Serializable {
@Schema(description = "申请编号,,关联申请记录表申请唯一编码") @Schema(description = "申请编号,,关联申请记录表申请唯一编码")
private String applyNo; private String applyNo;
@Schema(description = "类别") @Schema(description = "类别")
private String cateid;
private String cateId;
@Schema(description = "制程投入位置") @Schema(description = "制程投入位置")
private String useplace;
private String usePlace;
@Schema(description = "排放源") @Schema(description = "排放源")
private String emissionsource;
private String emissionSource;
@Schema(description = "全厂总用量") @Schema(description = "全厂总用量")
private String totalelectricity;
private String totalElectricity;
@Schema(description = "全厂总用量单位") @Schema(description = "全厂总用量单位")
private String totalelectricityunit;
private String totalElectricityUnit;
@Schema(description = "功能单位消耗量") @Schema(description = "功能单位消耗量")
private String specificconsumption;
private String specificConsumption;
@Schema(description = "消耗量单位") @Schema(description = "消耗量单位")
private String specificconsumptionunit;
private String specificConsumptionUnit;
@Schema(description = "活动数据来源") @Schema(description = "活动数据来源")
private String activitydatasource;
private String activityDataSource;
@Schema(description = "部门") @Schema(description = "部门")
private String dept; private String dept;
@Schema(description = "人员") @Schema(description = "人员")
@ -48,6 +48,6 @@ public class CqcCarbonMakeDTO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remake; private String remake;
@Schema(description = "编号") @Schema(description = "编号")
private String makeno;
private String makeNo;
} }

18
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonMake/entity/CqcCarbonMakeEntity.java

@ -36,35 +36,35 @@ public class CqcCarbonMakeEntity implements Serializable {
/** /**
* 类别 * 类别
*/ */
private String cateid;
private String cateId;
/** /**
* 制程投入位置 * 制程投入位置
*/ */
private String useplace;
private String usePlace;
/** /**
* 排放源 * 排放源
*/ */
private String emissionsource;
private String emissionSource;
/** /**
* 全厂总用量 * 全厂总用量
*/ */
private String totalelectricity;
private String totalElectricity;
/** /**
* 全厂总用量单位 * 全厂总用量单位
*/ */
private String totalelectricityunit;
private String totalElectricityUnit;
/** /**
* 功能单位消耗量 * 功能单位消耗量
*/ */
private String specificconsumption;
private String specificConsumption;
/** /**
* 消耗量单位 * 消耗量单位
*/ */
private String specificconsumptionunit;
private String specificConsumptionUnit;
/** /**
* 活动数据来源 * 活动数据来源
*/ */
private String activitydatasource;
private String activityDataSource;
/** /**
* 部门 * 部门
*/ */
@ -84,5 +84,5 @@ public class CqcCarbonMakeEntity implements Serializable {
/** /**
* 编号 * 编号
*/ */
private String makeno;
private String makeNo;
} }

29
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonRaw/controller/CqcCarbonRawController.java

@ -1,15 +1,19 @@
package com.thing.cqc.cqcCarbonRaw.controller; package com.thing.cqc.cqcCarbonRaw.controller;
import com.thing.common.core.annotation.LogOperation; import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils; import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils; import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup; import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup; import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup; import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result; import com.thing.common.core.web.response.Result;
import com.thing.cqc.cqcCarbonRaw.dto.CqcCarbonRawDTO; import com.thing.cqc.cqcCarbonRaw.dto.CqcCarbonRawDTO;
import com.thing.cqc.cqcCarbonRaw.service.CqcCarbonRawService; import com.thing.cqc.cqcCarbonRaw.service.CqcCarbonRawService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -31,18 +35,19 @@ public class CqcCarbonRawController {
private final CqcCarbonRawService cqcCarbonRawService; private final CqcCarbonRawService cqcCarbonRawService;
// @GetMapping("page")
// @Operation(summary="分页")
// @Parameters({
// @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
// @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
// @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
// @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
// })
// public Result<PageData<CqcCarbonRawDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
// PageData<CqcCarbonRawDTO> page = cqcCarbonRawService.getPageData(params, CqcCarbonRawDTO.class);
// return new Result<PageData<CqcCarbonRawDTO>>().ok(page);
// }
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "applyNo", description = "applyNo,报表唯一编码")
})
public Result<PageData<CqcCarbonRawDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CqcCarbonRawDTO> page = cqcCarbonRawService.getPageData(params, CqcCarbonRawDTO.class);
return new Result<PageData<CqcCarbonRawDTO>>().ok(page);
}

36
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonRaw/dto/CqcCarbonRawDTO.java

@ -24,41 +24,41 @@ public class CqcCarbonRawDTO implements Serializable {
@Schema(description = "申请唯一编码,关联申请记录表申请唯一编码") @Schema(description = "申请唯一编码,关联申请记录表申请唯一编码")
private String applyNo; private String applyNo;
@Schema(description = "材料编号") @Schema(description = "材料编号")
private String materialno;
private String materialNo;
@Schema(description = "类别ID") @Schema(description = "类别ID")
private String cateid;
private String cateId;
@Schema(description = "材料中文名称") @Schema(description = "材料中文名称")
private String materialsnamecn;
private String materialsNameCn;
@Schema(description = "材料英文名称及化学名称") @Schema(description = "材料英文名称及化学名称")
private String materialsnameen;
private String materialsNameEn;
@Schema(description = "生成工序") @Schema(description = "生成工序")
private String productionprocesses;
private String productionProcesses;
@Schema(description = "材料组份名称及比例") @Schema(description = "材料组份名称及比例")
private String materialcomponent;
private String materialComponent;
@Schema(description = "盘查期间内生产该产品所使用原料总投入量") @Schema(description = "盘查期间内生产该产品所使用原料总投入量")
private String productcapacity;
private String productCapacity;
@Schema(description = "投入量单位") @Schema(description = "投入量单位")
private String productcapacityunit;
private String productCapacityUnit;
@Schema(description = "功能单位原物料投入量") @Schema(description = "功能单位原物料投入量")
private String rawmaterialsinput;
private String rawMaterialsInput;
@Schema(description = "原物料投入量单位") @Schema(description = "原物料投入量单位")
private String rawmaterialsunit;
private String rawMaterialsUnit;
@Schema(description = "供货商名称") @Schema(description = "供货商名称")
private String suppliername;
private String supplierName;
@Schema(description = "供货商地址") @Schema(description = "供货商地址")
private String supplieraddress;
private String supplierAddress;
@Schema(description = "运输方式") @Schema(description = "运输方式")
private String transmode;
private String transMode;
@Schema(description = "运输工具载重量") @Schema(description = "运输工具载重量")
private String transloadcapacity;
private String transLoadCapacity;
@Schema(description = "运输距离") @Schema(description = "运输距离")
private String transdistance;
private String transDistance;
@Schema(description = "运输距离单位") @Schema(description = "运输距离单位")
private String transdistanceunit;
private String transDistanceUnit;
@Schema(description = "运输数据来源") @Schema(description = "运输数据来源")
private String transdatasource;
private String transDataSource;
@Schema(description = "活动数据来源") @Schema(description = "活动数据来源")
private String activitydatasource;
private String activityDataSource;
@Schema(description = "部门") @Schema(description = "部门")
private String dept; private String dept;
@Schema(description = "负责人") @Schema(description = "负责人")

36
modules/cqc-service/src/main/java/com/thing/cqc/cqcCarbonRaw/entity/CqcCarbonRawEntity.java

@ -36,75 +36,75 @@ public class CqcCarbonRawEntity implements Serializable {
/** /**
* 材料编号 * 材料编号
*/ */
private String materialno;
private String materialNo;
/** /**
* 类别ID * 类别ID
*/ */
private String cateid;
private String cateId;
/** /**
* 材料中文名称 * 材料中文名称
*/ */
private String materialsnamecn;
private String materialsNameCn;
/** /**
* 材料英文名称及化学名称 * 材料英文名称及化学名称
*/ */
private String materialsnameen;
private String materialsNameEn;
/** /**
* 生成工序 * 生成工序
*/ */
private String productionprocesses;
private String productionProcesses;
/** /**
* 材料组份名称及比例 * 材料组份名称及比例
*/ */
private String materialcomponent;
private String materialComponent;
/** /**
* 盘查期间内生产该产品所使用原料总投入量 * 盘查期间内生产该产品所使用原料总投入量
*/ */
private String productcapacity;
private String productCapacity;
/** /**
* 投入量单位 * 投入量单位
*/ */
private String productcapacityunit;
private String productCapacityUnit;
/** /**
* 功能单位原物料投入量 * 功能单位原物料投入量
*/ */
private String rawmaterialsinput;
private String rawMaterialsInput;
/** /**
* 原物料投入量单位 * 原物料投入量单位
*/ */
private String rawmaterialsunit;
private String rawMaterialsUnit;
/** /**
* 供货商名称 * 供货商名称
*/ */
private String suppliername;
private String supplierName;
/** /**
* 供货商地址 * 供货商地址
*/ */
private String supplieraddress;
private String supplierAddress;
/** /**
* 运输方式 * 运输方式
*/ */
private String transmode;
private String transMode;
/** /**
* 运输工具载重量 * 运输工具载重量
*/ */
private String transloadcapacity;
private String transLoadCapacity;
/** /**
* 运输距离 * 运输距离
*/ */
private String transdistance;
private String transDistance;
/** /**
* 运输距离单位 * 运输距离单位
*/ */
private String transdistanceunit;
private String transDistanceUnit;
/** /**
* 运输数据来源 * 运输数据来源
*/ */
private String transdatasource;
private String transDataSource;
/** /**
* 活动数据来源 * 活动数据来源
*/ */
private String activitydatasource;
private String activityDataSource;
/** /**
* 部门 * 部门
*/ */

17
modules/cqc-service/src/main/java/com/thing/cqc/rpcService/JsonCryptoUtils.java

@ -25,8 +25,19 @@ public class JsonCryptoUtils {
return new String(decryptedBytes); return new String(decryptedBytes);
} }
//
//
// public static void main(String[] args) {
// try {
//
// String encryptedJson = "JWHn35+lgoPT5VCVhzQQVXRBM287T01XJKa9TEJB4QY1YhT6HrrdZRWZlPB2ZFr7gNhG3ZXT3yHyT2/mbVOWDsFEMV1A9jB86+lwqIhfckiiqi3fkFV7MOslceCxF1Fzm5+XO94650nKghh1tMh81ejwyr+Jy8z4C9WAL4z616/6o1IdcZYhvbxs+2OdUQqni+ZBseCA6iglZC3zRvEOP/IJnmJpBVskRjUHph2uLXJdzgjoYs0M9mWeqr87cLGQuVbFMPAOjdiXnLo/+JcNMUgX5YcAFdpIWK8n/Cipa0sA1STFJ8JUKx951rck/YOQJGa56twluaVHxvtvoin2XX0vMI3MfCRuspU+m+hWQZ2adu4G5vxuFsT9jlRaSgz9QGtXQb8qzJqFkffDp7ykxtMvZYSgsqxyEALTWNA+w/TtV9JNKDv4GJxlseTV20mF2qzR2zO39f926SXKTtmQ5kERWr4Ya0hfLx+8cTO5aulPmOJEmCJfkDXzxcu3zLVOJnwgr0/DAoCxD01/g5oOF/dAt0wk1nvMOshW4UxCVYqXC4a4H6wyBOzUxVlFy9aF4zLptMYCJr2CWlGjrqn9ZNzOF29SSVKQVVgNwlGfqbJdrfrX/NXvpr1An4MoaMumCLd1eWv6dyJbL0oHGbPBUWUHgXZ11AZfeElOk2UANN/WLWh6zws9t9/OBswHtRBcXe6p9B45nRXuOuUxZz6/vFQcQpcgdWjUWgSClf1RgyOj5DxTLYYkSWjkm1aNgPwFcUmz/roBY1s+1d/o3X3T1pfoDc99dmX+tA7t//fpQ4ykLVRLCkcLBCzS9Jept7no9rEPrcOWPgYISbEkdtqKEmI7hL4/VghUm+uwSqanthDGTjEzW5TFQ5rWBi8o1v9mEVUJ2Pu3skENDkyDXlVUxPGZS5DJyMCY36wEha61g0vQ9d9J563o7fs7CiKt3352GeJjdwil2bK6u5SaQ90XczBZaI2T9fa14YOBIAQEqgU7n7qW/Fx58VmD0IZBjFZ6jCOsOmPdFSaDBiMiI0l7hjv5dK8pFRYjmaG3UayCmOu4ZuNGIWQU1CMlsJTH0CE+2TyaManBpnxBuwccDvGZTx5v8gpxw23Dc8bvmx/XbufKpqIrOCeWnjASZ8RKcg3+E05Ctsix0Vl69ExoIJ4ywxFpl0ipj5BBm/6BGdX4IDngPezJaX0qyGvh4F4aeEdPyTZCT46hJsKLVTbL5I91j7OBtH2/Lc9NRqW4lDjOgpD2PTrR0ApBQH4HFs0Q9rsy65DznLyofd70vsV1zBNUuJg9mlGT0vrb/Kp1qBjes2T4KUv/520AFFrM6cHCQMhicD2PFkyO8CHIMAFdZ3rDtjevrQnN2/jG9/fNVYgnL75hKQfGpj+dIQ8lnner8NpmajlEWacnmjd0YETIxpzAndg5qzSTU0S7htlPwqm68pal7yK1a2PyYQPlnMT9y/hB9hFgDAP8D3T1mJBKBhW3uvycbLu/FQnrAbTuiC6AnTehLSlIzNZjAgUw9cK2pvJY446YRZfXz/iij29fN1q1laXjBEb/BvGsW5prGJOrDos6+pttyVTCuvjW4F+R4Eq8OVjtcyV7Atthb9+zURmWREH9u72xlJZ/rM0IgCDpJ6rmODfGJfyrDvTs0Ks0BrJCEmRh86PFtOozRU89n3RI2puC20dIJQwSdpK7nIoccdKFrpcqJHt87gC5/812SWCGpny1eydQPqU0MVSgRM39Kex9eVLajRT4WvihIi/rImUCZtHTMjLDJGiA/AGw29CVa3DG+LN9m14tHrL0PFZCtnla2851K2zIYvBaBpSg1FdxqES4yCjLKQEpNDMDnNZ96Bop5Q8t56pgtl7SO0FeBvHNZKVeXByPG9EBu4OjIMONho6ECP7Iac8ElkdaMvraYmwhGmNukM4/QgQ1R1WAK+vU7dsbB/ADv2yvEjImB24r2uVt2cFqkEolW6NXTuiUN1qhZbA/dS2qBOMUROfalKAESbyrHSJG+W0dR5jAHc4iZ7Hf0tFFtH+Cs61N09Q2V8CEOBo2zJrn5RJhxAbRq0MawtUwCH2cY/SMIUWj2fc=";
// // 解密
// String decryptedJson = decryptJson(encryptedJson, SECRETKEY);
// System.out.println("Decrypted JSON: " + decryptedJson);
//
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
} }

4
modules/filter-rule/src/main/java/com/thing/filter/rule/dto/FilterRuleDetailDTO.java

@ -7,6 +7,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
/** /**
* 过滤规则详情表 * 过滤规则详情表
@ -51,6 +52,9 @@ public class FilterRuleDetailDTO implements Serializable {
* 是否为整点时间 * 是否为整点时间
*/ */
public Boolean getOnTime(){ public Boolean getOnTime(){
if(Objects.isNull(dataType)){
return false;
}
return DataType.isRange(dataType); return DataType.isRange(dataType);
} }
} }

7
modules/filter-rule/src/main/java/com/thing/filter/rule/enumeration/DataType.java

@ -3,6 +3,8 @@ package com.thing.filter.rule.enumeration;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.util.Objects;
/** /**
* @author siyang * @author siyang
* @date 2024-03-21 * @date 2024-03-21
@ -25,6 +27,9 @@ public enum DataType {
} }
public static boolean isRange(int code) { public static boolean isRange(int code) {
return code == 3;
if(Objects.equals(code, 3)){
return true;
}
return false;
} }
} }

57
modules/thing/src/main/java/com/thing/thing/dict/service/impl/IotThingDictServiceImpl.java

@ -208,8 +208,8 @@ public class IotThingDictServiceImpl extends BaseServiceImpl<IotThingDictMapper,
QueryWrapper queryWrapper = QueryWrapper QueryWrapper queryWrapper = QueryWrapper
.create() .create()
.select(max(IOT_THING_DICT_ENTITY.SORT)); .select(max(IOT_THING_DICT_ENTITY.SORT));
queryWrapper.where(IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(1)
.or(IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(0).and(IOT_THING_DICT_ENTITY.TENANT_CODE.eq(UserContext.getRealTenantCode()))));
queryWrapper.where(IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(0)
.or(IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(1).and(IOT_THING_DICT_ENTITY.TENANT_CODE.eq(UserContext.getRealTenantCode()))));
Long num = mapper.selectOneByQueryAs(queryWrapper, Long.class); Long num = mapper.selectOneByQueryAs(queryWrapper, Long.class);
return Objects.isNull(num) ? 1 : num+1; return Objects.isNull(num) ? 1 : num+1;
} }
@ -392,16 +392,47 @@ public class IotThingDictServiceImpl extends BaseServiceImpl<IotThingDictMapper,
IotThingDictEntity iotThingDictEntity = mapper.selectOneById(id); IotThingDictEntity iotThingDictEntity = mapper.selectOneById(id);
IotThingDictEntity toDictEntity = mapper.selectOneById(toId); IotThingDictEntity toDictEntity = mapper.selectOneById(toId);
//自定义字典列表 //自定义字典列表
List<IotThingDictEntity> noDefaultList = mapper.selectListByQuery(QueryWrapper.create().eq(IotThingDictEntity::getTenantCode, UserContext.getRealTenantCode())
.eq(IotThingDictEntity::getIsDefault, 1).ne(IotThingDictEntity::getId, id));
//自定义字典列表
List<IotThingDictEntity> defaultList = mapper.selectListByQuery(QueryWrapper.create()
.eq(IotThingDictEntity::getIsDefault, 0).ne(IotThingDictEntity::getId, id));
List<IotThingDictEntity> iotThingDictEntities = Lists.newArrayList();
iotThingDictEntities.addAll(noDefaultList);
iotThingDictEntities.addAll(defaultList);
//若是大于当前目前序号则更新当前序号之前的排序
AtomicLong aLong = new AtomicLong(0); AtomicLong aLong = new AtomicLong(0);
QueryWrapper queryWrapper = QueryWrapper.create();
if(iotThingDictEntity.getSort()> toDictEntity.getSort() ){
queryWrapper.where(
IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(0)
.and(
IOT_THING_DICT_ENTITY.SORT.le(iotThingDictEntity.getSort())
.and(IOT_THING_DICT_ENTITY.SORT.ge(toDictEntity.getSort()))
.and(IOT_THING_DICT_ENTITY.ID.ne(id))
)
.or(IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(1)
.and(IOT_THING_DICT_ENTITY.TENANT_CODE.eq(UserContext.getRealTenantCode()))
.and(
IOT_THING_DICT_ENTITY.SORT.le(iotThingDictEntity.getSort())
.and(IOT_THING_DICT_ENTITY.SORT.ge(toDictEntity.getSort()))
)
.and(IOT_THING_DICT_ENTITY.ID.ne(id))
)
);
aLong.set(toDictEntity.getSort()-1);
}else{
queryWrapper.where(
IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(0)
.and(
IOT_THING_DICT_ENTITY.SORT.le(toDictEntity.getSort())
.and(IOT_THING_DICT_ENTITY.SORT.ge(iotThingDictEntity.getSort()))
.and(IOT_THING_DICT_ENTITY.ID.ne(id))
)
.or(IOT_THING_DICT_ENTITY.IS_DEFAULT.eq(1)
.and(IOT_THING_DICT_ENTITY.TENANT_CODE.eq(UserContext.getRealTenantCode()))
.and(
IOT_THING_DICT_ENTITY.SORT.le(toDictEntity.getSort())
.and(IOT_THING_DICT_ENTITY.SORT.ge(iotThingDictEntity.getSort()))
)
.and(IOT_THING_DICT_ENTITY.ID.ne(id))
)
);
aLong.set(iotThingDictEntity.getSort()-1);
}
List<IotThingDictEntity> iotThingDictEntities = mapper.selectListByQuery(queryWrapper);
//若是大于当前目前序号则更新当前序号之前的排序
List<IotThingDictEntity> resList = Lists.newArrayList(); List<IotThingDictEntity> resList = Lists.newArrayList();
if(toDictEntity.getSort()<=sort){ if(toDictEntity.getSort()<=sort){
List<IotThingDictEntity> list = iotThingDictEntities.stream().filter(s -> s.getSort() < sort).toList(); List<IotThingDictEntity> list = iotThingDictEntities.stream().filter(s -> s.getSort() < sort).toList();
@ -419,9 +450,7 @@ public class IotThingDictServiceImpl extends BaseServiceImpl<IotThingDictMapper,
}else{ }else{
List<IotThingDictEntity> list = iotThingDictEntities.stream().filter(s -> s.getSort() <= sort).toList(); List<IotThingDictEntity> list = iotThingDictEntities.stream().filter(s -> s.getSort() <= sort).toList();
list.stream().sorted(Comparator.comparing(IotThingDictEntity::getSort)) list.stream().sorted(Comparator.comparing(IotThingDictEntity::getSort))
.forEach(s -> {
s.setSort(aLong.incrementAndGet());
});
.forEach(s -> s.setSort(aLong.incrementAndGet()));
resList.addAll(list); resList.addAll(list);
iotThingDictEntity.setSort(aLong.incrementAndGet()); iotThingDictEntity.setSort(aLong.incrementAndGet());
resList.add(iotThingDictEntity); resList.add(iotThingDictEntity);

Loading…
Cancel
Save