zhangtao
dongdingding 1 year ago
parent d22c581902
commit 70247f0480

@ -1,7 +1,6 @@
package com.ruoyi.programManagement.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
@ -38,8 +37,7 @@ public class BKeyEnterpriseController extends BaseController {
/**
*
*
*
* @param req
* @param req
* @return
*/
@GetMapping
@ -112,7 +110,6 @@ public class BKeyEnterpriseController extends BaseController {
}
/**
*
*

@ -237,11 +237,8 @@ public class BPlanEnterpriseController extends BaseController {
List<BPlanEnterprise> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
for (BPlanEnterprise a : list) {
String district = a.getDistrict();
String county = district.substring(0, 7);
String paddedString = String.format("%s%s", county, "000000000");
List<String> countyList = bAdministrativeService.getBydistinct(district, paddedString);
String formattedData = String.join("-", countyList);
a.setDistrict(formattedData);
String countyList = bAdministrativeService.getBydistinct(district);
a.setDistrict(countyList);
}
ExcelUtil<BPlanEnterprise> util = new ExcelUtil<BPlanEnterprise>(BPlanEnterprise.class);
util.exportExcel(response, list, "计划管理数据");

@ -1,40 +1,29 @@
package com.ruoyi.programManagement.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.programManagement.entity.SzEnforExamine;
import com.ruoyi.programManagement.service.ISzEnforExamineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.programManagement.service.ISzEnforExamineService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
*
* @author ruoyi
* @date 2023-09-26
*/
@Api(tags = "现场检查记录")
@RestController
@RequestMapping("/pharmaceuticals/examine")
public class SzEnforExamineController extends BaseController
{
public class SzEnforExamineController extends BaseController {
@Autowired
private ISzEnforExamineService szEnforExamineService;
@ -43,8 +32,7 @@ public class SzEnforExamineController extends BaseController
*/
@ApiOperation("查询现场检查记录列表")
@GetMapping("/list")
public TableDataInfo list(SzEnforExamine szEnforExamine)
{
public TableDataInfo list(SzEnforExamine szEnforExamine) {
startPage();
List<SzEnforExamine> list = szEnforExamineService.selectSzEnforExamineList(szEnforExamine);
return getDataTable(list);
@ -55,8 +43,7 @@ public class SzEnforExamineController extends BaseController
*/
@ApiOperation("导出现场检查记录列表")
@PostMapping("/export")
public void export(HttpServletResponse response, SzEnforExamine szEnforExamine)
{
public void export(HttpServletResponse response, SzEnforExamine szEnforExamine) {
List<SzEnforExamine> list = szEnforExamineService.selectSzEnforExamineList(szEnforExamine);
ExcelUtil<SzEnforExamine> util = new ExcelUtil<SzEnforExamine>(SzEnforExamine.class);
util.exportExcel(response, list, "现场检查记录数据");
@ -67,8 +54,7 @@ public class SzEnforExamineController extends BaseController
*/
@ApiOperation("获取现场检查记录详细信息")
@GetMapping(value = "/{ID}")
public AjaxResult getInfo(@PathVariable("ID") String ID)
{
public AjaxResult getInfo(@PathVariable("ID") String ID) {
return success(szEnforExamineService.selectSzEnforExamineByID(ID));
}
@ -77,8 +63,7 @@ public class SzEnforExamineController extends BaseController
*/
@ApiOperation("新增现场检查记录")
@PostMapping
public AjaxResult add(@RequestBody SzEnforExamine szEnforExamine)
{
public AjaxResult add(@RequestBody SzEnforExamine szEnforExamine) {
return toAjax(szEnforExamineService.insertSzEnforExamine(szEnforExamine));
}
@ -87,8 +72,7 @@ public class SzEnforExamineController extends BaseController
*/
@ApiOperation("修改现场检查记录")
@PutMapping
public AjaxResult edit(@RequestBody SzEnforExamine szEnforExamine)
{
public AjaxResult edit(@RequestBody SzEnforExamine szEnforExamine) {
return toAjax(szEnforExamineService.updateSzEnforExamine(szEnforExamine));
}
@ -97,9 +81,8 @@ public class SzEnforExamineController extends BaseController
*/
@ApiOperation("删除现场检查记录")
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs)
{
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs) {
return toAjax(szEnforExamineService.deleteSzEnforExamineByIDs(IDs));
}
}

@ -1,43 +1,31 @@
package com.ruoyi.programManagement.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.programManagement.entity.SzsAdministrativeDivision;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.service.ISzsAdministrativeDivisionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.programManagement.service.ISzsAdministrativeDivisionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* -_Controller
*
*
* @author ruoyi
* @date 2023-10-17
*/
@Api(tags = "省-工业企业风险评估上报系统_行政区划")
@RestController
@RequestMapping("/pharmaceuticals/administrative")
public class SzsAdministrativeDivisionController extends BaseController
{
public class SzsAdministrativeDivisionController extends BaseController {
@Autowired
private ISzsAdministrativeDivisionService szsAdministrativeDivisionService;
@ -46,8 +34,7 @@ public class SzsAdministrativeDivisionController extends BaseController
*/
@GetMapping("/list")
public TableDataInfo list(SzsAdministrativeDivision szsAdministrativeDivision)
{
public TableDataInfo list(SzsAdministrativeDivision szsAdministrativeDivision) {
startPage();
List<SzsAdministrativeDivision> list = szsAdministrativeDivisionService.selectSzsAdministrativeDivisionList(szsAdministrativeDivision);
return getDataTable(list);
@ -58,8 +45,7 @@ public class SzsAdministrativeDivisionController extends BaseController
*/
@PostMapping("/export")
public void export(HttpServletResponse response, SzsAdministrativeDivision szsAdministrativeDivision)
{
public void export(HttpServletResponse response, SzsAdministrativeDivision szsAdministrativeDivision) {
List<SzsAdministrativeDivision> list = szsAdministrativeDivisionService.selectSzsAdministrativeDivisionList(szsAdministrativeDivision);
ExcelUtil<SzsAdministrativeDivision> util = new ExcelUtil<SzsAdministrativeDivision>(SzsAdministrativeDivision.class);
util.exportExcel(response, list, "省-工业企业风险评估上报系统_行政区划字典数据");
@ -70,8 +56,7 @@ public class SzsAdministrativeDivisionController extends BaseController
*/
@GetMapping(value = "/{ID}")
public AjaxResult getInfo(@PathVariable("ID") String ID)
{
public AjaxResult getInfo(@PathVariable("ID") String ID) {
return success(szsAdministrativeDivisionService.selectSzsAdministrativeDivisionByID(ID));
}
@ -79,8 +64,7 @@ public class SzsAdministrativeDivisionController extends BaseController
* -_
*/
@PostMapping
public AjaxResult add(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision)
{
public AjaxResult add(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision) {
return toAjax(szsAdministrativeDivisionService.insertSzsAdministrativeDivision(szsAdministrativeDivision));
}
@ -89,8 +73,7 @@ public class SzsAdministrativeDivisionController extends BaseController
*/
@PutMapping
public AjaxResult edit(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision)
{
public AjaxResult edit(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision) {
return toAjax(szsAdministrativeDivisionService.updateSzsAdministrativeDivision(szsAdministrativeDivision));
}
@ -98,14 +81,12 @@ public class SzsAdministrativeDivisionController extends BaseController
* -_
*/
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs)
{
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs) {
return toAjax(szsAdministrativeDivisionService.deleteSzsAdministrativeDivisionByIDs(IDs));
}
/**
*
*/
@ -118,7 +99,7 @@ public class SzsAdministrativeDivisionController extends BaseController
for (BAdministrativeTreeRequest item1 : list) {
BAdministrativeTreeRequest parentDto = new BAdministrativeTreeRequest(item1.getCounty(), item1.getSubdistrict(), item1.getInstitutionName());
for (BAdministrativeTreeRequest item2 : listsub) {
if (item2.getCounty()!=null && !item2.getCounty().equals("")){
if (item2.getCounty() != null && !item2.getCounty().equals("")) {
if (item2.getCounty().equals(item1.getSubdistrict())) {
BAdministrativeTreeRequest childDto = new BAdministrativeTreeRequest(item2.getCounty(), item2.getSubdistrict(), item2.getInstitutionName());
parentDto.addChild(childDto);

@ -85,9 +85,8 @@ public interface BAdministrativeMapper {
/**
*
*
* @param district
* @param paddedString
* @param district
* @return
*/
List<String> getBydistinct(@Param("district") String district, @Param("paddedString") String paddedString);
String getBydistinct(@Param("district") String district);
}

@ -1,7 +1,6 @@
package com.ruoyi.programManagement.service;
import com.ruoyi.programManagement.entity.BAdministrative;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
@ -64,19 +63,14 @@ public interface IBAdministrativeService {
public int deleteBAdministrativeById(Long id);
List<BPlanEnterPriseTreeResponse> selectBPlanEnterPriseTreeRequestRequestList(BPlanEnterprisePageRequest req);
/**
*
*
* @param district
* @param paddedString
* @param district
* @return
*/
List<String> getBydistinct(String district, String paddedString);
String getBydistinct(String district);
}

@ -99,8 +99,8 @@ public class BAdministrativeServiceImpl implements IBAdministrativeService {
@Override
public List<String> getBydistinct(String district, String paddedString) {
return bAdministrativeMapper.getBydistinct(district,paddedString);
public String getBydistinct(String district) {
return bAdministrativeMapper.getBydistinct(district);
}

@ -111,16 +111,9 @@
) s
</select>
<select id="getBydistinct" resultType="java.lang.String">
select institution_name
from b_administrative
where county = #{paddedString} and subdistrict =''
union all
select institution_name
from b_administrative
where subdistrict = #{district}
SELECT FULL_NAME FROM `szs_administrative_division` where DISTRICT_CODE = #{district}
</select>
<insert id="insertBAdministrative" parameterType="BAdministrative" useGeneratedKeys="true" keyProperty="id">
insert into b_administrative
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save