Commit fba242b4 authored by tianyiming's avatar tianyiming

修改一码通总览数据相关问题

parent 52ca8c1c
......@@ -36,7 +36,9 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record);
List<Map<String, Object>> getAllUnit();
List<Map<String, Object>> getAllUnit(String unitCode);
List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode);
String getUnitCodeByRecord(String record);
}
package com.yeejoin.amos.boot.module.tzs.api.service;
/**
* 一码通总览数据接口类
*
* @author system_generator
*/
public interface IEquipmentCategoryDataService {
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategoryData;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -37,5 +38,7 @@ public interface IEquipmentCategoryService {
void checkEsData(String id);
List<Map<String,Object>> createEquipmentCategoryData();
List<EquipmentCategoryData> createEquipmentCategoryData(String unitCode);
EquipmentCategoryData updateEquipmentCategoryData(String id);
}
......@@ -149,7 +149,32 @@
</select>
<select id="getAllUnit" resultType="java.util.Map">
SELECT DISTINCT(use_code) ,supervise_org_code FROM "tz_base_enterprise_info"
SELECT DISTINCT u.use_code ,supervise_org_code FROM (
SELECT
DISTINCT( i.use_code ),
supervise_org_code
FROM
"tz_base_enterprise_info" i
RIGHT JOIN
(
SELECT
DISTINCT( use_code )
FROM "tz_base_enterprise_info" a
WHERE
NOT EXISTS ( SELECT DISTINCT (USE_UNIT_CREDIT_CODE) use_code FROM idx_biz_jg_use_info b WHERE a.use_code = b.USE_UNIT_CREDIT_CODE )) c ON i.use_code = c.use_code
UNION all
(SELECT
DISTINCT (USE_UNIT_CREDIT_CODE) unitCode,
ORG_BRANCH_CODE companyCode
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
WHERE USE_UNIT_CREDIT_CODE is NOT NULL AND USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> '' GROUP BY unitCode ORDER BY unitCode )) u
<where>
<if test="unitCode !=null and unitCode != ''">
u.use_code = #{unitCode}
</if>
</where>
</select>
<select id="getCategoryData" resultType="java.util.Map">
......@@ -172,4 +197,8 @@
bjecd."org_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
</select>
<select id="getUnitCodeByRecord" resultType="java.lang.String">
select "USE_UNIT_CREDIT_CODE" from idx_biz_jg_use_info where "RECORD" = #{id}
</select>
</mapper>
......@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
......@@ -248,7 +247,7 @@ public class EquipmentCategoryController extends BaseController {
@ApiOperation(httpMethod = "get", value = "初始化一码通总览数据", notes = "初始化一码通总览数据")
public ResponseModel<Object> createEquipmentCategoryData(){
return ResponseHelper.buildResponse(equipmentCategoryService.createEquipmentCategoryData());
return ResponseHelper.buildResponse(equipmentCategoryService.createEquipmentCategoryData(null));
}
/**
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDataDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategoryData;
import com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryDataMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 一码通总览数据实现类
*
* @author system_generator
*/
@Service
@Slf4j
public class EquipmentCategoryDataServiceImpl extends BaseService<EquipmentCategoryDataDto, EquipmentCategoryData, EquipmentCategoryDataMapper> implements IEquipmentCategoryDataService {
}
\ No newline at end of file
......@@ -88,6 +88,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
SupervisoryCodeInfoMapper supervisoryCodeInfoMapper;
@Autowired
EquipmentCategoryDataMapper equipmentCategoryDataMapper;
@Autowired
EquipmentCategoryDataServiceImpl equipmentCategoryDataService;
@Autowired
PrivilegeFeginService privilegeFeginService;
@Autowired
IdxFeignService idxFeignService;
......@@ -774,12 +780,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
@Autowired
EquipmentCategoryDataMapper equipmentCategoryDataMapper;
@Override
public List<Map<String, Object>> createEquipmentCategoryData() {
List<Map<String,Object>> allUnitList = equipmentCategoryMapper.getAllUnit();
public List<EquipmentCategoryData> createEquipmentCategoryData(String unitCode) {
List<EquipmentCategoryData> list = new ArrayList<>();
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCode);
for (Map<String, Object> map : allUnitList) {
EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData();
equipmentCategoryData.setOrgCode(map.get("supervise_org_code").toString());
......@@ -818,11 +822,21 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
break;
}
}
int insert = equipmentCategoryDataMapper.insert(equipmentCategoryData);
System.out.println(insert);
boolean b = equipmentCategoryDataService.saveOrUpdate(equipmentCategoryData,
new QueryWrapper<EquipmentCategoryData>().eq("unit_code", equipmentCategoryData.getUnitCode()));
if (b) {
list.add(equipmentCategoryData);
}
}
return list;
}
return null;
@Override
public EquipmentCategoryData updateEquipmentCategoryData(String record) {
String unitCode = equipmentCategoryMapper.getUnitCodeByRecord(record);
List<EquipmentCategoryData> equipmentCategoryData = createEquipmentCategoryData(unitCode);
return equipmentCategoryData.get(0);
}
......
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