From c10d2740c5b55e6d37d5b6a15070db74698e9e09 Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Thu, 9 May 2024 15:11:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=89=BF=E8=AF=BA=E5=92=8C?= =?UTF-8?q?=E8=B4=A3=E4=BB=BB=E7=8A=B6=E5=AF=BC=E5=87=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/bus/CorpPromiseController.java | 76 ++++++++++++++++++- .../bus/CorpResponsibilityController.java | 75 +++++++++++++++++- .../controller/bus/HiddenController.java | 9 ++- .../controller/bus/HiddenExcelController.java | 10 ++- .../datasource/bus/CorpPromiseMapper.java | 4 + .../bus/CorpResponsibilityMapper.java | 3 + .../service/bus/CorpPromiseService.java | 4 + .../bus/CorpResponsibilityService.java | 4 + .../bus/impl/CorpPromiseServiceImpl.java | 10 +++ .../impl/CorpResponsibilityServiceImpl.java | 12 +++ .../util/HiddenExcelImgToSessionView.java | 2 +- .../com/zcloud/util/HiddenExcelImgView.java | 2 +- .../datasource/bus/CorpPromiseMapper.xml | 63 +++++++++++++++ .../bus/CorpResponsibilityMapper.xml | 62 +++++++++++++++ 14 files changed, 320 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/zcloud/controller/bus/CorpPromiseController.java b/src/main/java/com/zcloud/controller/bus/CorpPromiseController.java index 42c1a182..0d675cdf 100644 --- a/src/main/java/com/zcloud/controller/bus/CorpPromiseController.java +++ b/src/main/java/com/zcloud/controller/bus/CorpPromiseController.java @@ -10,14 +10,13 @@ import com.zcloud.service.bus.CorpPromiseDetailsService; import com.zcloud.service.bus.CorpPromisePeopleService; import com.zcloud.service.bus.CorpPromiseService; import com.zcloud.service.bus.ImgFilesService; -import com.zcloud.util.DateUtil; -import com.zcloud.util.Jurisdiction; -import com.zcloud.util.ReturnMap; -import com.zcloud.util.Tools; +import com.zcloud.util.*; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import java.util.*; import java.util.stream.Collectors; @@ -494,4 +493,73 @@ public class CorpPromiseController extends BaseController { map.put("dockData", JSON.toJSONString(dockData)); return map; } + + /** + * 过去隐患列表 + * + * @param page + * @return + * @throws Exception + */ + @RequestMapping(value = "/goListAllSignatureStatus") + @ResponseBody + public Object goListAllSignatureStatus(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + if (pd.get("YEAR").equals("")){ + String year = DateUtil.getYear(); + pd.put("YEAR",year); + } + page.setPd(pd); + List dataList = corpPromiseService.listAllSignatureStatus(page); + map.put("YEAR",pd.getString("YEAR")); + map.put("varList", dataList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /**导出某一个选中项到excel + * @param + * @throws Exception + */ + @RequestMapping(value="/excelSign") + @ResponseBody + public ModelAndView excelSign() throws Exception{ + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + if (pd.get("YEAR").equals("")){ + String year = DateUtil.getYear(); + pd.put("YEAR",year); + } + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("序号"); //1 + titles.add("部门名称"); //2 + titles.add("人员名称"); //3 + titles.add("应签承诺书数量"); //4 + titles.add("已签承诺书数量"); //5 + titles.add("待签承诺书数量"); //6 + dataMap.put("titles", titles); + List varOList = corpPromiseService.listAllSignatureStatus(pd); + ArrayList varList = new ArrayList<>(); + for(int i=0;i map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + if (pd.get("YEAR").equals("")){ + String year = DateUtil.getYear(); + pd.put("YEAR",year); + } + page.setPd(pd); + List dataList = corpResponsibilityService.listAllSignatureStatus(page); + map.put("YEAR",pd.getString("YEAR")); + map.put("varList", dataList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /**导出某一个选中项到excel + * @param + * @throws Exception + */ + @RequestMapping(value="/excelSign") + @ResponseBody + public ModelAndView excelSign() throws Exception{ + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + if (pd.get("YEAR").equals("")){ + String year = DateUtil.getYear(); + pd.put("YEAR",year); + } + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("序号"); //1 + titles.add("部门名称"); //2 + titles.add("人员名称"); //3 + titles.add("应签责任状数量"); //4 + titles.add("已签责任状数量"); //5 + titles.add("待签责任状数量"); //6 + dataMap.put("titles", titles); + List varOList = corpResponsibilityService.listAllSignatureStatus(pd); + ArrayList varList = new ArrayList<>(); + for(int i=0;i hiddenimg = imgMap.get(hidden.getString("HIDDEN_ID") + "--" + "3"); for (int himg = 0; himg < 4; himg++) { if (himg < hiddenimg.size()) { - vpd.put("img" + (15 + himg), hiddenimg.get(himg).getString("FILEPATH")); + vpd.put("img" + (15 + himg), fileUrl + hiddenimg.get(himg).getString("FILEPATH")); imgCountToSession++; } else { vpd.put("var" + (15 + himg), ""); @@ -225,7 +229,7 @@ public class HiddenExcelController extends BaseController { List hiddenimg = imgMap.get(hidden.getString("HIDDEN_ID") + "--" + "4"); for (int himg = 0; himg < 4; himg++) { if (himg < hiddenimg.size()) { - vpd.put("img" + (24 + himg), hiddenimg.get(himg).getString("FILEPATH")); + vpd.put("img" + (24 + himg), fileUrl + hiddenimg.get(himg).getString("FILEPATH")); imgCountToSession++; } else { vpd.put("var" + (24 + himg), ""); @@ -253,7 +257,7 @@ public class HiddenExcelController extends BaseController { List hiddenimg = imgMap.get(acc.getString("HIDDENCHECK_ID") + "--" + "5"); for (int himg = 0; himg < 4; himg++) { if (himg < hiddenimg.size()) { - vpd.put("img" + (34 + himg), hiddenimg.get(himg).getString("FILEPATH")); + vpd.put("img" + (34 + himg), fileUrl + hiddenimg.get(himg).getString("FILEPATH")); imgCountToSession++; } else { vpd.put("var" + (34 + himg), ""); diff --git a/src/main/java/com/zcloud/mapper/datasource/bus/CorpPromiseMapper.java b/src/main/java/com/zcloud/mapper/datasource/bus/CorpPromiseMapper.java index 07ae8cf9..131efc61 100644 --- a/src/main/java/com/zcloud/mapper/datasource/bus/CorpPromiseMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/bus/CorpPromiseMapper.java @@ -33,6 +33,10 @@ public interface CorpPromiseMapper { List dataAlllistPage(Page page); + List getAllSignatureStatuslistPage(Page page); + + List getAllSignatureStatus(PageData pd); + List collateralall(PageData pd); void editpeople(PageData pd); diff --git a/src/main/java/com/zcloud/mapper/datasource/bus/CorpResponsibilityMapper.java b/src/main/java/com/zcloud/mapper/datasource/bus/CorpResponsibilityMapper.java index ca85b6bf..178e4c5e 100644 --- a/src/main/java/com/zcloud/mapper/datasource/bus/CorpResponsibilityMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/bus/CorpResponsibilityMapper.java @@ -42,5 +42,8 @@ public interface CorpResponsibilityMapper { void decPeoplenumInvolved(PageData pd); + List getAllSignatureStatuslistPage(Page page); + + List getAllSignatureStatus(PageData pd); } diff --git a/src/main/java/com/zcloud/service/bus/CorpPromiseService.java b/src/main/java/com/zcloud/service/bus/CorpPromiseService.java index 56eae864..1e1a608f 100644 --- a/src/main/java/com/zcloud/service/bus/CorpPromiseService.java +++ b/src/main/java/com/zcloud/service/bus/CorpPromiseService.java @@ -45,6 +45,10 @@ public interface CorpPromiseService { List listAll(Page page)throws Exception; + List listAllSignatureStatus(Page page)throws Exception; + + List listAllSignatureStatus(PageData pd)throws Exception; + List collateralall(PageData pd)throws Exception; void editpeople(PageData pd)throws Exception; diff --git a/src/main/java/com/zcloud/service/bus/CorpResponsibilityService.java b/src/main/java/com/zcloud/service/bus/CorpResponsibilityService.java index ba862952..ded66587 100644 --- a/src/main/java/com/zcloud/service/bus/CorpResponsibilityService.java +++ b/src/main/java/com/zcloud/service/bus/CorpResponsibilityService.java @@ -56,4 +56,8 @@ public interface CorpResponsibilityService { * @throws Exception */ void delete(PageData pd)throws Exception; + + List listAllSignatureStatus(Page page)throws Exception; + + List listAllSignatureStatus(PageData pd)throws Exception; } diff --git a/src/main/java/com/zcloud/service/bus/impl/CorpPromiseServiceImpl.java b/src/main/java/com/zcloud/service/bus/impl/CorpPromiseServiceImpl.java index e3e0973c..7ea15b23 100644 --- a/src/main/java/com/zcloud/service/bus/impl/CorpPromiseServiceImpl.java +++ b/src/main/java/com/zcloud/service/bus/impl/CorpPromiseServiceImpl.java @@ -54,6 +54,16 @@ public class CorpPromiseServiceImpl implements CorpPromiseService { return corpPromiseMapper.dataAlllistPage(page); } + @Override + public List listAllSignatureStatus(Page page) throws Exception { + return corpPromiseMapper.getAllSignatureStatuslistPage(page); + } + + @Override + public List listAllSignatureStatus(PageData pd) throws Exception { + return corpPromiseMapper.getAllSignatureStatus(pd); + } + @Override public List collateralall(PageData pd) throws Exception { return corpPromiseMapper.collateralall(pd); diff --git a/src/main/java/com/zcloud/service/bus/impl/CorpResponsibilityServiceImpl.java b/src/main/java/com/zcloud/service/bus/impl/CorpResponsibilityServiceImpl.java index 4fc47109..2718cd4d 100644 --- a/src/main/java/com/zcloud/service/bus/impl/CorpResponsibilityServiceImpl.java +++ b/src/main/java/com/zcloud/service/bus/impl/CorpResponsibilityServiceImpl.java @@ -71,4 +71,16 @@ public class CorpResponsibilityServiceImpl implements CorpResponsibilityService public void delete(PageData pd) throws Exception { corpPromiseMapper.delete(pd); } + + + @Override + public List listAllSignatureStatus(Page page) throws Exception { + return corpPromiseMapper.getAllSignatureStatuslistPage(page); + } + + @Override + public List listAllSignatureStatus(PageData pd) throws Exception { + return corpPromiseMapper.getAllSignatureStatus(pd); + } + } diff --git a/src/main/java/com/zcloud/util/HiddenExcelImgToSessionView.java b/src/main/java/com/zcloud/util/HiddenExcelImgToSessionView.java index 2366abae..1344ca72 100644 --- a/src/main/java/com/zcloud/util/HiddenExcelImgToSessionView.java +++ b/src/main/java/com/zcloud/util/HiddenExcelImgToSessionView.java @@ -106,7 +106,7 @@ public class HiddenExcelImgToSessionView extends AbstractXlsView{ continue; } try { - URL url = new URL(beji + varstr); + URL url = new URL(varstr); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(5 * 1000); diff --git a/src/main/java/com/zcloud/util/HiddenExcelImgView.java b/src/main/java/com/zcloud/util/HiddenExcelImgView.java index a447a4bf..b53aa448 100644 --- a/src/main/java/com/zcloud/util/HiddenExcelImgView.java +++ b/src/main/java/com/zcloud/util/HiddenExcelImgView.java @@ -109,7 +109,7 @@ public class HiddenExcelImgView extends AbstractXlsView{ continue; } try { - URL url = new URL(beji + varstr); + URL url = new URL(varstr); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(5 * 1000); diff --git a/src/main/resources/mybatis/datasource/bus/CorpPromiseMapper.xml b/src/main/resources/mybatis/datasource/bus/CorpPromiseMapper.xml index 6e1426ec..59eb7ade 100644 --- a/src/main/resources/mybatis/datasource/bus/CorpPromiseMapper.xml +++ b/src/main/resources/mybatis/datasource/bus/CorpPromiseMapper.xml @@ -197,6 +197,69 @@ order by CREATTIME desc + + + + + + + + SELECT + f.NAME, + v.`NAME` DEPTNAME, + count( DISTINCT b.RESPONSIBILITYPEOPLE_ID ) ALL_SIGN_COUNT, + count( DISTINCT c.RESPONSIBILITYPEOPLE_ID ) SIGNED_COUNT, + count( DISTINCT b.RESPONSIBILITYPEOPLE_ID ) - count( DISTINCT c.RESPONSIBILITYPEOPLE_ID ) NEED_SINGED + FROM + sys_user f + LEFT JOIN bus_corpresponsibility_people b ON b.USER_ID = f.USER_ID AND b.ISRESPONSIBILITY_PEOPLE = '0' AND b.ISDELETE = '0' + LEFT JOIN bus_corpresponsibility_people c ON c.USER_ID = f.USER_ID + AND c.ISSIGN = 1 AND c.ISRESPONSIBILITY_PEOPLE = '0' AND c.ISDELETE = '0' + LEFT JOIN vi_department_all v ON v.DEPARTMENT_ID = f.DEPARTMENT_ID + LEFT JOIN bus_corpresponsibility d ON d.RESPONSIBILITY_ID = b.RESPONSIBILITY_ID + LEFT JOIN bus_corpresponsibility e ON e.RESPONSIBILITY_ID = c.RESPONSIBILITY_ID + WHERE + f.CORPINFO_ID = '6aa255d41602497fa0f934a822820df4' + AND + d.STATE = '0' + AND + ( e.RESPONSIBILITY_ID is null OR e.STATE != '1') + + AND ( date_format( `d`.`CREATTIME`, '%Y' ) = #{pd.YEAR} OR date_format( `e`.`CREATTIME`, '%Y' ) = #{pd.YEAR} ) + + GROUP BY + f.USER_ID + ORDER BY + NEED_SINGED DESC,SIGNED_COUNT DESC, ALL_SIGN_COUNT DESC + + + +