Commit 741e839b authored by 刘林's avatar 刘林

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

parents 5508f9bc 8af6e25a
...@@ -32,7 +32,7 @@ public class CertDetailServiceImpl { ...@@ -32,7 +32,7 @@ public class CertDetailServiceImpl {
String version = this.deCodeByAES(requestParam.getVersion()); String version = this.deCodeByAES(requestParam.getVersion());
String certType = this.deCodeByBase64(requestParam.getCertType()); String certType = this.deCodeByBase64(requestParam.getCertType());
JgUseRegistrationManageDto jgUseRegistrationManage = this.checkParam(certOrApplyNo, version); JgUseRegistrationManageDto jgUseRegistrationManage = this.checkParam(certOrApplyNo, version);
return SearchDetailStrategyContext.getHandler(this.getManageType(jgUseRegistrationManage)).hanlder(jgUseRegistrationManage, certType); return SearchDetailStrategyContext.getHandler(this.getManageType(jgUseRegistrationManage)).handler(jgUseRegistrationManage, certType);
} }
private String deCodeByBase64(String certType) { private String deCodeByBase64(String certType) {
......
package com.yeejoin.amos.boot.module.app.biz.service.impl; package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto; import com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.app.api.exception.AuthException;
import com.yeejoin.amos.boot.module.app.biz.strategy.ISearchDetailHandler; import com.yeejoin.amos.boot.module.app.biz.strategy.ISearchDetailHandler;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -15,7 +16,8 @@ public class SetSearchDetailDetailHandlerImpl implements ISearchDetailHandler { ...@@ -15,7 +16,8 @@ public class SetSearchDetailDetailHandlerImpl implements ISearchDetailHandler {
} }
@Override @Override
public Map<String, Object> hanlder(JgUseRegistrationManageDto manageDto, String from) { public Map<String, Object> handler(JgUseRegistrationManageDto manageDto, String from) {
return Collections.emptyMap(); throw new AuthException("该设备种类暂不支持扫码,敬请期待!");
// return Collections.emptyMap();
} }
} }
package com.yeejoin.amos.boot.module.app.biz.service.impl; package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto; import com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.app.api.exception.AuthException;
import com.yeejoin.amos.boot.module.app.biz.strategy.ISearchDetailHandler; import com.yeejoin.amos.boot.module.app.biz.strategy.ISearchDetailHandler;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -15,8 +16,9 @@ public class UnitSearchDetailDetailHandlerImpl implements ISearchDetailHandler { ...@@ -15,8 +16,9 @@ public class UnitSearchDetailDetailHandlerImpl implements ISearchDetailHandler {
} }
@Override @Override
public Map<String, Object> hanlder(JgUseRegistrationManageDto manageDto, String from) { public Map<String, Object> handler(JgUseRegistrationManageDto manageDto, String from) {
return Collections.emptyMap(); throw new AuthException("该设备种类暂不支持扫码,敬请期待!");
// return Collections.emptyMap();
} }
} }
...@@ -40,7 +40,7 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle ...@@ -40,7 +40,7 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
} }
@Override @Override
public Map<String, Object> hanlder(JgUseRegistrationManageDto manageDto, String certType) { public Map<String, Object> handler(JgUseRegistrationManageDto manageDto, String certType) {
return this.getQueryCarCylinderInfo(manageDto); return this.getQueryCarCylinderInfo(manageDto);
} }
......
...@@ -18,7 +18,7 @@ public interface ISearchDetailHandler { ...@@ -18,7 +18,7 @@ public interface ISearchDetailHandler {
* @param from 来源 * @param from 来源
* @return T * @return T
*/ */
Map<String, Object> hanlder(JgUseRegistrationManageDto manageDto, String from); Map<String, Object> handler(JgUseRegistrationManageDto manageDto, String from);
String defaultVersion = "1"; String defaultVersion = "1";
} }
...@@ -622,8 +622,9 @@ ...@@ -622,8 +622,9 @@
tz_base_enterprise_info i tz_base_enterprise_info i
WHERE WHERE
i.app_id = f.app_id i.app_id = f.app_id
AND f.filling_endtime >= concat(#{startTime}, ' 00:00:00') AND f.filling_endtime >= concat(#{startTime}, ' 00:00:00')
AND i.org_code like concat(#{orgCode}, '%') AND i.org_code like concat(#{orgCode}, '%')
AND i.unit_type like '%充装单位%'
GROUP BY GROUP BY
filling_time filling_time
ORDER BY ORDER BY
......
...@@ -60,6 +60,15 @@ public class JgUseRegistrationDto extends BaseDto { ...@@ -60,6 +60,15 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "终审通过时间") @ApiModelProperty(value = "终审通过时间")
private Date auditPassDate; private Date auditPassDate;
@ApiModelProperty(value = "办理日期范围")
private String auditPassDateRange;
@ApiModelProperty(value = "办理日期起始日期")
private Date auditPassDateStart;
@ApiModelProperty(value = "办理日期结束日期")
private Date auditPassDateEnd;
@ApiModelProperty(value = "登记类别") @ApiModelProperty(value = "登记类别")
private String regType; private String regType;
......
...@@ -31,7 +31,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -31,7 +31,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
@Param("dto") JgUseRegistrationDto dto, @Param("dto") JgUseRegistrationDto dto,
@Param("roleIds") List<String> roleIds); @Param("roleIds") List<String> roleIds);
List<RegistrationVo> queryRegistrationInIds(@Param("ids") List<String> ids); List<RegistrationVo> queryRegistrationInIds(@Param("dto") JgUseRegistrationDto dto);
Map<String, Object> getDetail(@Param("id") String id); Map<String, Object> getDetail(@Param("id") String id);
......
...@@ -14,49 +14,52 @@ public class RegistrationVo { ...@@ -14,49 +14,52 @@ public class RegistrationVo {
@ExcelProperty(value = "申请日期", index = 1) @ExcelProperty(value = "申请日期", index = 1)
String createDate; String createDate;
@ExcelProperty(value = "登记证来源", index = 2)
String regType;
@ExcelProperty(value = "设备种类", index = 2) @ExcelProperty(value = "设备种类", index = 3)
String equListName; String equListName;
@ExcelProperty(value = "设备类别", index = 3) @ExcelProperty(value = "设备类别", index = 4)
String equCategory; String equCategory;
@ExcelProperty(value = "设备品种", index = 4) @ExcelProperty(value = "设备品种", index = 5)
String equDefine; String equDefine;
@ExcelProperty(value = "设备代码", index = 5) @ExcelProperty(value = "设备代码", index = 6)
String equCode; String equCode;
@ExcelProperty(value = "使用登记证编号", index = 6) @ExcelProperty(value = "使用登记证编号", index = 7)
String useRegistrationCode; String useRegistrationCode;
@ExcelProperty(value = "96333识别码", index = 7) @ExcelProperty(value = "96333识别码", index = 8)
String code96333; String code96333;
@ExcelProperty(value = "监管码", index = 8) @ExcelProperty(value = "监管码", index = 9)
String supervisoryCode; String supervisoryCode;
@ExcelProperty(value = "设备地址", index = 9) @ExcelProperty(value = "设备地址", index = 10)
String fullAddress; String fullAddress;
@ExcelProperty(value = "详细地址", index = 10) @ExcelProperty(value = "详细地址", index = 11)
String detailedAddress; String detailedAddress;
@ExcelProperty(value = "使用单位", index = 11) @ExcelProperty(value = "使用单位", index = 12)
String useUnitName; String useUnitName;
@ExcelProperty(value = "接收机构", index = 12) @ExcelProperty(value = "接收机构", index = 13)
String receiveOrgName; String receiveOrgName;
@ExcelProperty(value = "属地监管部门", index = 13) @ExcelProperty(value = "属地监管部门", index = 14)
String orgBranchName; String orgBranchName;
@ExcelProperty(value = "作废原因", index = 14) @ExcelProperty(value = "作废原因", index = 15)
String cancelReason; String cancelReason;
@ExcelProperty(value = "办理状态", index = 15) @ExcelProperty(value = "办理状态", index = 16)
String status; String status;
@ExcelProperty(value = "办理日期", index = 16) @ExcelProperty(value = "办理日期", index = 17)
String auditPassDate; String auditPassDate;
} }
...@@ -182,6 +182,9 @@ ...@@ -182,6 +182,9 @@
<if test="dto.useUnitCode != null and dto.useUnitCode != ''"> <if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and use_unit_credit_code = #{dto.useUnitCode} and use_unit_credit_code = #{dto.useUnitCode}
</if> </if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' "> <if test="dto.dataType == 'supervision' ">
AND (receive_company_code = #{dto.receiveCompanyCode} or transfer_to_user_ids LIKE concat ('%', AND (receive_company_code = #{dto.receiveCompanyCode} or transfer_to_user_ids LIKE concat ('%',
#{dto.currentUserId}, '%')) #{dto.currentUserId}, '%'))
...@@ -203,19 +206,73 @@ ...@@ -203,19 +206,73 @@
</select> </select>
<select id="queryRegistrationInIds" resultType="com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.RegistrationVo"> <select id="queryRegistrationInIds" resultType="com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.RegistrationVo">
<include refid="page-list"/> select
*
from
(
<include refid="page-list-sub-select"/>
)
<where> <where>
<if test='ids != null'> is_delete = 0
and ur.sequence_nbr in <if test="dto.equList != null and dto.equList != ''">
<foreach collection="ids" item="id" open="(" close=")" separator=","> and equListCode= #{dto.equList}
#{id} </if>
</foreach> <if test="dto.equCategory != null and dto.equCategory != ''">
and equCategoryCode = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
and equDefineCode = #{dto.equDefine}
</if>
<if test="dto.status != null and dto.status != ''">
and status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
and create_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and equCode like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
and code96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
and supervisoryCode like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND fullAddress LIKE CONCAT('%', #{dto.fullAddress}, '%')
</if>
<if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
AND receive_company_code = #{dto.receiveCompanyCode}
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and useUnitName like concat('%',#{dto.useUnitName},'%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and applyNo like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and useRegistrationCode like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' ">
AND (receive_company_code = #{dto.receiveCompanyCode} or transfer_to_user_ids LIKE concat ('%',
#{dto.currentUserId}, '%'))
AND status <![CDATA[<>]]> '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
AND (use_unit_credit_code = #{dto.unitCode} or transfer_to_user_ids LIKE concat ('%',#{dto.currentUserId}, '%'))
</if> </if>
</where> </where>
GROUP BY -- GROUP BY
re.equip_transfer_id -- re.equip_transfer_id
order by order by
ur.create_date DESC, ur.apply_no DESC create_date DESC, applyNo DESC
</select> </select>
<select id="getDetail" resultType="java.util.Map"> <select id="getDetail" resultType="java.util.Map">
......
package com.yeejoin.amos.boot.module.jg.biz.controller; package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.IJgTableDataExportService; import com.yeejoin.amos.boot.module.jg.biz.service.IJgTableDataExportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -91,9 +94,18 @@ public class JgTableDataExportController extends BaseController { ...@@ -91,9 +94,18 @@ public class JgTableDataExportController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/registration") @GetMapping(value = "/registration")
@ApiOperation(httpMethod = "GET", value = "使用登记列表数据导出", notes = "使用登记列表数据导出") @ApiOperation(httpMethod = "GET", value = "使用登记列表数据导出", notes = "使用登记列表数据导出")
public void registrationExport(HttpServletResponse response, String ids) { public void registrationExport(HttpServletResponse response, JgUseRegistrationDto dto) {
Assert.hasText(ids,"未选择导出数据"); ReginParams info = getSelectedOrgInfo();
iJgTableDataExportService.registration(response, Arrays.asList(ids.split(","))); dto.setCurrentUserId(info.getUserModel().getUserId());
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
dto.setDataType(BaseController.COMPANY_TYPE_COMPANY);
dto.setUnitCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(info.getCompany().getCompanyType()) ?
info.getCompany().getCompanyCode().split("_")[1] : info.getCompany().getCompanyCode());
} else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode());
}
iJgTableDataExportService.registration(response, dto);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -27,6 +27,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -27,6 +27,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/** /**
...@@ -111,6 +113,26 @@ public class JgUseRegistrationController extends BaseController { ...@@ -111,6 +113,26 @@ public class JgUseRegistrationController extends BaseController {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION); dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode()); dto.setReceiveCompanyCode(info.getCompany().getCompanyCode());
} }
if (dto.getAuditPassDateRange() != null && !dto.getAuditPassDateRange().isEmpty() && !dto.getAuditPassDateRange().equals("[, ]")) {
String dateRangeStr = dto.getAuditPassDateRange();
String[] dates = dateRangeStr.replace("[", "").replace("]", "").split(", ");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date start = null;
Date end = null;
try {
start = dateFormat.parse(dates[0]);
end = dateFormat.parse(dates[1]);
} catch (ParseException e) {
throw new RuntimeException(e);
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(start);
calendar.add(Calendar.DAY_OF_MONTH, -1);
start = calendar.getTime();
dto.setAuditPassDateStart(start);
dto.setAuditPassDateEnd(end);
}
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds()); Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds());
list.getRecords().forEach(x -> { list.getRecords().forEach(x -> {
x.put("companyType", info.getCompany().getCompanyType()); x.put("companyType", info.getCompany().getCompanyType());
...@@ -252,6 +274,7 @@ public class JgUseRegistrationController extends BaseController { ...@@ -252,6 +274,7 @@ public class JgUseRegistrationController extends BaseController {
/** /**
* 使用登记流程错误数据处理 * 使用登记流程错误数据处理
*
* @param applyNo applyNo * @param applyNo applyNo
* @return s * @return s
*/ */
...@@ -260,7 +283,7 @@ public class JgUseRegistrationController extends BaseController { ...@@ -260,7 +283,7 @@ public class JgUseRegistrationController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "使用登记流程错误数据处理", notes = "使用登记流程错误数据处理") @ApiOperation(httpMethod = "POST", value = "使用登记流程错误数据处理", notes = "使用登记流程错误数据处理")
public ResponseModel<Object> handleErrorForm(@RequestParam("applyNo") String applyNo) { public ResponseModel<Object> handleErrorForm(@RequestParam("applyNo") String applyNo) {
jgUseRegistrationServiceImpl.handleErrorForm(applyNo); jgUseRegistrationServiceImpl.handleErrorForm(applyNo);
return ResponseHelper.buildResponse("申请单【"+applyNo+"】处理成功"); return ResponseHelper.buildResponse("申请单【" + applyNo + "】处理成功");
} }
...@@ -271,12 +294,13 @@ public class JgUseRegistrationController extends BaseController { ...@@ -271,12 +294,13 @@ public class JgUseRegistrationController extends BaseController {
public ResponseModel<Object> saveHistoryEquip(@RequestBody JSONObject map) { public ResponseModel<Object> saveHistoryEquip(@RequestBody JSONObject map) {
JSONObject firstMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("first"))); JSONObject firstMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("first")));
JSONObject secondMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("second"))); JSONObject secondMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("second")));
secondMap.put("type",firstMap.get("type")); secondMap.put("type", firstMap.get("type"));
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.saveHistoryEquip(secondMap)); return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.saveHistoryEquip(secondMap));
} }
/** /**
* 根据使用登记证查询工程装置名称 * 根据使用登记证查询工程装置名称
*
* @param useRegistrationCode 使用登记证 * @param useRegistrationCode 使用登记证
* @return projectContraption * @return projectContraption
*/ */
...@@ -287,7 +311,7 @@ public class JgUseRegistrationController extends BaseController { ...@@ -287,7 +311,7 @@ public class JgUseRegistrationController extends BaseController {
ReginParams selectedOrgInfo = getSelectedOrgInfo(); ReginParams selectedOrgInfo = getSelectedOrgInfo();
String companyCode = selectedOrgInfo.getCompany().getCompanyCode(); String companyCode = selectedOrgInfo.getCompany().getCompanyCode();
String companyType = selectedOrgInfo.getCompany().getCompanyType(); String companyType = selectedOrgInfo.getCompany().getCompanyType();
String useUnitCreditCode = "个人主体".equals(companyType) && companyCode.contains("_")? companyCode.split("_", 2)[1] String useUnitCreditCode = "个人主体".equals(companyType) && companyCode.contains("_") ? companyCode.split("_", 2)[1]
: companyCode; : companyCode;
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("useRegistrationCode", useRegistrationCode); map.put("useRegistrationCode", useRegistrationCode);
......
package com.yeejoin.amos.boot.module.jg.biz.service; package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
...@@ -23,7 +25,7 @@ public interface IJgTableDataExportService { ...@@ -23,7 +25,7 @@ public interface IJgTableDataExportService {
void transfer(HttpServletResponse response, List<String> ids); void transfer(HttpServletResponse response, List<String> ids);
void registration(HttpServletResponse response, List<String> ids); void registration(HttpServletResponse response, JgUseRegistrationDto dto);
void changeRegistrationUnit(HttpServletResponse response, List<String> ids); void changeRegistrationUnit(HttpServletResponse response, List<String> ids);
......
...@@ -3012,9 +3012,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3012,9 +3012,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setUSE_INNER_CODE(useInfo.getUseInnerCode()); esEquipmentDto.setUSE_INNER_CODE(useInfo.getUseInnerCode());
esEquipmentDto.setUSE_ORG_CODE(equipInfoDto.getUseOrgCode()); esEquipmentDto.setUSE_ORG_CODE(equipInfoDto.getUseOrgCode());
esEquipmentDto.setIS_INTO_MANAGEMENT("his".equals(equipInfoDto.getDataSource())); esEquipmentDto.setIS_INTO_MANAGEMENT("his".equals(equipInfoDto.getDataSource()));
if ("his".equals(equipInfoDto.getDataSource())) { esEquipmentDto.setEQU_CODE(registerInfo.getEquCode());
esEquipmentDto.setEQU_CODE(registerInfo.getEquCode());
}
esEquipmentDto.setEQU_CATEGORY_CODE(equipInfoDto.getEquCategoryCode()); esEquipmentDto.setEQU_CATEGORY_CODE(equipInfoDto.getEquCategoryCode());
esEquipmentDto.setEQU_CATEGORY(equipInfoDto.getEquCategory()); esEquipmentDto.setEQU_CATEGORY(equipInfoDto.getEquCategory());
esEquipmentDto.setEQU_LIST_CODE(equipInfoDto.getEquListCode()); esEquipmentDto.setEQU_LIST_CODE(equipInfoDto.getEquListCode());
...@@ -3362,21 +3360,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3362,21 +3360,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getEquCodeType(), "是否有设备代码不能为空;", result); checkNotBlank(data.getEquCodeType(), "是否有设备代码不能为空;", result);
if ("1".equals(data.getEquCodeType())) { if ("1".equals(data.getEquCodeType())) {
checkNotBlank(data.getEquCode(), "设备代码不能为空;", result); checkNotBlank(data.getEquCode(), "设备代码不能为空;", result);
String equCode = data.getEquCode(); Optional.ofNullable(data.getEquCode())
if (equCode.matches("[a-zA-Z0-9]+")) { .ifPresent(equCode -> {
if (equCode.length() <= 17) { if (!equCode.matches("[a-zA-Z0-9]+")) {
result.append("设备代码不能小于17位;"); result.append("设备代码不能包含特殊字符;");
} } else {
if (equCode.length() >= 20) { Stream.of(equCode.length() <= 17 ? "设备代码不能小于17位;" : "",
result.append("设备代码不能大于20位;"); equCode.length() >= 20 ? "设备代码不能大于20位;" : "",
} equCodeList.contains(equCode) ? "设备代码不能重复;" : ""
} else { ).filter(msg -> !msg.isEmpty())
result.append("设备代码不能包含特殊字符;"); .forEach(result::append);
} this.checkEquCodeUniqueness(equCode, result);
if (equCodeList.contains(data.getEquCode())) { }
result.append("设备代码不能重复;"); });
}
this.checkEquCodeUniqueness(data.getEquCode(), result);
} else { } else {
data.setEquCode(""); data.setEquCode("");
} }
...@@ -3389,9 +3385,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3389,9 +3385,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result); checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result);
checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result); checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result);
if ("0".equals(data.getWhetherVehicleCylinder())) { if ("0".equals(data.getWhetherVehicleCylinder())) {
if (factoryNumList.contains(data.getFactoryNum())) {
result.append("出厂编号/产品编码不能重复;");
}
checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result); checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result);
checkFactoryNumUnique(data.getFactoryNum(), data.getProduceUnitCreditCode(), result); checkFactoryNumUnique(data.getFactoryNum(), data.getProduceUnitCreditCode(), result);
} else { } else {
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil; import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.*; import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.*; import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.*;
import com.yeejoin.amos.boot.module.jg.biz.service.IJgTableDataExportService; import com.yeejoin.amos.boot.module.jg.biz.service.IJgTableDataExportService;
...@@ -16,6 +17,10 @@ import java.io.IOException; ...@@ -16,6 +17,10 @@ import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -226,11 +231,37 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService { ...@@ -226,11 +231,37 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService {
* 使用登记列表数据导出 * 使用登记列表数据导出
* *
* @param response 响应 * @param response 响应
* @param ids 数据id * @param dto 筛选面板数据
*/ */
@Override public void registration(HttpServletResponse response, JgUseRegistrationDto dto) {
public void registration(HttpServletResponse response, List<String> ids) { if (dto.getAuditPassDateRange() != null && !dto.getAuditPassDateRange().isEmpty() && !dto.getAuditPassDateRange().equals("[, ]")) {
List<RegistrationVo> exportData = registrationMapper.queryRegistrationInIds(ids); String dateRangeStr = dto.getAuditPassDateRange();
String[] dates = dateRangeStr.replace("[", "").replace("]", "").split(", ");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date start = null;
Date end = null;
try {
start = dateFormat.parse(dates[0]);
end = dateFormat.parse(dates[1]);
} catch (ParseException e) {
throw new RuntimeException(e);
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(start);
calendar.add(Calendar.DAY_OF_MONTH, -1); // 减去一天
start = calendar.getTime();
dto.setAuditPassDateStart(start);
dto.setAuditPassDateEnd(end);
}
List<RegistrationVo> exportData = registrationMapper.queryRegistrationInIds(dto);
for (RegistrationVo vo : exportData) {
if (vo.getRegType()== null) {
vo.setRegType("新增登记");
} else if(vo.getRegType().equals("1")){
vo.setRegType("历史登记");
}
}
ExcelUtil.createTemplate(response, "使用登记列表数据", "使用登记列表", exportData, RegistrationVo.class, null, false); ExcelUtil.createTemplate(response, "使用登记列表数据", "使用登记列表", exportData, RegistrationVo.class, null, false);
} }
......
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
tzs_safety_problem_tracing tzs_safety_problem_tracing
WHERE WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' ) governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND problem_level IS NOT NULL
<if test="now != null and now != ''"> <if test="now != null and now != ''">
AND DATE_FORMAT(problem_time,'%Y-%m') &gt;= #{now} AND DATE_FORMAT(problem_time,'%Y-%m') &gt;= #{now}
</if> </if>
...@@ -372,6 +373,7 @@ ...@@ -372,6 +373,7 @@
from tzs_safety_problem_tracing spt from tzs_safety_problem_tracing spt
<where> <where>
spt.is_delete = false spt.is_delete = false
AND spt.problem_level IS NOT NULL
<if test="problemModel.problemNum != null and problemModel.problemNum != ''"> <if test="problemModel.problemNum != null and problemModel.problemNum != ''">
and spt.problem_num = LIKE CONCAT('%', #{problemModel.problemNum}, '%') and spt.problem_num = LIKE CONCAT('%', #{problemModel.problemNum}, '%')
</if> </if>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
( T.filling_quantity ) ( T.filling_quantity )
FROM FROM
tz_cylinder_filling_record T tz_cylinder_filling_record T
INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id and E.unit_type like '%充装单位%'
WHERE WHERE
E.supervise_org_code LIKE concat ( #{orgCode}, '%' ) E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
</select> </select>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
( T.offloading_volume ) ( T.offloading_volume )
FROM FROM
tz_cylinder_offloading T tz_cylinder_offloading T
INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id and E.unit_type like '%充装单位%'
WHERE WHERE
E.supervise_org_code LIKE concat ( #{orgCode}, '%' ) E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
</select> </select>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
( DISTINCT ( E.app_id ) ) ( DISTINCT ( E.app_id ) )
FROM FROM
tz_cylinder_filling_record tz_cylinder_filling_record
T INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id T INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id and E.unit_type like '%充装单位%'
WHERE WHERE
E.supervise_org_code LIKE concat ( #{orgCode}, '%' ) E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
</select> </select>
......
...@@ -308,8 +308,8 @@ public class AQZSDPStatisticsController { ...@@ -308,8 +308,8 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/page/dp") @PostMapping(value = "/page/dp")
@ApiOperation(httpMethod = "POST",value = "分页查询安全追溯问题-大屏使用", notes = "分页查询安全追溯问题-大屏使用") @ApiOperation(httpMethod = "POST",value = "分页查询安全追溯问题-大屏使用", notes = "分页查询安全追溯问题-大屏使用")
public ResponseModel<Page<SafetyProblemTracingDto>> getProblemRecords(@RequestParam(value = "current") int current, public ResponseModel<Page<SafetyProblemTracingDto>> getProblemRecords(@RequestParam(value = "current",defaultValue = "1") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size",defaultValue = "20") int size,
@RequestBody(required = false) SafetyProblemTracingDto problemModel) { @RequestBody(required = false) SafetyProblemTracingDto problemModel) {
Page<SafetyProblemTracingDto> page = new Page<>(); Page<SafetyProblemTracingDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
......
...@@ -328,10 +328,10 @@ public class CylinderDPStatisticsServiceImpl { ...@@ -328,10 +328,10 @@ public class CylinderDPStatisticsServiceImpl {
result.put("jycqsbCount", this.countForCylinderOverdueInspect(orgCode)); result.put("jycqsbCount", this.countForCylinderOverdueInspect(orgCode));
// 充气量 // 充气量
Long fillingVolumeCount = cylinderStatisticsMapper.countFillingVolumeCount(orgCode); Long fillingVolumeCount = cylinderStatisticsMapper.countFillingVolumeCount(orgCode);
result.put("fillingVolumeCount", fillingVolumeCount == null ? 0L : fillingVolumeCount); result.put("fillingVolumeCount", fillingVolumeCount == null ? 0L : new BigDecimal(fillingVolumeCount).divide(new BigDecimal("10000000")).setScale(3,RoundingMode.HALF_UP).toString());
// 卸液量 // 卸液量
Long dischargeVolumeCount = cylinderStatisticsMapper.countDischargeVolumeCount(orgCode); Long dischargeVolumeCount = cylinderStatisticsMapper.countDischargeVolumeCount(orgCode);
result.put("dischargeVolumeCount", dischargeVolumeCount == null ? 0L : dischargeVolumeCount); result.put("dischargeVolumeCount", dischargeVolumeCount == null ? 0L : new BigDecimal(dischargeVolumeCount).divide(new BigDecimal("10000000")).setScale(3,RoundingMode.HALF_UP).toString());
} else { } else {
this.setDefaultValueIfNoData(result, "cylindersCount", "stationCount", "operatorCount", "liquefiedGasCount", "automotiveGasCount", "industrialGasCount", "useRegistrationQuantityCount", "jylqsbCount", "jycqsbCount","fillingVolumeCount","dischargeVolumeCount"); this.setDefaultValueIfNoData(result, "cylindersCount", "stationCount", "operatorCount", "liquefiedGasCount", "automotiveGasCount", "industrialGasCount", "useRegistrationQuantityCount", "jylqsbCount", "jycqsbCount","fillingVolumeCount","dischargeVolumeCount");
} }
......
...@@ -744,7 +744,7 @@ public class YJDPStatisticsServiceImpl { ...@@ -744,7 +744,7 @@ public class YJDPStatisticsServiceImpl {
lambda.likeRight(AlertUseUnitStatistics::getSupervisoryUnitOrgCode, orgCode); lambda.likeRight(AlertUseUnitStatistics::getSupervisoryUnitOrgCode, orgCode);
} }
String date = DateUtil.formatDate(DateTimeUtil.addMonths(new Date(), -1), "yyyy-MM"); String date = DateUtil.formatDate(DateTimeUtil.addMonths(new Date(), -1), "yyyy-MM");
lambda.ge(AlertUseUnitStatistics::getStatisticsDate, date); lambda.eq(AlertUseUnitStatistics::getStatisticsDate, date);
// 使用单位 // 使用单位
if (!ValidationUtil.isEmpty(detailDto.getCompanyName())){ if (!ValidationUtil.isEmpty(detailDto.getCompanyName())){
lambda.like(AlertUseUnitStatistics::getUseUnit, detailDto.getCompanyName().trim()); lambda.like(AlertUseUnitStatistics::getUseUnit, detailDto.getCompanyName().trim());
...@@ -753,15 +753,16 @@ public class YJDPStatisticsServiceImpl { ...@@ -753,15 +753,16 @@ public class YJDPStatisticsServiceImpl {
if (!ValidationUtil.isEmpty(detailDto.getMaintenanceCompanyName())){ if (!ValidationUtil.isEmpty(detailDto.getMaintenanceCompanyName())){
lambda.like(AlertUseUnitStatistics::getMaintenanceUnit, detailDto.getMaintenanceCompanyName().trim()); lambda.like(AlertUseUnitStatistics::getMaintenanceUnit, detailDto.getMaintenanceCompanyName().trim());
} }
// 开始时间 if(!ValidationUtil.isEmpty(detailDto.getTimeSearchOne())) {
if (!ValidationUtil.isEmpty(detailDto.getTimeSearchOne().getBeginDate())){ // 开始时间
lambda.ge(AlertUseUnitStatistics::getStartDate, detailDto.getTimeSearchOne().getBeginDate()); if (!ValidationUtil.isEmpty(detailDto.getTimeSearchOne().getBeginDate())) {
} lambda.ge(AlertUseUnitStatistics::getStartDate, detailDto.getTimeSearchOne().getBeginDate());
// 结束时间 }
if (!ValidationUtil.isEmpty(detailDto.getTimeSearchOne().getEndDate())){ // 结束时间
lambda.le(AlertUseUnitStatistics::getEndDate, detailDto.getTimeSearchOne().getEndDate()); if (!ValidationUtil.isEmpty(detailDto.getTimeSearchOne().getEndDate())) {
lambda.le(AlertUseUnitStatistics::getEndDate, detailDto.getTimeSearchOne().getEndDate());
}
} }
// 设备类型 // 设备类型
if (!ValidationUtil.isEmpty(detailDto.getEquListCode())){ if (!ValidationUtil.isEmpty(detailDto.getEquListCode())){
lambda.le(AlertUseUnitStatistics::getEquipmentClassificationCode, detailDto.getEquListCode()); lambda.le(AlertUseUnitStatistics::getEquipmentClassificationCode, detailDto.getEquListCode());
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
and open_biz_type = #{tzBaseEnterpriseInfoDto.jyjcType} and open_biz_type = #{tzBaseEnterpriseInfoDto.jyjcType}
</if> </if>
group by unit_code,open_biz_type) t1 group by unit_code,open_biz_type) t1
ON t1.unit_code = unit_code ON t1.unit_code = use_code
</if> </if>
<where> <where>
<!-- <if--> <!-- <if-->
......
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