Commit 276bcc4f authored by litengwei's avatar litengwei

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

parents 3dfc4235 ccd69ce1
...@@ -27,4 +27,8 @@ public interface IDataDictionaryService { ...@@ -27,4 +27,8 @@ public interface IDataDictionaryService {
List<DataDictionary> getChildList(String type, String group); List<DataDictionary> getChildList(String type, String group);
List<DataDictionary> getByParent(String parent); List<DataDictionary> getByParent(String parent);
List<DataDictionary> getByTypeAndDesc(String type, String group);
DataDictionary getByExtend(String groupId, String type);
} }
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.*; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Collection; import java.util.Collection;
...@@ -176,4 +177,21 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -176,4 +177,21 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
return this.list(queryWrapper); return this.list(queryWrapper);
} }
@Override
public List<DataDictionary> getByTypeAndDesc(String type, String typeDesc) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.likeRight(DataDictionary::getType,type);
wrapper.likeRight(DataDictionary::getTypeDesc,typeDesc);
return this.list(wrapper);
}
@Override
public DataDictionary getByExtend(String groupId, String type) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DataDictionary::getExtend, groupId);
wrapper.likeRight(DataDictionary::getType, type);
DataDictionary dataDictionary = dataDictionaryMapper.selectOne(wrapper);
return ObjectUtils.isEmpty(dataDictionary) ? new DataDictionary() : dataDictionary;
}
} }
...@@ -30,18 +30,18 @@ public class MyBatisPlusCodeGeneratorTzs { ...@@ -30,18 +30,18 @@ public class MyBatisPlusCodeGeneratorTzs {
/** /**
* 拆分服务名 可根据实际拆分项目进行修改 * 拆分服务名 可根据实际拆分项目进行修改
*/ */
static String ShortName = "ymt"; static String ShortName = "tcm";
/** /**
* 项目api目录 * 项目api目录
*/ */
static String apiAddress = "/amos-boot-system-" + projectShortName + "/" + "amos-boot-module-ymt/" + static String apiAddress = "/amos-boot-system-" + projectShortName + "/" + "amos-boot-module-" + ShortName + "/" +
"amos-boot-module-" + ShortName + "-api/"; "amos-boot-module-" + ShortName + "-api/";
/** /**
* 项目biz目录 * 项目biz目录
*/ */
static String bizAddress = "/amos-boot-system-" + projectShortName + "/" + "amos-boot-module-ymt/" + static String bizAddress = "/amos-boot-system-" + projectShortName + "/" + "amos-boot-module-" + ShortName + "/" +
"amos-boot-module-" + ShortName + "-biz/"; "amos-boot-module-" + ShortName + "-biz/";
/** /**
......
...@@ -207,7 +207,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -207,7 +207,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// alertCalledDto.setRegionCode(elevator.getRegionCode()); // alertCalledDto.setRegionCode(elevator.getRegionCode());
// } // }
String voiceRecord = ""; String voiceRecord = "";
VoiceRecordFile temp = voiceRecordFileServiceImpl.getOne(new LambdaQueryWrapper<VoiceRecordFile>().eq(VoiceRecordFile::getAlertId,id).eq(VoiceRecordFile::getAlertStageCode,"860").orderByAsc(VoiceRecordFile::getRecDate)); VoiceRecordFile temp = voiceRecordFileServiceImpl.getOne(new LambdaQueryWrapper<VoiceRecordFile>().eq(VoiceRecordFile::getAlertId,id).eq(VoiceRecordFile::getAlertStageCode,"860").orderByAsc(VoiceRecordFile::getTelStartTime).last("limit 1"));
if(temp != null) { if(temp != null) {
voiceRecord = temp.getFilePath(); voiceRecord = temp.getFilePath();
} }
......
...@@ -21,7 +21,7 @@ public class EquBaseInfoForWXModel { ...@@ -21,7 +21,7 @@ public class EquBaseInfoForWXModel {
private String county; private String county;
@ApiModelProperty(value = "单位内编号") @ApiModelProperty(value = "单位内编号")
private String uesInnerCode; private String useInnerCode;
} }
...@@ -6,16 +6,28 @@ import com.alibaba.fastjson.TypeReference; ...@@ -6,16 +6,28 @@ import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.app.api.dto.*; import com.yeejoin.amos.boot.module.app.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.app.api.entity.*; import com.yeejoin.amos.boot.module.app.api.dto.EquInfoDto;
import com.yeejoin.amos.boot.module.app.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.app.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.app.api.dto.UseUnitCreditCodeCategoryDto;
import com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.app.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.app.api.entity.EquipmentCategoryData;
import com.yeejoin.amos.boot.module.app.api.entity.SupervisoryCodeInfo;
import com.yeejoin.amos.boot.module.app.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.app.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.app.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentCategoryEnum; import com.yeejoin.amos.boot.module.app.api.enums.EquipmentCategoryEnum;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.app.api.mapper.*; import com.yeejoin.amos.boot.module.app.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryDataMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.SupervisoryCodeInfoMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.UseInfoMapper;
import com.yeejoin.amos.boot.module.app.api.service.IEquipmentCategoryService; import com.yeejoin.amos.boot.module.app.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.app.api.vo.EquipExportVo; import com.yeejoin.amos.boot.module.app.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.app.biz.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.app.biz.dao.ESEquipmentCategory;
...@@ -46,15 +58,23 @@ import org.springframework.util.Assert; ...@@ -46,15 +58,23 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException; import java.io.IOException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.toJSONString; import static com.alibaba.fastjson.JSON.toJSONString;
...@@ -1193,17 +1213,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1193,17 +1213,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", test)); meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", test));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) { // if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); // BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("STATUS")); // String test = QueryParser.escape(map.getString("STATUS"));
if (test.contains("非")) { // if (test.contains("非")) {
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test.replace("非", ""))); // meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test.replace("非", "")));
boolMust.mustNot(meBuilder); // boolMust.mustNot(meBuilder);
} else { // } else {
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test)); // meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test));
boolMust.must(meBuilder); // boolMust.must(meBuilder);
} // }
} // }
if (!ObjectUtils.isEmpty(map.getString("CLAIM_STATUS"))) { if (!ObjectUtils.isEmpty(map.getString("CLAIM_STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("CLAIM_STATUS")); String test = QueryParser.escape(map.getString("CLAIM_STATUS"));
......
...@@ -316,7 +316,9 @@ public class TzsAppService { ...@@ -316,7 +316,9 @@ public class TzsAppService {
if (!ValidationUtil.isEmpty(detailMapList)) { if (!ValidationUtil.isEmpty(detailMapList)) {
map = detailMapList.iterator().next(); map = detailMapList.iterator().next();
} }
map.putAll(getQRCode(record)); if(!ObjectUtils.isEmpty(model.getResult().getRecords().get(0).get("SUPERVISORY_CODE"))){
map.putAll(getQRCode(model.getResult().getRecords().get(0).get("SUPERVISORY_CODE").toString()));
}
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
JSONObject exFactoryJsonObject = new JSONObject(); JSONObject exFactoryJsonObject = new JSONObject();
......
...@@ -6,6 +6,7 @@ import lombok.Getter; ...@@ -6,6 +6,7 @@ import lombok.Getter;
public enum CyclinderStatus { public enum CyclinderStatus {
NOHEGE("3139","不合格"), NOHEGE("3139","不合格"),
NOT_UPLOAD("","未上传"),
HEGE("3140","合格"); HEGE("3140","合格");
private String code; private String code;
private String name; private String name;
......
...@@ -29,8 +29,10 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin ...@@ -29,8 +29,10 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
List<CylinderInfo> getCylinderInfoList(); List<CylinderInfo> getCylinderInfoList();
void updateBatch(@Param("sequenceNbrS") List<Long> sequenceNbrS); void updateBatch(@Param("sequenceNbrS") List<Long> sequenceNbrS);
List<CylinderFilling> queryUnSyncFilling(); List<CylinderFilling> queryUnSyncFilling();
boolean updataSyncFilling(List<String> appIds,List<String> fillingBeforeIds,List<String> sequenceCodes);
boolean updataSyncFilling(@Param("ids") List<Long> appIds);
boolean saveAndBatchInsert(@Param("list") List<CylinderFilling> list); boolean saveAndBatchInsert(@Param("list") List<CylinderFilling> list);
...@@ -40,5 +42,5 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin ...@@ -40,5 +42,5 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
void batchInsertOrUpdate(@Param("list") List<CylinderFillingRecord> list); void batchInsertOrUpdate(@Param("list") List<CylinderFillingRecord> list);
void updateSyncState(@Param("appIds") List<String> appids, @Param("records")List<String> records); void updateSyncState(@Param("ids") List<Long> ids);
} }
...@@ -29,13 +29,13 @@ public interface TzCylinderMapper extends BaseMapper<CylinderInfo> { ...@@ -29,13 +29,13 @@ public interface TzCylinderMapper extends BaseMapper<CylinderInfo> {
List<TzCylinderInspectionDto> getTzCylinderInspectionDto(String sequenceCode, String appId); List<TzCylinderInspectionDto> getTzCylinderInspectionDto(String sequenceCode, String appId);
List<TzCylinderFillingDto> getTzCylinderFillingDto(String sequenceCode); List<TzCylinderFillingDto> getTzCylinderFillingDto(String sequenceCode, String appId);
TzCylinderBeforeCheckDto getTzCylinderBeforeCheck(String fillingBeforeId); TzCylinderBeforeCheckDto getTzCylinderBeforeCheck(String appId, String fillingBeforeId);
List<TzCylinderCheckDto> getTzCylinderCheckItem(); List<TzCylinderCheckDto> getTzCylinderCheckItem();
TzCylinderAfterCheckDto getTzCylinderAfterCheck(String fillingCheckId); TzCylinderAfterCheckDto getTzCylinderAfterCheck(String appId, String fillingCheckId);
List<TzCylinderCheckDto> getTzCylinderAfterCheckItem(); List<TzCylinderCheckDto> getTzCylinderAfterCheckItem();
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<foreach collection="appIdList" item="item" index="index" open="(" close=")" separator=","> <foreach collection="appIdList" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and filling_record_id in and filling_check_id in
<foreach collection="fillingCheckIdList" item="item" index="index" open="(" close=")" separator=","> <foreach collection="fillingCheckIdList" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -71,24 +71,29 @@ ...@@ -71,24 +71,29 @@
<update id="updataSyncFilling"> <update id="updataSyncFilling">
update tm_cylinder_filling set sync_state = 3 update tm_cylinder_filling set sync_state = 3
<where> <where>
<if test="appIds != null and appIds.size() > 0"> <!-- <if test="appIds != null and appIds.size() > 0">-->
app_id in <!-- app_id in-->
<foreach collection="appIds" item="appId" index="index" open="(" close=")" separator=","> <!-- <foreach collection="appIds" item="appId" index="index" open="(" close=")" separator=",">-->
#{appId} <!-- #{appId}-->
</foreach> <!-- </foreach>-->
</if> <!-- </if>-->
<if test="fillingBeforeIds != null and fillingBeforeIds.size() > 0"> <!-- <if test="fillingBeforeIds != null and fillingBeforeIds.size() > 0">-->
and filling_before_id in <!-- and filling_before_id in-->
<foreach collection="fillingBeforeIds" item="fillingBeforeId" index="index" open="(" close=")" separator=","> <!-- <foreach collection="fillingBeforeIds" item="fillingBeforeId" index="index" open="(" close=")" separator=",">-->
#{fillingBeforeId} <!-- #{fillingBeforeId}-->
</foreach> <!-- </foreach>-->
</if> <!-- </if>-->
<if test="sequenceCodes != null and sequenceCodes.size() > 0"> <!-- <if test="sequenceCodes != null and sequenceCodes.size() > 0">-->
and sequence_code in <!-- and sequence_code in-->
<foreach collection="sequenceCodes" item="sequenceCode" index="index" open="(" close=")" separator=","> <!-- <foreach collection="sequenceCodes" item="sequenceCode" index="index" open="(" close=")" separator=",">-->
#{sequenceCode} <!-- #{sequenceCode}-->
</foreach> <!-- </foreach>-->
</if> <!-- </if>-->
sequence_nbr in
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</where> </where>
</update> </update>
...@@ -133,8 +138,7 @@ ...@@ -133,8 +138,7 @@
and cf.filling_before_id is not null and cf.filling_before_id is not null
and cf.sequence_code is not null and cf.sequence_code is not null
and cf.app_id is not null and cf.app_id is not null
ORDER BY
cf.sync_date DESC
LIMIT 1000 LIMIT 1000
</select> </select>
<insert id="saveAndBatchInsert"> <insert id="saveAndBatchInsert">
...@@ -169,8 +173,8 @@ ...@@ -169,8 +173,8 @@
#{item.sequenceNbr}, #{item.sequenceNbr},
#{item.fillingBeforeId}, #{item.fillingBeforeId},
#{item.fillingUnitName}, #{item.fillingUnitName},
#{item.isValid},
#{item.sequenceCode}, #{item.sequenceCode},
#{item.isValid},
#{item.same}, #{item.same},
#{item.isRegulations}, #{item.isRegulations},
#{item.isComplianceWithgbt}, #{item.isComplianceWithgbt},
...@@ -217,38 +221,29 @@ ...@@ -217,38 +221,29 @@
nonconformances = EXCLUDED.nonconformances nonconformances = EXCLUDED.nonconformances
</insert> </insert>
<select id="selectCountTotal" resultType="java.lang.Long"> <select id="selectCountTotal" resultType="java.lang.Long">
SELECT COUNT SELECT
( 1 ) count(1)
FROM FROM
( tm_cylinder_filling_record cfr
SELECT WHERE
sequence_nbr sync_state != 3
FROM
tm_cylinder_filling_record cfr
WHERE
sync_state != 3
AND filling_record_id is not null AND filling_record_id is not null
GROUP BY
cfr.app_id,
cfr.filling_record_id
)
</select> </select>
<select id="fillingRecordSyncRecords" <select id="fillingRecordSyncRecords"
resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord"> resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord">
SELECT SELECT
cfr.*, cfr.*,
'3' sync_state_str,
CAST (( CAST ((
( filling_record_id IS NOT NULL ) + ( filling_before_id IS NOT NULL ) + ( filling_check_id IS NOT NULL ) + ( filling_examine_id IS NOT NULL ) + ( filling_startTime IS NOT NULL ) + ( filling_endTime IS NOT NULL ) + ( filling_user IS NOT NULL ) + ( inspector_name IS NOT NULL ) + ( filling_quantity IS NOT NULL ) + ( temperature IS NOT NULL ) + ( abnormal IS NOT NULL ) ( filling_record_id IS NOT NULL ) + ( filling_before_id IS NOT NULL ) + ( filling_check_id IS NOT NULL ) + ( filling_examine_id IS NOT NULL ) + ( filling_startTime IS NOT NULL ) + ( filling_endTime IS NOT NULL ) + ( filling_user IS NOT NULL ) + ( inspector_name IS NOT NULL ) + ( filling_quantity IS NOT NULL ) + ( temperature IS NOT NULL ) + ( abnormal IS NOT NULL )
) / 11 AS DECIMAL ( 10, 2 )) integrity ) / 11 AS DECIMAL ( 10, 2 )) integrity
FROM tm_cylinder_filling_record cfr where sync_state !=3 and filling_record_id is not null FROM tm_cylinder_filling_record cfr where sync_state !=3 and filling_record_id is not null
ORDER BY cfr.sync_date
LIMIT 5000 LIMIT 1000
</select> </select>
<insert id="batchInsertOrUpdate" > <insert id="batchInsertOrUpdate" >
INSERT INTO tz_cylinder_filling_record_2210 (sequence_nbr, INSERT INTO tz_cylinder_filling_record (sequence_nbr,
filling_record_id, filling_record_id,
filling_starttime, filling_starttime,
filling_endtime, filling_endtime,
...@@ -318,14 +313,14 @@ ...@@ -318,14 +313,14 @@
<update id="updateSyncState"> <update id="updateSyncState">
update tm_cylinder_filling_record set sync_state = 3 update tm_cylinder_filling_record set sync_state = 3
<where> <where>
app_id in sequence_nbr in
<foreach collection="appIds" item="item" index="index" open="(" close=")" separator=","> <foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and filling_record_id in
<foreach collection="records" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<!-- and filling_record_id in-->
<!-- <foreach collection="records" item="item" index="index" open="(" close=")" separator=",">-->
<!-- #{item}-->
<!-- </foreach>-->
</where> </where>
</update> </update>
</mapper> </mapper>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
b.sequence_code AS sequenceCode, b.sequence_code AS sequenceCode,
b.app_id AS appId, b.app_id AS appId,
concat(b.app_id, b.sequence_code) AS appIdAndSequenceCode, concat(b.app_id, b.sequence_code) AS appIdAndSequenceCode,
b.filling_unit_name AS fillingUnitName, tcn.unit_name AS fillingUnitName,
af.inspector AS inspector, af.inspector AS inspector,
af.inspection_date AS inspectionDateAfter, af.inspection_date AS inspectionDateAfter,
af.check_results AS checkResult af.check_results AS checkResult
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
AND date_format ( b.inspection_date, '%Y-%m-%d' ) = date_format ( r.filling_startTime, '%Y-%m-%d' ) and b.sequence_code is not null AND b.app_id is not null AND date_format ( b.inspection_date, '%Y-%m-%d' ) = date_format ( r.filling_startTime, '%Y-%m-%d' ) and b.sequence_code is not null AND b.app_id is not null
LEFT JOIN tz_cylinder_filling_check af ON af.filling_check_id = r.filling_check_id LEFT JOIN tz_cylinder_filling_check af ON af.filling_check_id = r.filling_check_id
AND date_format ( af.inspection_date, '%Y-%m-%d' ) = date_format ( r.filling_startTime, '%Y-%m-%d' ) AND date_format ( af.inspection_date, '%Y-%m-%d' ) = date_format ( r.filling_startTime, '%Y-%m-%d' )
LEFT JOIN tz_cylinder_unit tcn ON tcn.app_id = r.app_id
</select> </select>
<select id="getCylinderFillingRecordTotal" resultType="java.lang.Integer"> <select id="getCylinderFillingRecordTotal" resultType="java.lang.Integer">
......
...@@ -5,15 +5,12 @@ ...@@ -5,15 +5,12 @@
<select id="queryNumAndOutOfDateNum" resultType="java.util.Map"> <select id="queryNumAndOutOfDateNum" resultType="java.util.Map">
SELECT SELECT
count( t.sequence_nbr ) AS cylinderNum, count( t.sequence_nbr ) AS cylinderNum,
l.expiry_date AS fillingPermitDate, (select expiry_date from tz_base_unit_licence where unit_code = u.credit_code ORDER BY expiry_date desc limit 1) AS fillingPermitDate,
count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 END ) AS outOfDateNum count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 END ) AS outOfDateNum
FROM FROM
tz_cylinder_unit U tz_cylinder_unit U
LEFT JOIN tz_cylinder_info AS t ON t.app_id = u.app_id LEFT JOIN tz_cylinder_info AS t ON t.app_id = u.app_id
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code
LEFT JOIN (SELECT * FROM tz_base_unit_licence
GROUP BY unit_code
ORDER BY expiry_date DESC) AS l ON l.unit_code = u.credit_code
WHERE WHERE
u.sequence_nbr = #{sequenceNbr} u.sequence_nbr = #{sequenceNbr}
GROUP BY u.sequence_nbr GROUP BY u.sequence_nbr
......
...@@ -166,7 +166,8 @@ ...@@ -166,7 +166,8 @@
LEFT JOIN tz_cylinder_filling AS CF ON CF.filling_before_id = FR.filling_before_id LEFT JOIN tz_cylinder_filling AS CF ON CF.filling_before_id = FR.filling_before_id
LEFT JOIN tz_cylinder_filling_check AS FC ON FC.filling_check_id = FR.filling_check_id LEFT JOIN tz_cylinder_filling_check AS FC ON FC.filling_check_id = FR.filling_check_id
WHERE WHERE
CF.sequence_code = #{sequence_code} CF.sequence_code = #{sequenceCode}
and FR.app_id = #{appId}
ORDER BY FR.filling_startTime DESC ORDER BY FR.filling_startTime DESC
</select> </select>
...@@ -181,7 +182,7 @@ ...@@ -181,7 +182,7 @@
CF.have_security_documents, CF.have_security_documents,
CF.fill_before_item CF.fill_before_item
FROM tz_cylinder_filling AS CF FROM tz_cylinder_filling AS CF
WHERE CF.filling_before_id=#{fillingBeforeId} WHERE CF.app_id=#{appId} and CF.filling_before_id=#{fillingBeforeId}
</select> </select>
<select id="getTzCylinderCheckItem" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderCheckDto"> <select id="getTzCylinderCheckItem" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderCheckDto">
...@@ -200,7 +201,7 @@ ...@@ -200,7 +201,7 @@
FC.abnormal_temperature, FC.abnormal_temperature,
FC.warning_sign FC.warning_sign
FROM tz_cylinder_filling_check AS FC FROM tz_cylinder_filling_check AS FC
WHERE FC.filling_check_id=#{fillingCheckId} WHERE FC.app_id=#{appId} and FC.filling_check_id=#{fillingCheckId}
</select> </select>
<select id="getTzCylinderAfterCheckItem" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderCheckDto"> <select id="getTzCylinderAfterCheckItem" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderCheckDto">
......
...@@ -16,6 +16,7 @@ import org.springframework.beans.BeanUtils; ...@@ -16,6 +16,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.*; import java.util.*;
...@@ -38,20 +39,21 @@ public class CylSyncServiceImpl { ...@@ -38,20 +39,21 @@ public class CylSyncServiceImpl {
private CylCylinderFillingCheckMapper cylCylinderFillingCheckMapper; private CylCylinderFillingCheckMapper cylCylinderFillingCheckMapper;
public void syncFillingCheckInfo() { public void syncFillingCheckInfo() {
Integer totalSize = sourceFillingCheckServiceImpl.getFillCheckListTotal(); // Integer totalSize = sourceFillingCheckServiceImpl.getFillCheckListTotal();
Integer times; // Integer times;
if (totalSize != 0) { // if (totalSize != 0) {
times = totalSize / 1000; // times = totalSize / 1000;
int last = totalSize % 1000; // int last = totalSize % 1000;
if (last > 0) { // if (last > 0) {
times++; // times++;
} // }
} else { // } else {
return; // return;
} // }
for (int i = 0; i < times; i++) { // for (int i = 0; i < times; i++) {
traverseSave(); // traverseSave();
} // }
traverseSave();
} }
@Transactional @Transactional
...@@ -75,15 +77,16 @@ public class CylSyncServiceImpl { ...@@ -75,15 +77,16 @@ public class CylSyncServiceImpl {
fillingCheckIdList.add(e.getFillingCheckId()); fillingCheckIdList.add(e.getFillingCheckId());
appIdList.add(e.getAppId()); appIdList.add(e.getAppId());
}); });
List<CylinderFillingCheck> clearList = Lists.newArrayList(); // List<CylinderFillingCheck> clearList = Lists.newArrayList();
fillingChecks.stream().collect(Collectors.groupingBy(item -> item.getAppId() + "-" + item.getFillingCheckId(), Collectors.maxBy(Comparator.comparing(CylinderFillingCheck::getSyncDate)))).forEach((k,v) -> { // fillingChecks.stream().collect(Collectors.groupingBy(item -> item.getAppId() + "-" + item.getFillingCheckId(), Collectors.maxBy(Comparator.comparing(CylinderFillingCheck::getSyncDate)))).forEach((k,v) -> {
clearList.add(v.get()); // clearList.add(v.get());
}); // });
//1.更新或插入业务表 //1.更新或插入业务表
fillingCheckMapper.saveOrUpdateByCondition(clearList); fillingCheckMapper.saveOrUpdateByCondition(fillingChecks);
//2.更新源表 //2.更新源表
sourceFillingCheckServiceImpl.updateBatch(appIdList, fillingCheckIdList); sourceFillingCheckServiceImpl.updateBatch(appIdList, fillingCheckIdList);
traverseSave();
} }
} }
...@@ -124,10 +127,18 @@ public class CylSyncServiceImpl { ...@@ -124,10 +127,18 @@ public class CylSyncServiceImpl {
public Object fillingSync() { public Object fillingSync() {
try { try {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
List<CylinderFilling> unSyncFilling = sourceFillingCheckServiceImpl.queryUnSyncFilling(); List<CylinderFilling> unSyncFilling = sourceFillingCheckServiceImpl.queryUnSyncFilling();
stopWatch.stop();
System.out.println("查询时间:"+stopWatch.getTotalTimeSeconds());
while (!unSyncFilling.isEmpty()) { while (!unSyncFilling.isEmpty()) {
fillingDataProcessing(unSyncFilling); fillingDataProcessing(unSyncFilling);
StopWatch stopWatch1 = new StopWatch();
stopWatch1.start();
unSyncFilling = sourceFillingCheckServiceImpl.queryUnSyncFilling(); unSyncFilling = sourceFillingCheckServiceImpl.queryUnSyncFilling();
stopWatch1.stop();
System.out.println("查询2时间:"+stopWatch.getTotalTimeSeconds());
} }
} catch (Exception ex) { } catch (Exception ex) {
return "failed"; return "failed";
...@@ -137,13 +148,14 @@ public class CylSyncServiceImpl { ...@@ -137,13 +148,14 @@ public class CylSyncServiceImpl {
@Transactional(rollbackFor = {Exception.class}) @Transactional(rollbackFor = {Exception.class})
public void fillingDataProcessing(List<CylinderFilling> data) { public void fillingDataProcessing(List<CylinderFilling> data) {
List<String> appIds = new ArrayList<>(); // List<String> appIds = new ArrayList<>();
List<String> fillingBeforeIds = new ArrayList<>(); // List<String> fillingBeforeIds = new ArrayList<>();
List<String> sequenceCodes = new ArrayList<>(); // List<String> sequenceCodes = new ArrayList<>();
List<Long> ids = data.stream().map(CylinderFilling::getSequenceNbr).collect(Collectors.toList());
data.forEach(e -> { data.forEach(e -> {
appIds.add(e.getAppId()); // appIds.add(e.getAppId());
fillingBeforeIds.add(e.getFillingBeforeId()); // fillingBeforeIds.add(e.getFillingBeforeId());
sequenceCodes.add(e.getSequenceCode()); // sequenceCodes.add(e.getSequenceCode());
String isValid = e.getIsValid(); String isValid = e.getIsValid();
if (!ObjectUtil.isEmpty(isValid) && ("1".equals(isValid) || "0".equals(isValid))) { if (!ObjectUtil.isEmpty(isValid) && ("1".equals(isValid) || "0".equals(isValid))) {
CylDictEnum cylDictEnum = CylDictEnum.getEnum(Integer.valueOf(isValid), "isValid"); CylDictEnum cylDictEnum = CylDictEnum.getEnum(Integer.valueOf(isValid), "isValid");
...@@ -201,35 +213,69 @@ public class CylSyncServiceImpl { ...@@ -201,35 +213,69 @@ public class CylSyncServiceImpl {
} }
}); });
StopWatch stopWatch = new StopWatch();
stopWatch.start();
cylCylinderFillingCheckMapper.saveAndBatchInsert(data); cylCylinderFillingCheckMapper.saveAndBatchInsert(data);
sourceFillingCheckServiceImpl.updataSyncFilling(appIds, fillingBeforeIds, sequenceCodes); stopWatch.stop();
System.out.println("插入时间:"+ stopWatch.getTotalTimeSeconds());
StopWatch stopWatch1 = new StopWatch();
stopWatch1.start();
sourceFillingCheckServiceImpl.updataSyncFilling(ids);
stopWatch1.stop();
System.out.println("更新时间:"+ stopWatch1.getTotalTimeSeconds());
} }
@Transactional
public String fillingRecordSync() { public String fillingRecordSync() {
Long count = sourceFillingCheckServiceImpl.fillingRecordSync(); // StopWatch stopWatch = new StopWatch();
Long times = 0L; // stopWatch.start();
if (count != 0) { // Long count = sourceFillingCheckServiceImpl.fillingRecordSync();
times = count / 5000; // stopWatch.stop();
Long last = count % 5000; // System.out.println("统计总数耗时:"+ stopWatch.getTotalTimeSeconds());
if (last > 0) { return fillingRecordMessage();
times++; }
}
} else { @Transactional
return "no data sync"; String fillingRecordMessage(){
} // Long times = 0L;
for (int i = 0; i < times; i++) { // if (count != 0) {
// times = count / 1000;
// Long last = count % 1000;
// if (last > 0) {
// times++;
// }
// } else {
// return "no data sync";
// }
// times = 2L;
// for (int i = 0; i < times; i++) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
List<CylinderFillingRecord> cylinderFillingRecords = sourceFillingCheckServiceImpl.fillingRecordSyncRecords(); List<CylinderFillingRecord> cylinderFillingRecords = sourceFillingCheckServiceImpl.fillingRecordSyncRecords();
cylinderFillingRecords.forEach(item -> { stopWatch.stop();
item.setAbnormal(item.getAbnormal() == 1 ? 3140 : 3139); System.out.println("查询1000条记录耗时:"+ stopWatch.getTotalTimeSeconds());
item.setSyncState(3); if (!ObjectUtils.isEmpty(cylinderFillingRecords)){
}); cylinderFillingRecords.forEach(item -> {
List<String> appIds = cylinderFillingRecords.stream().map(CylinderFillingRecord::getAppId).collect(Collectors.toList()); item.setAbnormal(item.getAbnormal() == 1 ? 3140 : 3139);
List<String> records = cylinderFillingRecords.stream().map(CylinderFillingRecord::getFillingRecordId).collect(Collectors.toList()); item.setSyncState(3);
cylCylinderFillingCheckMapper.batchInsertOrUpdate(cylinderFillingRecords); });
sourceFillingCheckServiceImpl.updateSyncState(appIds, records); // List<String> appIds = cylinderFillingRecords.stream().map(CylinderFillingRecord::getAppId).collect(Collectors.toList());
} // List<String> records = cylinderFillingRecords.stream().map(CylinderFillingRecord::getFillingRecordId).collect(Collectors.toList());
List<Long> ids = cylinderFillingRecords.stream().map(CylinderFillingRecord::getSequenceNbr).collect(Collectors.toList());
StopWatch stopWatch1 = new StopWatch();
stopWatch1.start();
cylCylinderFillingCheckMapper.batchInsertOrUpdate(cylinderFillingRecords);
stopWatch1.stop();
System.out.println("插入数据耗时:"+ stopWatch1.getTotalTimeSeconds());
StopWatch stopWatch2 = new StopWatch();
stopWatch2.start();
sourceFillingCheckServiceImpl.updateSyncState(ids);
stopWatch2.stop();
System.out.println("修改数据耗时:"+ stopWatch2.getTotalTimeSeconds());
fillingRecordMessage();
}
return "ok"; return "ok";
} }
} }
...@@ -21,6 +21,7 @@ import org.elasticsearch.client.RestHighLevelClient; ...@@ -21,6 +21,7 @@ import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
...@@ -376,6 +377,7 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin ...@@ -376,6 +377,7 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
} }
builder.query(boolMust); builder.query(boolMust);
builder.sort("sequenceNbr",SortOrder.DESC);
builder.from((pageNum - 1) * pageSize); builder.from((pageNum - 1) * pageSize);
builder.size(pageSize); builder.size(pageSize);
builder.trackTotalHits(true); builder.trackTotalHits(true);
......
...@@ -34,6 +34,7 @@ import org.elasticsearch.client.RestHighLevelClient; ...@@ -34,6 +34,7 @@ import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -973,6 +974,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -973,6 +974,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
} }
builder.query(boolMust); builder.query(boolMust);
builder.sort("sequenceNbr",SortOrder.DESC);
builder.from((pageNum - 1) * pageSize); builder.from((pageNum - 1) * pageSize);
builder.size(pageSize); builder.size(pageSize);
builder.trackTotalHits(true); builder.trackTotalHits(true);
......
...@@ -54,8 +54,8 @@ public class CylinderSyncServiceImpl { ...@@ -54,8 +54,8 @@ public class CylinderSyncServiceImpl {
return fillingCheckMapper.queryUnSyncFilling(); return fillingCheckMapper.queryUnSyncFilling();
} }
public boolean updataSyncFilling(List<String> appIds,List<String> fillingBeforeIds,List<String> sequenceCodes){ public boolean updataSyncFilling(List<Long> ids){
return fillingCheckMapper.updataSyncFilling(appIds, fillingBeforeIds, sequenceCodes); return fillingCheckMapper.updataSyncFilling(ids);
} }
public Long fillingRecordSync(){ public Long fillingRecordSync(){
...@@ -66,7 +66,7 @@ public class CylinderSyncServiceImpl { ...@@ -66,7 +66,7 @@ public class CylinderSyncServiceImpl {
return fillingCheckMapper.fillingRecordSyncRecords(); return fillingCheckMapper.fillingRecordSyncRecords();
} }
public void updateSyncState(List<String> appIds, List<String> records){ public void updateSyncState(List<Long> ids){
fillingCheckMapper.updateSyncState(appIds, records); fillingCheckMapper.updateSyncState(ids);
} }
} }
\ No newline at end of file
...@@ -113,7 +113,7 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind ...@@ -113,7 +113,7 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
} }
List<TzCylinderInspectionDto> tzCylinderInspectionDtoList = tzCylinderMapper List<TzCylinderInspectionDto> tzCylinderInspectionDtoList = tzCylinderMapper
.getTzCylinderInspectionDto(sequenceCode, appId); .getTzCylinderInspectionDto(sequenceCode, appId);
List<TzCylinderFillingDto> tzCylinderFillingDtoList = tzCylinderMapper.getTzCylinderFillingDto(sequenceCode); List<TzCylinderFillingDto> tzCylinderFillingDtoList = tzCylinderMapper.getTzCylinderFillingDto(sequenceCode, appId);
/** /**
* 取气瓶追溯详情 充装前检查项 名称和结果列表 * 取气瓶追溯详情 充装前检查项 名称和结果列表
...@@ -132,7 +132,7 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind ...@@ -132,7 +132,7 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
} }
List<TzCylinderCheckDto> tzCylinderCheckDtoListResult = new ArrayList<>(); List<TzCylinderCheckDto> tzCylinderCheckDtoListResult = new ArrayList<>();
TzCylinderBeforeCheckDto tzcylinderBeforeCheckDto = tzCylinderMapper TzCylinderBeforeCheckDto tzcylinderBeforeCheckDto = tzCylinderMapper
.getTzCylinderBeforeCheck(tzCylinderFillingDto.getFillingBeforeId()); .getTzCylinderBeforeCheck(appId, tzCylinderFillingDto.getFillingBeforeId());
JSONObject obj = JSONObject.parseObject(JSONObject.toJSONString(tzcylinderBeforeCheckDto)); JSONObject obj = JSONObject.parseObject(JSONObject.toJSONString(tzcylinderBeforeCheckDto));
for (String str : obj.keySet()) { for (String str : obj.keySet()) {
String explain = map.get(str); String explain = map.get(str);
...@@ -157,7 +157,7 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind ...@@ -157,7 +157,7 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) { for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) {
List<TzCylinderCheckDto> tzCylinderAfterCheckDtoListResult = new ArrayList<>(); List<TzCylinderCheckDto> tzCylinderAfterCheckDtoListResult = new ArrayList<>();
TzCylinderAfterCheckDto tzcylinderAfterCheckDto = tzCylinderMapper TzCylinderAfterCheckDto tzcylinderAfterCheckDto = tzCylinderMapper
.getTzCylinderAfterCheck(tzCylinderFillingDto.getFillingCheckId()); .getTzCylinderAfterCheck(appId, tzCylinderFillingDto.getFillingCheckId());;
if (!ValidationUtil.isEmpty(tzcylinderAfterCheckDto)) { if (!ValidationUtil.isEmpty(tzcylinderAfterCheckDto)) {
JSONObject obj = JSONObject.parseObject(JSONObject.toJSONString(tzcylinderAfterCheckDto)); JSONObject obj = JSONObject.parseObject(JSONObject.toJSONString(tzcylinderAfterCheckDto));
for (String str : obj.keySet()) { for (String str : obj.keySet()) {
...@@ -183,8 +183,8 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind ...@@ -183,8 +183,8 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
} }
for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) { for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) {
if (ValidationUtil.isEmpty(tzCylinderFillingDto.getTzCylinderAfterCheckDtoList())) { // 充装后复查记录没有默认不合格 if (ValidationUtil.isEmpty(tzCylinderFillingDto.getTzCylinderAfterCheckDtoList())) { // 充装后复查记录没有默认未上传
tzCylinderFillingDto.setCheckResultsAfter(CyclinderStatus.NOHEGE.getName()); tzCylinderFillingDto.setCheckResultsAfter(CyclinderStatus.NOT_UPLOAD.getName());
} else { } else {
List<TzCylinderCheckDto> collect = tzCylinderFillingDto.getTzCylinderAfterCheckDtoList().stream().filter(dto -> dto.getResult().equals("0")).collect(Collectors.toList()); List<TzCylinderCheckDto> collect = tzCylinderFillingDto.getTzCylinderAfterCheckDtoList().stream().filter(dto -> dto.getResult().equals("0")).collect(Collectors.toList());
if (collect.size() != 0) { if (collect.size() != 0) {
......
...@@ -19,12 +19,12 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/ ...@@ -19,12 +19,12 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.89:${server.port}${server.servlet.context-path}/doc\ eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc\
.html .html
eureka.instance.ip-address=172.16.3.89 eureka.instance.ip-address=172.16.3.17
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
......
spring.application.name=TZS-CYLINDER spring.application.name=TZS-CYLINDER
server.servlet.context-path=/cylinder server.servlet.context-path=/cylinder
server.port=11003 server.port=11003
spring.profiles.active=dev spring.profiles.active=cyl
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
......
package com.yeejoin.amos.boot.module.tcm.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "GroupAndPersonInfoDto", description = "用户组及组内用户相关信息")
public class GroupAndPersonInfoDto {
/**
* 组id
*/
@ApiModelProperty(value = "组id")
private Long groupId;
/**
* 组名称
*/
@ApiModelProperty(value = "组名称")
private String groupName;
/**
* 人员名称
*/
@ApiModelProperty(value = "人员名称")
private String userName;
/**
* 人员id
*/
@ApiModelProperty(value = "人员id")
private String userId;
/**
* 所在单位名称
*/
@ApiModelProperty(value = "所在单位名称")
private String unitName;
/**
* 所在单位统一信用代码
*/
@ApiModelProperty(value = "所在单位统一信用代码")
private String unitCode;
/**
* 所在单位unitOrgCode
*/
@ApiModelProperty(value = "所在单位unitOrgCode")
private String unitOrgCode;
/**
* 企业类型
*/
@ApiModelProperty(value = "企业类型")
private String unitType;
/**
* 企业类型编码
*/
@ApiModelProperty(value = "企业类型编码")
private String unitTypeCode;
/**
* 企业涉及设备类型
*/
@ApiModelProperty(value = "企业涉及设备类型")
private String equipCategory;
/**
* 企业涉及设备类型编码
*/
@ApiModelProperty(value = "企业涉及设备类型编码")
private String equipCategoryCode;
}
package com.yeejoin.amos.boot.module.tcm.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author system_generator
* @date 2023-10-27
*/
@Data
@ApiModel(value="TzsTwoStaffingCompanyDto", description="")
public class TzsTwoStaffingCompanyDto {
@ApiModelProperty(value = "监管单位ID")
private String sequenceNbr;
@ApiModelProperty(value = "监管单位名称")
private String superviseOrgName;
@ApiModelProperty(value = "监管单位orgCode")
private String superviseOrgCode;
@ApiModelProperty(value = "单位类型")
private String unitType;
@ApiModelProperty(value = "企业名称")
private String useUnit;
@ApiModelProperty(value = "企业编码")
private String useCode;
@ApiModelProperty(value = "企业类型")
private String mainCharger;
@ApiModelProperty(value = "完成配备")
private String completeNormal;
@ApiModelProperty(value = "使用单位完成配备")
private String useDone;
@ApiModelProperty(value = "生产单位完成配备")
private String productDone;
@ApiModelProperty(value = "使用且生产完成配备")
private String allDone;
//下述字段待定
@ApiModelProperty(value = "主要负责人数")
private String mainNum;
@ApiModelProperty(value = "安全总监数")
private String majordomoNum;
@ApiModelProperty(value = "安全员数")
private String safetyNum;
@ApiModelProperty(value = "质量安全总监数")
private String QualityMajNumber;
@ApiModelProperty(value = "质量安全员数")
private String QualitySafetyNum;
}
package com.yeejoin.amos.boot.module.tcm.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2023-10-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="TzsTwoStaffingDto", description="")
public class TzsTwoStaffingDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "监管单位ID")
private String supervisoryUnitId;
@ApiModelProperty(value = "监管单位名称")
private String supervisoryUnitName;
@ApiModelProperty(value = "监管单位orgcode")
private String supervisoryUnitOrgcode;
@ApiModelProperty(value = "监管单位等级")
private String supervisoryUnitLevel;
@ApiModelProperty(value = "单位数")
private Integer numberOfUnits;
@ApiModelProperty(value = "已完成单位数")
private Integer numberOfCompletedUnits;
@ApiModelProperty(value = "完成比例")
private String completionRatio;
@ApiModelProperty(value = "已配备主要负责人单位数")
private Integer responsibleUnitsAllocateNumber;
@ApiModelProperty(value = "占比")
private String proportion;
@ApiModelProperty(value = "主要负责人数")
private Integer responsiblePersonsNumber;
@ApiModelProperty(value = "安全总监数")
private Integer safetyDirectorsNumber;
@ApiModelProperty(value = "安全员数")
private Integer safetyOfficersNumber;
@ApiModelProperty(value = "单位类型(1使用单位,2生产单位)")
private String unitType;
}
package com.yeejoin.amos.boot.module.tcm.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2023-10-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tzs_two_staffing")
public class TzsTwoStaffing extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 监管单位ID
*/
@TableField("supervisory_unit_id")
private String supervisoryUnitId;
/**
* 监管单位名称
*/
@TableField("supervisory_unit_name")
private String supervisoryUnitName;
/**
* 监管单位orgcode
*/
@TableField("supervisory_unit_orgcode")
private String supervisoryUnitOrgcode;
/**
* 监管单位等级
*/
@TableField("supervisory_unit_level")
private String supervisoryUnitLevel;
/**
* 单位数
*/
@TableField("number_of_units")
private Integer numberOfUnits;
/**
* 已完成单位数
*/
@TableField("number_of_completed_units")
private Integer numberOfCompletedUnits;
/**
* 完成比例
*/
@TableField("completion_ratio")
private String completionRatio;
/**
* 已配备主要负责人单位数
*/
@TableField("responsible_units_allocate_number")
private Integer responsibleUnitsAllocateNumber;
/**
* 占比
*/
@TableField("proportion")
private String proportion;
/**
* 主要负责人数
*/
@TableField("responsible_persons_number")
private Integer responsiblePersonsNumber;
/**
* 安全总监数
*/
@TableField("safety_directors_number")
private Integer safetyDirectorsNumber;
/**
* 安全员数
*/
@TableField("safety_officers_number")
private Integer safetyOfficersNumber;
/**
* 单位类型(1使用单位,2生产单位)
*/
@TableField("unit_type")
private String unitType;
}
package com.yeejoin.amos.boot.module.tcm.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum SupervisoryEnum {
/**
* 监管单位层级
*/
// 省
PROVINCE("headquarter","prefecture-level"),
// 市
CITY("prefecture-level", "county"),
// 区县
DISTRICT("county", "organization"),
// 所
PLACE("organization", "organization");
String level;
String nextLevel;
public static SupervisoryEnum getEnumByLevel(String level) {
for (SupervisoryEnum value : SupervisoryEnum.values()) {
if (value.getLevel().equals(level)) {
return value;
}
}
return null;
}
}
package com.yeejoin.amos.boot.module.tcm.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum UnitTypeEnum {
/**
* *注册单位类型
*/
sydw("使用单位", "1232"),
czdw("充装单位", "1231"),
jyjcjg("检验检测机构", "1233"),
azgzwxdw("安装改造维修单位", "1234"),
zzdw("制造单位", "1236"),
sjdw("设计单位", "1235"),
grzt("个人主体", "6599");
private String name;
private String code;
public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>();
static {
for (UnitTypeEnum e : UnitTypeEnum.values()) {
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
package com.yeejoin.amos.boot.module.tcm.api.mapper; package com.yeejoin.amos.boot.module.tcm.api.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto; import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
import org.apache.ibatis.annotations.Param;
/** /**
* 企业数据信息 Mapper 接口 * 企业数据信息 Mapper 接口
...@@ -50,4 +52,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -50,4 +52,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
* @return * @return
*/ */
List<TzBaseEnterpriseInfo> listNoQrCode(); List<TzBaseEnterpriseInfo> listNoQrCode();
List<Map<String, Object>> getEquipType(@Param("type")String type);
} }
package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-10-27
*/
public interface TzsTwoStaffingMapper extends BaseMapper<TzsTwoStaffing> {
Page<TzsTwoStaffingCompanyDto> getCompanyList(@Param("page")Page<TzsTwoStaffingCompanyDto> page,
@Param("companyDto") TzsTwoStaffingCompanyDto companyDto,
@Param("orgCode") String orgCode);
List<TzsTwoStaffing> getListByOrgCode(@Param("orgCode")String orgCode, @Param("type")String type, @Param("level")String level);
}
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
...@@ -23,4 +24,10 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> { ...@@ -23,4 +24,10 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
@Param("companyCode") String companyCode, @Param("companyCode") String companyCode,
@Param("userSeq") String userSeq, @Param("userSeq") String userSeq,
@Param("dto") TzsEquipListDto dto); @Param("dto") TzsEquipListDto dto);
List<TzsUserInfo> getUnitPersonInfo();
// List<String> selectUserIds();
List<GroupAndPersonInfoDto> getUnitInfoByUserIds(@Param("userIds")List<String> userIds);
} }
package com.yeejoin.amos.boot.module.tcm.api.service;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
import java.util.LinkedHashMap;
import java.util.List;
/**
* 接口类
*
* @author system_generator
* @date 2023-10-27
*/
public interface ITzsTwoStaffingService {
List<TzsTwoStaffing> getStatisticsMessage(List<LinkedHashMap> list, String type);
Page<TzsTwoStaffingCompanyDto> getCompanyList(String orgCode, TzsTwoStaffingCompanyDto companyDto,Page<TzsTwoStaffingCompanyDto> page);
}
...@@ -3,10 +3,12 @@ package com.yeejoin.amos.boot.module.tcm.api.service; ...@@ -3,10 +3,12 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserQualifications; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserQualifications;
import com.yeejoin.amos.feign.privilege.model.GroupModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,7 +21,7 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> { ...@@ -19,7 +21,7 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
void updateQualificationsMessage(String userId, List<TzsUserQualifications> list); void updateQualificationsMessage(String userId, List<TzsUserQualifications> list);
void deleteBatch(List<Long> ids); void deleteBatch(Object[] ids);
Map<String, Object> getDetail(Long id); Map<String, Object> getDetail(Long id);
...@@ -39,4 +41,14 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> { ...@@ -39,4 +41,14 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
Boolean equipBind(String type, String userSeq, String creditCode, Map<String,Object> map); Boolean equipBind(String type, String userSeq, String creditCode, Map<String,Object> map);
List<TzsUserInfo> getSafetyList(String companyCode); List<TzsUserInfo> getSafetyList(String companyCode);
List<Map<String,Object>> getGroupList();
Map<String,Object> getPersonType();
List<GroupAndPersonInfoDto> getGroupAndPersonInfo(Long groupId);
Boolean createUnitPerson();
// void testGroup();
} }
...@@ -164,5 +164,13 @@ ...@@ -164,5 +164,13 @@
and use_code <![CDATA[<>]]> '' and use_code <![CDATA[<>]]> ''
limit 1000 limit 1000
</select> </select>
<select id="getEquipType" resultType="java.util.Map">
SELECT * FROM "cb_data_dictionary"
<where>
<if test="type != null and type != ''">
type = #{type}
</if>
</where>
</select>
</mapper> </mapper>
<?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.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper">
<select id="getCompanyList" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto">
SELECT
*
FROM
view_two_staffing
where
supervise_org_code like concat('%',#{orgCode},'%')
<if test="companyDto.unitType != '' and companyDto.unitType != null">
and unit_type like concat('%',#{companyDto.unitType},'%')
</if>
<if test="companyDto.useUnit != '' and companyDto.useUnit != null">
and use_unit like concat('%',#{companyDto.useUnit},'%')
</if>
<if test="companyDto.useCode != '' and companyDto.useCode != null">
and use_code like concat('%',#{companyDto.useCode},'%')
</if>
<if test="companyDto.completeNormal != '' and companyDto.completeNormal == 1 ">
and (useDone = '1' or productDone = '1')
</if>
<if test="companyDto.completeNormal != '' and companyDto.completeNormal == 0 ">
and useDone = '0' and productDone = '0'
</if>
</select>
<select id="getListByOrgCode" resultType="com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing">
select *
from tzs_two_staffing
where is_delete = 0
<if test="orgCode != '' and orgCode != null">
and supervisory_unit_orgcode like concat('%',#{orgCode},'%')
</if>
<if test="type != '' and type != null">
and unit_type = #{type}
</if>
<if test="level != '' and level != null">
and supervisory_unit_level = #{level}
</if>
</select>
</mapper>
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
<select id="getArrangementStatistic" resultType="java.util.Map"> <select id="getArrangementStatistic" resultType="java.util.Map">
SELECT SELECT
(SELECT count(1) FROM "tzs_user_info" WHERE unit_code= #{companyCode} AND post_name like '%主要负责人%') principal, (SELECT count(1) FROM "tzs_user_info" WHERE unit_code= #{companyCode} AND post like '%6548%') principal,
(SELECT count(1) FROM "tzs_user_info" WHERE unit_code= #{companyCode} AND post_name like '%安全总监%') majordomo, (SELECT count(1) FROM "tzs_user_info" WHERE unit_code= #{companyCode} AND post like '%6547%') majordomo,
(SELECT count(1) FROM "tzs_user_info" WHERE unit_code= #{companyCode} AND post_name like '%安全员%') safety, (SELECT count(1) FROM "tzs_user_info" WHERE unit_code= #{companyCode} AND post like '%6549%') safety,
(SELECT COUNT( * ) (SELECT COUNT( * )
FROM FROM
"idx_biz_jg_use_info" ibjui "idx_biz_jg_use_info" ibjui
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<select id="getAllEquipList" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto"> <select id="getAllEquipList" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto">
SELECT SELECT
ibjui."SEQUENCE_NBR" id, distinct ibjui."SEQUENCE_NBR" id,
"USE_INNER_CODE" innerCode, "USE_INNER_CODE" innerCode,
"USE_UNIT_NAME" unitName, "USE_UNIT_NAME" unitName,
"USE_ORG_CODE" useOrgCode, "USE_ORG_CODE" useOrgCode,
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
<if test="dto.code96333 != '' and dto.code96333 != null"> <if test="dto.code96333 != '' and dto.code96333 != null">
and "CODE96333" like concat('%',#{dto.code96333},'%') and "CODE96333" like concat('%',#{dto.code96333},'%')
</if> </if>
<if test="dto.userSeq != '' and dto.userSeq != null"> <if test="dto.safety != '' and dto.safety != null">
AND tue.user_seq = #{userSeq} AND tue.user_seq = #{dto.safety}
</if> </if>
<if test="dto.isNotBind != '' and dto.isNotBind != null and dto.isNotBind == 1"> <if test="dto.isNotBind != '' and dto.isNotBind != null and dto.isNotBind == 1">
AND ibjui."SEQUENCE_NBR" IN ( SELECT DISTINCT equip_id FROM tzs_user_equip WHERE credit_code = #{companyCode} ) AND ibjui."SEQUENCE_NBR" IN ( SELECT DISTINCT equip_id FROM tzs_user_equip WHERE credit_code = #{companyCode} )
...@@ -152,4 +152,53 @@ ...@@ -152,4 +152,53 @@
</if> </if>
</select> </select>
<select id="getUnitPersonInfo" resultType="com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo">
SELECT
admin_name as name ,
'344' certificateType,
admin_id_number certificateNum,
name unitName,
'UNLOCK' lockStatus,
unit_code,
admin_tel phone,
admin_user_id amosUserId,
admin_login_name amosUserName
FROM
"tz_flc_reg_unit_info"
</select>
<!-- <select id="selectUserIds" resultType="java.lang.String">-->
<!-- SELECT-->
<!-- amos_user_id-->
<!-- FROM-->
<!-- tzs_user_info tui-->
<!-- LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code-->
<!-- WHERE tui.is_delete = 'f'-->
<!-- AND tui.amos_user_id is NOT null-->
<!-- AND tzei.unit_type IS NOT NULL-->
<!-- GROUP BY tui.amos_user_id-->
<!-- </select>-->
<select id="getUnitInfoByUserIds" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto">
SELECT
tui.amos_user_id userId,
tui.amos_user_name userName,
tui.unit_name,
tui.unit_code,
replace(tzei.unit_type,'#', ',') unitType,
tzei.equip_category
FROM
tzs_user_info tui
LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code
<where>
tzei.equip_category is not null
<if test="userIds != null and userIds.size() > 0">
and amos_user_id in
<foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,7 +9,10 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto; ...@@ -9,7 +9,10 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.PageParam; import com.yeejoin.amos.boot.module.tcm.api.entity.PageParam;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzBaseEnterpriseInfoService; import com.yeejoin.amos.boot.module.tcm.api.service.ITzBaseEnterpriseInfoService;
import com.yeejoin.amos.boot.module.tcm.biz.utils.JsonUtils;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...@@ -18,6 +21,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -18,6 +21,8 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
...@@ -50,6 +55,11 @@ public class TzBaseEnterpriseInfoController { ...@@ -50,6 +55,11 @@ public class TzBaseEnterpriseInfoController {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
/** /**
* 新增企业数据信息 * 新增企业数据信息
* *
...@@ -243,4 +253,19 @@ public class TzBaseEnterpriseInfoController { ...@@ -243,4 +253,19 @@ public class TzBaseEnterpriseInfoController {
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.setLabel(enterpriseIds, enterpriseLabel)); return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.setLabel(enterpriseIds, enterpriseLabel));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getEnterpriseType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "同步企业信息", notes = "同步企业信息")
public ResponseModel<List<Map<String, Object>>> getEnterpriseType() {
return ResponseHelper.buildResponse(tzBaseEnterpriseInfoMapper.getEquipType("UNIT_TYPE_NEW"));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getEquipType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "同步企业信息", notes = "同步企业信息")
public ResponseModel<List<Map<String, Object>>> getEquipType() {
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
return ResponseHelper.buildResponse(resourceJson.get(EquipmentClassifityEnum.BDLS.getCode()));
}
} }
package com.yeejoin.amos.boot.module.tcm.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@RestController
@Api(tags = "统计")
@RequestMapping(value = "/twoStaff")
public class TzsTwoStaffingController extends BaseController {
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
@Autowired
private ITzsTwoStaffingService tzsTwoStaffingService;
@Autowired
private TzsUserInfoServiceImpl tzsUserInfoServiceImpl;
@Autowired
RedisUtils redisUtils;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyList")
@ApiOperation(httpMethod = "GET", value = "企业两员配备情况查询", notes = "企业两员配备情况查询")
public ResponseModel<IPage<TzsTwoStaffingCompanyDto>> getCompanyList(@RequestParam(value = "orgCode") String orgCode,
@RequestParam(value = "current") String current,
@RequestParam(value = "size") String size,
TzsTwoStaffingCompanyDto companyDto) {
Page<TzsTwoStaffingCompanyDto> page = new Page<>();
page.setCurrent(Long.parseLong(current));
page.setSize(Long.parseLong(size));
return ResponseHelper.buildResponse(tzsTwoStaffingService.getCompanyList(orgCode, companyDto,page));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getStatisticsMessage")
@ApiOperation(httpMethod = "GET", value = "监管单位统计信息", notes = "监管单位统计信息")
public ResponseModel<Object> getGroupAndPersonInfo(@RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam("type") String type) {
List<LinkedHashMap> data = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE);
ArrayList<LinkedHashMap> result = new ArrayList<>();
List<LinkedHashMap> list = tzsUserInfoServiceImpl.screenData(result, data, sequenceNbr);
return ResponseHelper.buildResponse(tzsTwoStaffingService.getStatisticsMessage(list, type));
}
}
package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
import com.yeejoin.amos.boot.module.tcm.api.enums.SupervisoryEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
/**
* 服务实现类
*
* @author system_generator
* @date 2023-10-27
*/
@Service
public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, TzsTwoStaffing, TzsTwoStaffingMapper> implements ITzsTwoStaffingService {
@Autowired
TzsTwoStaffingMapper tzsTwoStaffingMapper;
/**
* 分页查询
*/
public Page<TzsTwoStaffingDto> queryForTzsTwoStaffingPage(Page<TzsTwoStaffingDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<TzsTwoStaffingDto> queryForTzsTwoStaffingList() {
return this.queryForList("", false);
}
@Override
public List<TzsTwoStaffing> getStatisticsMessage(List<LinkedHashMap> list, String type) {
String orgCode = null;
String nextLevel = null;
if (!ObjectUtils.isEmpty(list) && !ObjectUtils.isEmpty(list.get(0))) {
orgCode = String.valueOf(list.get(0).get("orgCode"));
SupervisoryEnum enumByLevel = SupervisoryEnum.getEnumByLevel(String.valueOf(list.get(0).get("level")));
nextLevel = !ObjectUtils.isEmpty(enumByLevel) ? enumByLevel.getNextLevel() : null;
}
if (!ObjectUtils.isEmpty(orgCode)) {
List<TzsTwoStaffing> listByOrgCode = this.getBaseMapper().getListByOrgCode(orgCode, type, nextLevel);
TzsTwoStaffing tzsTwoStaffing = new TzsTwoStaffing();
tzsTwoStaffing.setSupervisoryUnitName("汇总");
listByOrgCode.stream().forEach(item -> {
tzsTwoStaffing.setNumberOfUnits(!ObjectUtils.isEmpty(tzsTwoStaffing.getNumberOfUnits()) ? tzsTwoStaffing.getNumberOfUnits() : 0);
tzsTwoStaffing.setNumberOfCompletedUnits(item.getNumberOfCompletedUnits() + (!ObjectUtils.isEmpty(tzsTwoStaffing.getNumberOfCompletedUnits()) ? tzsTwoStaffing.getNumberOfCompletedUnits() : 0));
tzsTwoStaffing.setResponsibleUnitsAllocateNumber(item.getResponsibleUnitsAllocateNumber() + (!ObjectUtils.isEmpty(tzsTwoStaffing.getResponsibleUnitsAllocateNumber()) ? tzsTwoStaffing.getResponsibleUnitsAllocateNumber() : 0));
});
if (ObjectUtils.isEmpty(tzsTwoStaffing.getNumberOfCompletedUnits()) || ObjectUtils.isEmpty(tzsTwoStaffing.getNumberOfUnits()) || tzsTwoStaffing.getNumberOfUnits() == 0 || tzsTwoStaffing.getNumberOfCompletedUnits() == 0) {
tzsTwoStaffing.setCompletionRatio("0");
} else {
tzsTwoStaffing.setCompletionRatio(String.valueOf(tzsTwoStaffing.getNumberOfCompletedUnits() / tzsTwoStaffing.getNumberOfUnits()));
}
if (ObjectUtils.isEmpty(tzsTwoStaffing.getResponsiblePersonsNumber()) || tzsTwoStaffing.getResponsiblePersonsNumber() == 0
|| ObjectUtils.isEmpty(tzsTwoStaffing.getNumberOfUnits()) || tzsTwoStaffing.getNumberOfUnits() == 0) {
tzsTwoStaffing.setProportion("0");
} else {
tzsTwoStaffing.setProportion(String.valueOf(tzsTwoStaffing.getResponsiblePersonsNumber() / tzsTwoStaffing.getNumberOfUnits()));
}
listByOrgCode.add(tzsTwoStaffing);
return listByOrgCode;
}
return null;
}
private List<LinkedHashMap> treeToList(List<LinkedHashMap> result, List<LinkedHashMap> list){
if (!ObjectUtils.isEmpty(list) && !ObjectUtils.isEmpty(list.get(0).get("children"))){
result.addAll((List<LinkedHashMap>)list.get(0).get("children"));
}else {
result.add(list.get(0));
}
return result;
}
@Override
public Page<TzsTwoStaffingCompanyDto> getCompanyList(String orgCode, TzsTwoStaffingCompanyDto companyDto, Page<TzsTwoStaffingCompanyDto> page) {
Page<TzsTwoStaffingCompanyDto> companyList = tzsTwoStaffingMapper.getCompanyList(page, companyDto, orgCode);
if(!ObjectUtils.isEmpty(companyList.getRecords())){
for (TzsTwoStaffingCompanyDto item : companyList.getRecords()) {
if (item.getUnitType().contains("使用单位") && (item.getUnitType().contains("充装单位")
|| item.getUnitType().contains("安装改造维修单位")
|| item.getUnitType().contains("制造单位")
|| item.getUnitType().contains("设计单位"))) {
item.setCompleteNormal(Integer.valueOf(item.getAllDone()) == 1 ? "是" : "否");
continue;
}
if (item.getUnitType().contains("使用单位")) {
item.setCompleteNormal(Integer.valueOf(item.getUseDone()) == 1 ? "是" : "否");
continue;
}
if (item.getUnitType().contains("充装单位")
|| item.getUnitType().contains("安装改造维修单位")
|| item.getUnitType().contains("制造单位")
|| item.getUnitType().contains("设计单位")) {
item.setCompleteNormal(Integer.valueOf(item.getProductDone()) == 1 ? "是" : "否");
continue;
}
}
}
return companyList;
}
}
\ No newline at end of file
...@@ -23,15 +23,14 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseInstitutionDto; ...@@ -23,15 +23,14 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseInstitutionDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.BaseUnitLicence; import com.yeejoin.amos.boot.module.tcm.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsBaseInstitution; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsBaseInstitution;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.tcm.api.enums.CompanyLevelEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.CompanyLevelEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.EnterpriseEnums; import com.yeejoin.amos.boot.module.tcm.api.enums.EnterpriseEnums;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsBaseIndividualityMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsBaseIndividualityMapper;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsBaseInstitutionMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsBaseInstitutionMapper;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.BaseUnitLicenceServiceImpl; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.EquipmentCategoryServiceImpl; import com.yeejoin.amos.boot.module.tcm.biz.service.impl.*;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzBaseEnterpriseInfoServiceImpl;
import com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil; import com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil;
import com.yeejoin.amos.boot.module.tcm.flc.api.dto.RegUnitIcDto; import com.yeejoin.amos.boot.module.tcm.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.tcm.flc.api.dto.RegUnitInfoDto; import com.yeejoin.amos.boot.module.tcm.flc.api.dto.RegUnitInfoDto;
...@@ -144,6 +143,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -144,6 +143,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired @Autowired
TzsBaseInstitutionMapper tzsBaseInstitutionMapper; TzsBaseInstitutionMapper tzsBaseInstitutionMapper;
@Autowired
TzsUserInfoServiceImpl tzsUserInfoService;
private final Logger logger = LogManager.getLogger(RegUnitInfoServiceImpl.class); private final Logger logger = LogManager.getLogger(RegUnitInfoServiceImpl.class);
/** /**
...@@ -833,6 +835,20 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -833,6 +835,20 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
if (userResult == null || userResult.getResult() == null) { if (userResult == null || userResult.getResult() == null) {
throw new BadRequest("单位注册失败"); throw new BadRequest("单位注册失败");
} }
//同步创建为当前注册管理员添加两员配备人员信息
if (userResult.getStatus() == 200) {
TzsUserInfo tzsUserInfo = new TzsUserInfo();
tzsUserInfo.setName(regUnitInfo.getAdminName());
tzsUserInfo.setCertificateType("344");
tzsUserInfo.setLockStatus("UNLOCK");
tzsUserInfo.setCertificateNum(regUnitInfo.getAdminIdNumber());
tzsUserInfo.setUnitName(regUnitInfo.getName());
tzsUserInfo.setUnitCode(regUnitInfo.getUnitCode());
tzsUserInfo.setPhone(regUnitInfo.getAdminTel());
tzsUserInfo.setAmosUserId(userResult.getResult().getUserId());
tzsUserInfo.setAmosUserName(regUnitInfo.getAdminLoginName());
tzsUserInfoService.save(tzsUserInfo);
}
regUnitInfo.setAdminUserId(userResult.getResult().getUserId()); regUnitInfo.setAdminUserId(userResult.getResult().getUserId());
regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr().toString()); regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr().toString());
// 3.3 org_user 创建组织机构 // 3.3 org_user 创建组织机构
......
...@@ -7,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/ ...@@ -7,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.34:${server.port}${server.servlet.context-path}/actuator/health eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.34:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.34:${server.port}${server.servlet.context-path}/doc.html eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.34 eureka.instance.ip-address=172.16.3.17
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
......
...@@ -88,5 +88,6 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -88,5 +88,6 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getEquCategory(@Param("recordList") List<String> recordList); List<Map<String, Object>> getEquCategory(@Param("recordList") List<String> recordList);
List<String> selectXiXianNew();
} }
...@@ -21,7 +21,7 @@ public interface IEquipmentCategoryService { ...@@ -21,7 +21,7 @@ public interface IEquipmentCategoryService {
Page equipClaimOverview(); Page equipClaimOverview();
Map<String, String> createSupervisorCode(Map<String, Object> map, String record); Map<String, String> createSupervisorCode(Map<String, Object> map);
List<LinkedHashMap> getTree(); List<LinkedHashMap> getTree();
List<LinkedHashMap> creatTree(); List<LinkedHashMap> creatTree();
...@@ -42,5 +42,5 @@ public interface IEquipmentCategoryService { ...@@ -42,5 +42,5 @@ public interface IEquipmentCategoryService {
ResponseModel submit(Map<String, Object> map); ResponseModel submit(Map<String, Object> map);
void creatXiXian(); void creatXiXian(String type);
} }
...@@ -569,12 +569,18 @@ ...@@ -569,12 +569,18 @@
<select id="selectWriteXiXian" resultType="java.lang.String"> <select id="selectWriteXiXian" resultType="java.lang.String">
SELECT SELECT
record ibjoi."RECORD"
FROM FROM
idx_biz_jg_other_info "biz_jg_supervisory_code" bjsc
LEFT JOIN idx_biz_jg_other_info ibjoi ON bjsc.code96333 = ibjoi."CODE96333"
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi.record = ibjoi.record
WHERE WHERE
"CODE96333" IN ( SELECT code96333 FROM "biz_jg_supervisory_code" WHERE code96333 LIKE'31%' AND supervisory_code LIKE'D%' AND (status = '1' or status = '2') ) ibjsi."ORG_BRANCH_CODE" LIKE'50*18667%'
AND "CLAIM_STATUS" = '已认领'; AND ( bjsc.code96333 LIKE'31%' OR bjsc.code96333 LIKE'33%' )
AND bjsc.supervisory_code LIKE'D%'
AND ( bjsc.status = '1' OR bjsc.status = '2' )
AND create_status = 0
AND "CLAIM_STATUS" = '已认领'
</select> </select>
<update id="clearCode"> <update id="clearCode">
...@@ -593,13 +599,18 @@ ...@@ -593,13 +599,18 @@
<select id="selectXiXian" resultType="java.lang.String"> <select id="selectXiXian" resultType="java.lang.String">
SELECT SELECT
record ibjoi."RECORD"
FROM FROM
idx_biz_jg_other_info idx_biz_jg_other_info ibjoi
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi.record = ibjoi.record
LEFT JOIN "biz_jg_supervisory_code" bjsc ON bjsc.supervisory_code = ibjoi."SUPERVISORY_CODE"
WHERE WHERE
"RECORD" IN ( SELECT "RECORD" FROM idx_biz_jg_supervision_info WHERE "ORG_BRANCH_CODE" LIKE'50*18667%' ) ibjsi."ORG_BRANCH_CODE" LIKE'50*18667%'
AND "CLAIM_STATUS" = '已认领' AND ibjoi."SUPERVISORY_CODE" NOT LIKE'X%'
AND ( "CODE96333" NOT LIKE'31%' OR "CODE96333" IS NULL ); AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND ( bjsc.status = '1' OR bjsc.status = '2' )
AND create_status = 1
AND "CLAIM_STATUS" = '已认领';
</select> </select>
<delete id="clearSupervisoryCode"> <delete id="clearSupervisoryCode">
...@@ -636,6 +647,37 @@ ...@@ -636,6 +647,37 @@
<delete id="clearSupervisoryCodeAndXiXian"> <delete id="clearSupervisoryCodeAndXiXian">
delete "biz_jg_supervisory_code" WHERE code96333 LIKE '31%' AND supervisory_code LIKE 'D%' AND (status = '1' or status = '2'); DELETE
"biz_jg_supervisory_code"
WHERE
code96333 IN (
SELECT
ibjoi."CODE96333"
FROM
"biz_jg_supervisory_code" bjsc
LEFT JOIN idx_biz_jg_other_info ibjoi ON bjsc.code96333 = ibjoi."CODE96333"
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi.record = ibjoi.record
WHERE
ibjsi."ORG_BRANCH_CODE" LIKE '50*18667%'
AND ( bjsc.code96333 LIKE '31%' OR bjsc.code96333 LIKE '33%' )
AND bjsc.supervisory_code LIKE 'D%'
AND ( bjsc.status = '1' OR bjsc.status = '2' )
AND create_status = 0
AND "CLAIM_STATUS" = '已认领'
);
</delete> </delete>
<select id="selectXiXianNew" resultType="java.lang.String">
SELECT
ibjoi."RECORD"
FROM
idx_biz_jg_other_info ibjoi
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi.record = ibjoi.record
LEFT JOIN "biz_jg_supervisory_code" bjsc ON bjsc.supervisory_code = ibjoi."SUPERVISORY_CODE"
WHERE
ibjsi."ORG_BRANCH_CODE" LIKE'50*18667%'
AND ibjoi."SUPERVISORY_CODE" NOT LIKE'X%'
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND "CLAIM_STATUS" = '已认领';
</select>
</mapper> </mapper>
...@@ -217,7 +217,7 @@ public class EquipmentCategoryController extends BaseController { ...@@ -217,7 +217,7 @@ public class EquipmentCategoryController extends BaseController {
@RequestMapping(value = "/createSupervisorCode", method = RequestMethod.POST) @RequestMapping(value = "/createSupervisorCode", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "生成监管码和96333码", notes = "生成监管码和96333码") @ApiOperation(httpMethod = "POST", value = "生成监管码和96333码", notes = "生成监管码和96333码")
public ResponseModel<Object> createSupervisorCode(@RequestBody Map<String,Object> map) { public ResponseModel<Object> createSupervisorCode(@RequestBody Map<String,Object> map) {
return ResponseHelper.buildResponse(equipmentCategoryService.createSupervisorCode(map,null)); return ResponseHelper.buildResponse(equipmentCategoryService.createSupervisorCode(map));
} }
/** /**
...@@ -307,8 +307,8 @@ public class EquipmentCategoryController extends BaseController { ...@@ -307,8 +307,8 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/creatXiXian") @GetMapping(value = "/creatXiXian")
@ApiOperation(httpMethod = "GET", value = "西咸存量数据处理功能", notes = "西咸存量数据处理功能") @ApiOperation(httpMethod = "GET", value = "西咸存量数据处理功能", notes = "西咸存量数据处理功能")
public ResponseModel<Object> creatXiXian() { public ResponseModel<Object> creatXiXian(@RequestParam String type) {
equipmentCategoryService.creatXiXian(); equipmentCategoryService.creatXiXian(type);
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId> <artifactId>amos-feign-privilege</artifactId>
<version>1.8.5</version> <version>1.8.6</version>
</dependency> </dependency>
<dependency> <dependency>
......
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