Commit 3b2027ba authored by tianbo's avatar tianbo

Merge remote-tracking branch 'origin/develop_tzs_main' into develop_tzs_register

parents d9302f7f 76f2e70b
......@@ -44,7 +44,7 @@ public class OpenApiControllerAop {
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany","/bizToken/applyToken",
"/openapi/bizToken/getAppId","/lift/upload","/lift/status","/lift/run","/lift/fault",
"/lift/video/preview","/cylinderPage/serviceProvider","/cylinderPage/getTableInfo",
"/cylinderPage/initCylinderNum","/openapi/appId/setAppId"};
"/cylinderPage/initCylinderNum","/openapi/appId/genAppId"};
// 获取请求路径
for(String uri : url) {
if(request.getRequestURI().indexOf(uri) != -1) {
......
......@@ -3,11 +3,14 @@ package com.yeejoin.amos.api.openapi.controller;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.constant.Constant;
import com.yeejoin.amos.api.openapi.face.model.OpenapiBizTokenModel;
import com.yeejoin.amos.api.openapi.face.service.OpenapiBizTokenService;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
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.RequestParam;
......@@ -26,15 +29,23 @@ public class AppIdMain {
// logger.info("appId信息:", appId);
// System.out.println("appId信息:" + appId);
// }
@Autowired
OpenapiBizTokenService openapiBizTokenService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "生成AppId")
@GetMapping(value = "/setAppId")
public ResponseModel<String> applyAppId (
@RequestParam String apiCompanyCode) throws Exception
{
logger.info("appId信息:",apiCompanyCode);
@ApiOperation(value = "手动为对接企业生成AppId")
@GetMapping(value = "/genAppId")
public ResponseModel<String> applyAppId (@RequestParam String apiCompanyCode, @RequestParam String apiCompanyName) {
logger.info("开始为apiCompanyCode生成对应appId信息:{}",apiCompanyCode);
String appId = DesUtil.encode(apiCompanyCode, Constant.SECRETKEY);
logger.info("appToken信息:",appId);
OpenapiBizTokenModel openapiBizTokenModel = new OpenapiBizTokenModel();
openapiBizTokenModel.setAppId(appId);
openapiBizTokenModel.setApiCompanyCode(apiCompanyCode);
openapiBizTokenModel.setApiCompanyName(apiCompanyName);
openapiBizTokenService.createWithModel(openapiBizTokenModel);
logger.info("appToken信息:{}",appId);
return ResponseHelper.buildResponse(appId);
}
}
......@@ -45,7 +45,7 @@ public enum CylinderTypeFieldValidation {
isNoBulgingOrLeakage2(CylinderType.LIQUEFIED_GAS_LPG, "isNoBulgingOrLeakage", true, false, new String[]{CylinderField.FillStage.AFTER.getCode()}, "瓶体未出现鼓包变形或泄漏等严重缺陷"),
isTemperatureNormal2(CylinderType.LIQUEFIED_GAS_LPG, "isTemperatureNormal", true, false, new String[]{CylinderField.FillStage.AFTER.getCode()}, "瓶体温度没有异常升高的迹象"),
hasWarningAndFillingLabels(CylinderType.LIQUEFIED_GAS_LPG, "hasWarningAndFillingLabels", true, false, new String[]{CylinderField.FillStage.AFTER.getCode()}, "气瓶粘贴警示标签和充装标签)"),
reweighedWithinLimit(CylinderType.LIQUEFIED_GAS_LPG, "hasWarningAndFillingLabels", true, false, new String[]{CylinderField.FillStage.AFTER.getCode()}, "充装量复秤未超重"),
reweighedWithinLimit(CylinderType.LIQUEFIED_GAS_LPG, "reweighedWithinLimit", true, false, new String[]{CylinderField.FillStage.AFTER.getCode()}, "充装量复秤未超重"),
// 压缩气体气瓶 COMPRESSED_GAS
......@@ -106,7 +106,7 @@ public enum CylinderTypeFieldValidation {
oxidizingGasCylinderFreeOfOil(CylinderType.MIXED_GAS, "oxidizingGasCylinderFreeOfOil", true, false, new String[]{CylinderField.FillStage.BEFORE.getCode()}, "氧化性混合气体的瓶体、瓶阀未沾染油脂"),
preTreatedSuccessfully(CylinderType.MIXED_GAS, "preTreatedSuccessfully", true, false, new String[]{CylinderField.FillStage.BEFORE.getCode()}, "气瓶经预处理(抽真空、烘干、置换或组合)合格"),
fillingPressure5(CylinderType.MIXED_GAS, "fillingPressureLessThan", true, false, new String[]{CylinderField.FillStage.FILLING.getCode()}, "充装压力"),
fillingPressure5(CylinderType.MIXED_GAS, "fillingPressure", true, false, new String[]{CylinderField.FillStage.FILLING.getCode()}, "充装压力"),
fillingAmount5(CylinderType.MIXED_GAS, "fillingAmount", true, false, new String[]{CylinderField.FillStage.FILLING.getCode()}, "充装量"),
componentContents(CylinderType.MIXED_GAS, "componentContents", true, false, new String[]{CylinderField.FillStage.FILLING.getCode()}, "各组分含量"),
abnormalConditions5(CylinderType.MIXED_GAS, "abnormalConditions", true, false, new String[]{CylinderField.FillStage.FILLING.getCode()}, "异常情况"),
......
......@@ -58,7 +58,7 @@ public class TmCylinderFillingRecordModel extends CylinderAbstractBaseModel {
private Double acetyleneFillingAmount;
@ApiModelProperty(value = "各组分含量")
private Double componentContents;
private String componentContents;
@ApiModelProperty(value = "标称皮重")
private Double tareWeightNominal;
......
......@@ -64,7 +64,7 @@ public class TmCylinderFillingRecord extends CylinderAbstractBaseEntity {
private Double acetyleneFillingAmount;
@ApiModelProperty(value = "各组分含量")
private Double componentContents;
private String componentContents;
@ApiModelProperty(value = "标称皮重")
private Double tareWeightNominal;
......
......@@ -206,8 +206,9 @@ public class CylinderService {
cylinderFillingMessageEntity.setCylinderNumber(validateResult.getCylinderNumber());
List<String> logMessage = new ArrayList<>();
int errorNumber = 0;
JSONObject error = new JSONObject();
if (!ObjectUtils.isEmpty(validateResult.getBeforeErrorData())) {
JSONObject error = new JSONObject();
errorNumber += validateResult.getBeforeErrorData().size();
error.put("充装前检查错误数据:", validateResult.getBeforeErrorData());
errorData.add(error);
......@@ -216,6 +217,7 @@ public class CylinderService {
}
if (!ObjectUtils.isEmpty(validateResult.getRecordErrorData())) {
JSONObject error = new JSONObject();
errorNumber += validateResult.getRecordErrorData().size();
error.put("充装记录错误数据:", validateResult.getRecordErrorData());
errorData.add(error);
......@@ -224,6 +226,7 @@ public class CylinderService {
}
if (!ObjectUtils.isEmpty(validateResult.getAfterErrorData())) {
JSONObject error = new JSONObject();
errorNumber += validateResult.getAfterErrorData().size();
error.put("充装后复查错误数据:", validateResult.getAfterErrorData());
errorData.add(error);
......@@ -232,6 +235,7 @@ public class CylinderService {
}
if (!ObjectUtils.isEmpty(validateResult.getSeqCodeErrorData())) {
JSONObject error = new JSONObject();
errorNumber += validateResult.getSeqCodeErrorData().size();
error.put("气瓶信息不存在:", validateResult.getSeqCodeErrorData());
errorData.add(error);
......
......@@ -53,7 +53,16 @@ public class OpenapiBizTokenService extends BaseService<OpenapiBizTokenModel, Op
}
public String getByAppId(String appId) {
Map<String, String> unitInfo = baseMapper.queryUnitInfoByAppId(appId);
// 先从iot_openapi_biz_token表中查询(手动创建不需要在平台注册的对接方的appId信息),如果未找到则从业务库企业表查询
OpenapiBizToken openapiBizToken = baseMapper.getByAppId(appId);
Map<String, String> unitInfo = MapUtil.newHashMap();
if (!ValidationUtil.isEmpty(openapiBizToken)) {
unitInfo.put("use_unit_code", openapiBizToken.getApiCompanyCode());
unitInfo.put("use_unit", openapiBizToken.getApiCompanyName());
}
if (ValidationUtil.isEmpty(unitInfo)) {
unitInfo = baseMapper.queryUnitInfoByAppId(appId);
}
if (ValidationUtil.isEmpty(unitInfo)) {
throw new RuntimeException("未找到对接单位信息");
}
......
......@@ -210,7 +210,7 @@ public class ESCylinderFillingInfoDto {
@Field(type = FieldType.Keyword)
@ApiModelProperty(value = "各组分含量")
private Double componentContents;
private String componentContents;
@Field(type = FieldType.Double)
@ApiModelProperty(value = "标称皮重")
......
......@@ -70,7 +70,7 @@ public class CylinderFillingRecord extends CylinderFillingBaseEntity {
private Double acetyleneFillingAmount;
@ApiModelProperty(value = "各组分含量")
private Double componentContents;
private String componentContents;
@ApiModelProperty(value = "标称皮重")
private Double tareWeightNominal;
......
......@@ -29,6 +29,7 @@ import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.time.LocalDate;
......@@ -327,6 +328,9 @@ public class RuleActionHandler {
private List<String> getOpeningSeqs(List<String> useCodes, List<TzBaseUnitLicence> unitLicenceList) {
// 所有符合资质对应证ID
List<String> enterpriseCertSeqs = unitLicenceList.stream().filter(unitLicence -> useCodes.contains(unitLicence.getUnitCode())).map(TzBaseUnitLicence::getEnterpriseCertSeq).collect(Collectors.toList());
if (ValidationUtil.isEmpty(enterpriseCertSeqs)) {
return Collections.emptyList();
}
// 正对应开通ID
return openingApplicationMapper.selectOpeningSeqInEnterpriseCertSeq(enterpriseCertSeqs);
}
......
......@@ -930,6 +930,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
log.error(e.getMessage());
}
System.out.println(userDetailsDtos.size() + "===================");
log.info("生成的完整时间======={}", JSONObject.toJSONString(timeList));
return PlanTaskUtil.genWholeExeData(timeList, plan, userDetailsDtos, route);
}
......@@ -948,6 +949,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
HashMap<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("id", plan.getId());
paramMap.put("next_gen_date", DateUtil.formatDatrToStr(now, "yyyy-MM-dd"));
log.info("insertPlanTaskAndDetNew更新下次任务生成日期======={}", JSONObject.toJSONString(paramMap));
planMapper.updPlanStatusOrGenDate(paramMap);// 更新下次任务生成日期
} else {
try {
......@@ -1079,7 +1081,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
paramMap.put("first_flag", XJConstant.PLAN_FIRST_STATUS_NO);
}
if (DateUtil.str2Date(strGenDate, "yyyy-MM-dd").getTime() - now.getTime() < 0 || org.apache.commons.lang.StringUtils.isBlank(strGenDate)) {
paramMap.put("next_gen_date", DateUtil.formatDatrToStr(now, "yyyy-MM-dd"));
paramMap.put("next_gen_date", DateUtil.formatDatrToStr(now, "yyyy-MM-dd"));//TODO 确认这里now对着不
}
planMapper.updPlanStatusOrGenDate(paramMap);// 更新下次任务生成日期
......
package com.yeejoin.amos.patrol.business.util;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dto.UserDetailsDto;
import com.yeejoin.amos.patrol.business.vo.CalDateVo;
......@@ -11,7 +12,6 @@ import com.yeejoin.amos.patrol.exception.YeeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -562,6 +562,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String,
} else {
wholeList = timeList;
}
log.info("genWholeExeData:{}", JSONObject.toJSONString(wholeList));
return wholeList;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment