From d2932af28d5ad9538ed49c5e1b3c433c1544aec2 Mon Sep 17 00:00:00 2001 From: "277151821@qq.com" <277151821@qq.com> Date: Mon, 13 May 2024 17:45:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BD=90=E6=A3=80=E9=A1=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/ImgFilesController.java | 2 +- .../TankTruckInspectionController.java | 175 ++++++++++++ .../TankTruckInspectionRecordController.java | 216 +++++++++++++++ .../TankTruckInspectionMapper.java | 64 +++++ .../TankTruckInspectionRecordMapper.java | 58 ++++ .../TankTruckInspectionRecordService.java | 61 ++++ .../TankTruckInspectionService.java | 63 +++++ .../TankTruckInspectionRecordServiceImpl.java | 88 ++++++ .../impl/TankTruckInspectionServiceImpl.java | 118 ++++++++ .../TankTruckInspectionMapper.xml | 231 +++++++++++++++ .../TankTruckInspectionRecordMapper.xml | 262 ++++++++++++++++++ 11 files changed, 1337 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionController.java create mode 100644 src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionRecordController.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.java create mode 100644 src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionRecordService.java create mode 100644 src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionService.java create mode 100644 src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionRecordServiceImpl.java create mode 100644 src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionServiceImpl.java create mode 100644 src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionMapper.xml create mode 100644 src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.xml diff --git a/src/main/java/com/zcloud/controller/system/ImgFilesController.java b/src/main/java/com/zcloud/controller/system/ImgFilesController.java index c886d1f..0081abf 100644 --- a/src/main/java/com/zcloud/controller/system/ImgFilesController.java +++ b/src/main/java/com/zcloud/controller/system/ImgFilesController.java @@ -62,7 +62,7 @@ public class ImgFilesController extends BaseController { // 保存文件 File tempFile = new File(file.getOriginalFilename()); FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); - if(!FileUpload.isImage(tempFile) && !TYPE.equals("2") && !TYPE.equals("3") && !TYPE.equals("129")) {//四色图改为json文件,不用判断类型 + if(!FileUpload.isImage(tempFile) && !TYPE.equals("2") && !TYPE.equals("3") && !TYPE.equals("129") && !TYPE.equals("130")) {//四色图改为json文件,不用判断类型 map.put("result", "failed"); map.put("exception", "上传图片格式不正确,请重新上传"); return map; diff --git a/src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionController.java b/src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionController.java new file mode 100644 index 0000000..3c651c5 --- /dev/null +++ b/src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionController.java @@ -0,0 +1,175 @@ +package com.zcloud.controller.tankTruckInspection; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.logs.LogAnno; +import com.zcloud.service.tankTruckInspection.TankTruckInspectionService; +import com.zcloud.util.*; +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 java.util.*; + +/** + * 罐检项配置 + */ +@Controller +@RequestMapping("/tankTruckInspection") +public class TankTruckInspectionController extends BaseController { + + @Autowired + private TankTruckInspectionService tankTruckInspectionService; + + + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + // @RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "新增") + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("TANKTRUCKINSPECTION_ID", this.get32UUID()); //主键 + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + tankTruckInspectionService.save(pd); + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /** + * 删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/delete") + // @RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "删除") + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id + pd.put("DELETEORNAME", Jurisdiction.getName()); //删除人 + pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间 + tankTruckInspectionService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + // @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "修改") + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id + pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + tankTruckInspectionService.edit(pd); + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + + /** + * 列表分页 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + // @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "列表") + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + page.setPd(pd); + List varList = tankTruckInspectionService.list(page); //列出Question列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + // @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "去修改页面获取数据") + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd = tankTruckInspectionService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + + /** + * 列表无分页 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/tankTruckInspectionListAll") + // @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "列表") + public Object tankTruckInspectionListAll() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + List list = tankTruckInspectionService.tankTruckInspectionListAll(pd); //列出Question列表 + map.put("list", list); + map.put("result", errInfo); + return map; + } + + +} diff --git a/src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionRecordController.java b/src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionRecordController.java new file mode 100644 index 0000000..f9c74a0 --- /dev/null +++ b/src/main/java/com/zcloud/controller/tankTruckInspection/TankTruckInspectionRecordController.java @@ -0,0 +1,216 @@ +package com.zcloud.controller.tankTruckInspection; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.logs.LogAnno; +import com.zcloud.service.system.ImgFilesService; +import com.zcloud.service.tankTruckInspection.TankTruckInspectionRecordService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Jurisdiction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 罐检项检查 + */ +@Controller +@RequestMapping("/tankTruckInspectionRecord") +public class TankTruckInspectionRecordController extends BaseController { + + @Autowired + private TankTruckInspectionRecordService tankTruckInspectionRecordService; + @Autowired + private ImgFilesService imgfilesService; + + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + // @RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR) + @ResponseBody + @Transactional + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "新增") + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String TANKTRUCKINSPECTIONRECORD_ID = this.get32UUID(); + pd.put("TANKTRUCKINSPECTIONRECORD_ID", TANKTRUCKINSPECTIONRECORD_ID); //主键 + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + tankTruckInspectionRecordService.save(pd); + if (pd.get("DETAILS") != null && !pd.get("DETAILS").equals("")) { + List list = (List) JSON.parse(pd.get("DETAILS").toString()); + for (int i = 0; i < list.size(); i++) { + JSONObject json = list.get(i); + PageData itme = new PageData(); + itme.put("RECORDDETAIL_ID", this.get32UUID()); //主键 + itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + itme.put("MAIN_ID", TANKTRUCKINSPECTIONRECORD_ID); + itme.put("INSPECTION_SITE", json.get("INSPECTION_SITE")); + itme.put("REGULATORY_STATUS", json.get("REGULATORY_STATUS")); + itme.put("INSPECTION_STATUS", json.get("INSPECTION_STATUS")); + itme.put("DATA_SORT", i); + itme.put("ISDELETE", 0); + itme.put("CREATOR_ID", Jurisdiction.getUSER_ID()); //添加人id + itme.put("CREATOR_NAME", Jurisdiction.getUsername()); //添加人 + itme.put("CREATE_TIME", DateUtil.date2Str(new Date())); //创建时间 + tankTruckInspectionRecordService.saveDetail(itme); + } + } + + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /** + * 删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/delete") + // @RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR) + @ResponseBody + @Transactional + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "删除") + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id + pd.put("DELETEORNAME", Jurisdiction.getName()); //删除人 + pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间 + tankTruckInspectionRecordService.delete(pd); + tankTruckInspectionRecordService.deleteDetail(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + // @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR) + @ResponseBody + @Transactional + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "修改") + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id + pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + tankTruckInspectionRecordService.edit(pd); + if (pd.get("DETAILS") != null && !pd.get("DETAILS").equals("")) { + List list = (List) JSON.parse(pd.get("DETAILS").toString()); + tankTruckInspectionRecordService.deleteDetail(pd); + for (int i = 0; i < list.size(); i++) { + JSONObject json = list.get(i); + PageData itme = new PageData(); + itme.put("RECORDDETAIL_ID", this.get32UUID()); //主键 + itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + itme.put("MAIN_ID", pd.get("TANKTRUCKINSPECTIONRECORD_ID")); + itme.put("INSPECTION_SITE", json.get("INSPECTION_SITE")); + itme.put("REGULATORY_STATUS", json.get("REGULATORY_STATUS")); + itme.put("INSPECTION_STATUS", json.get("INSPECTION_STATUS")); + itme.put("DATA_SORT", i); + itme.put("ISDELETE", 0); + itme.put("CREATOR_ID", Jurisdiction.getUSER_ID()); //添加人id + itme.put("CREATOR_NAME", Jurisdiction.getUsername()); //添加人 + itme.put("CREATE_TIME", DateUtil.date2Str(new Date())); //创建时间 + tankTruckInspectionRecordService.saveDetail(itme); + } + } + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + + /** + * 列表分页 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + // @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "列表") + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + page.setPd(pd); + List varList = tankTruckInspectionRecordService.list(page); //列出Question列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + // @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "去修改页面获取数据") + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd = tankTruckInspectionRecordService.findById(pd); //根据ID读取 + map.put("pd", pd); + List pd2 = tankTruckInspectionRecordService.findById2(pd); + map.put("detail", pd2); + + pd.put("FOREIGN_KEY", pd.getString("TANKTRUCKINSPECTIONRECORD_ID")); + pd.put("TYPE", 130); + List inspectionAttachmentImgs = imgfilesService.listAll(pd);//检查附件 + pd.put("TYPE", 131); + List inspectionImgs = imgfilesService.listAll(pd);//检查图片 + + map.put("inspectionAttachmentImgs", inspectionAttachmentImgs); + map.put("inspectionImgs", inspectionImgs); + map.put("result", errInfo); + return map; + } + +} diff --git a/src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionMapper.java b/src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionMapper.java new file mode 100644 index 0000000..1a0cbeb --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionMapper.java @@ -0,0 +1,64 @@ +package com.zcloud.mapper.datasource.tankTruckInspection; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 罐检项配置 + */ +public interface TankTruckInspectionMapper { + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + void save(PageData pd); + + void saveAll(PageData pd); + + void saveAllDel(PageData pd); + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + void edit2(PageData pd); + + /** + * 列表 + * + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + List datalistPage2(Page page); + + PageData findById(PageData pd); + + PageData findById2(PageData pd); + + List tankTruckInspectionListAll(PageData pd); + + List tankTruckInspectionListAll2(PageData pd); + + int dataCount(String corpId); + +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.java b/src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.java new file mode 100644 index 0000000..8e571d0 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.java @@ -0,0 +1,58 @@ +package com.zcloud.mapper.datasource.tankTruckInspection; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 罐检项检查 + */ +public interface TankTruckInspectionRecordMapper { + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + void save(PageData pd); + + void saveDetail(PageData pd); + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + void deleteDetail(PageData pd); + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /** + * 列表 + * + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + List datalistPage2(Page page); + + PageData findById(PageData pd); + + List findById2(PageData pd); + + int dataCount(String corpId); + +} + diff --git a/src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionRecordService.java b/src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionRecordService.java new file mode 100644 index 0000000..ca1bf44 --- /dev/null +++ b/src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionRecordService.java @@ -0,0 +1,61 @@ +package com.zcloud.service.tankTruckInspection; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 罐检项检查 + */ +public interface TankTruckInspectionRecordService { + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception; + + public void saveDetail(PageData pd) throws Exception; + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception; + + public void deleteDetail(PageData pd) throws Exception; + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception; + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception; + + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception; + + public List findById2(PageData pd) throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionService.java b/src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionService.java new file mode 100644 index 0000000..6bddfc3 --- /dev/null +++ b/src/main/java/com/zcloud/service/tankTruckInspection/TankTruckInspectionService.java @@ -0,0 +1,63 @@ +package com.zcloud.service.tankTruckInspection; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 罐检项配置 + */ +public interface TankTruckInspectionService { + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception; + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception; + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception; + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception; + + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception; + + /** + * 列表 + * + * @param + * @throws Exception + */ + public List tankTruckInspectionListAll(PageData pd) throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionRecordServiceImpl.java b/src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionRecordServiceImpl.java new file mode 100644 index 0000000..1207e05 --- /dev/null +++ b/src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionRecordServiceImpl.java @@ -0,0 +1,88 @@ +package com.zcloud.service.tankTruckInspection.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.tankTruckInspection.TankTruckInspectionRecordMapper; +import com.zcloud.service.tankTruckInspection.TankTruckInspectionRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 罐检项检查 + */ +@Service +@Transactional +public class TankTruckInspectionRecordServiceImpl implements TankTruckInspectionRecordService { + + @Autowired + private TankTruckInspectionRecordMapper tankTruckInspectionRecordMapper; + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + tankTruckInspectionRecordMapper.save(pd); + } + + public void saveDetail(PageData pd) throws Exception { + tankTruckInspectionRecordMapper.saveDetail(pd); + } + + /** + * 删除 + * e + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + tankTruckInspectionRecordMapper.delete(pd); + } + + public void deleteDetail(PageData pd) throws Exception { + tankTruckInspectionRecordMapper.deleteDetail(pd); + } + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + tankTruckInspectionRecordMapper.edit(pd); + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + return tankTruckInspectionRecordMapper.datalistPage(page); + } + + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + return tankTruckInspectionRecordMapper.findById(pd); + } + + public List findById2(PageData pd) throws Exception { + return tankTruckInspectionRecordMapper.findById2(pd); + } + +} + diff --git a/src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionServiceImpl.java b/src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionServiceImpl.java new file mode 100644 index 0000000..00e042e --- /dev/null +++ b/src/main/java/com/zcloud/service/tankTruckInspection/impl/TankTruckInspectionServiceImpl.java @@ -0,0 +1,118 @@ +package com.zcloud.service.tankTruckInspection.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.tankTruckInspection.TankTruckInspectionMapper; +import com.zcloud.service.tankTruckInspection.TankTruckInspectionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 罐检项配置 + */ +@Service +@Transactional +public class TankTruckInspectionServiceImpl implements TankTruckInspectionService { + + @Autowired + private TankTruckInspectionMapper tankTruckInspectionMapper; + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString()); + if (dataCount > 0) { + tankTruckInspectionMapper.save(pd); + } else { + tankTruckInspectionMapper.saveAll(pd); + tankTruckInspectionMapper.save(pd); + } + } + + /** + * 删除 + * e + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString()); + if (dataCount > 0) { + tankTruckInspectionMapper.delete(pd); + } else { + tankTruckInspectionMapper.saveAllDel(pd); + } + } + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString()); + if (dataCount > 0) { + tankTruckInspectionMapper.edit(pd); + } else { + tankTruckInspectionMapper.edit2(pd); + } + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + int dataCount = tankTruckInspectionMapper.dataCount(page.getPd().get("CORPINFO_ID").toString()); + if (dataCount > 0) { + return tankTruckInspectionMapper.datalistPage(page); + } else { + return tankTruckInspectionMapper.datalistPage2(page); + } + } + + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString()); + if (dataCount > 0) { + return tankTruckInspectionMapper.findById(pd); + } else { + return tankTruckInspectionMapper.findById2(pd); + } + } + + + /** + * 列表 + * + * @param + * @throws Exception + */ + public List tankTruckInspectionListAll(PageData pd) throws Exception { + int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString()); + if (dataCount > 0) { + return tankTruckInspectionMapper.tankTruckInspectionListAll(pd); + } else { + return tankTruckInspectionMapper.tankTruckInspectionListAll2(pd); + } + } + +} + diff --git a/src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionMapper.xml b/src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionMapper.xml new file mode 100644 index 0000000..321d623 --- /dev/null +++ b/src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionMapper.xml @@ -0,0 +1,231 @@ + + + + + + + bus_traffic_tank_truck_inspection_corp + + + + + + f.FREIGHTTRAILER_ID, + f.CORPINFO_ID, + f.NUM, + f.PLATE_NUMBER, + f.VIN, + f.VEHICLE_BODY_NUMBER, + f.TRAILER_TYPE, + f.OPER_CERTIFICATE_NUM, + f.BELONGING_DEPT, + f.CAR_OWNERS, + f.CAR_OWNERS_TEL, + f.CONTACTS, + f.CONTACT_PHONE, + f.INITIAL_REGISTRATION_DATE, + f.CERTIFICATE_DATE, + f.DUE_DATE, + f.TRAILER_BRAND, + f.TRAILER_MODEL, + f.APPROVED_TOTAL_MASS, + f.APPROVED_LOAD_CAPACITY, + f.VOLUME, + f.NOTES, + f.TRAILER_IMG, + f.DRIVING_LICENSE_IMG, + f.OPER_CERTIFICATE_IMG, + f.TRAILER_INFO, + f.CREATOR, + f.CREATORNAME, + f.CREATTIME, + f.ISDELETE, + f.ISSCRAP, + f.ISASSIGNED + + + + + + TANKTRUCKINSPECTION_ID, + CORPINFO_ID, + INSPECTION_SITE, + REGULATORY_STATUS, + CREATOR, + CREATORNAME, + CREATTIME, + ISDELETE + + + + + #{TANKTRUCKINSPECTION_ID}, + #{CORPINFO_ID}, + #{INSPECTION_SITE}, + #{REGULATORY_STATUS}, + #{CREATOR}, + #{CREATORNAME}, + #{CREATTIME}, + #{ISDELETE} + + + + + insert into + + ( + + ) values ( + + ) + + + INSERT INTO + bus_traffic_tank_truck_inspection_corp + (TANKTRUCKINSPECTION_ID,CORPINFO_ID,INSPECTION_SITE,REGULATORY_STATUS,ISDELETE,CREATOR,CREATORNAME,CREATTIME) + SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},INSPECTION_SITE,REGULATORY_STATUS,0, + #{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection + + + INSERT INTO + bus_traffic_tank_truck_inspection_corp + (TANKTRUCKINSPECTION_ID,CORPINFO_ID,INSPECTION_SITE,REGULATORY_STATUS,ISDELETE,CREATOR,CREATORNAME,CREATTIME) + SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},INSPECTION_SITE,REGULATORY_STATUS,0, + #{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection where TANKTRUCKINSPECTION_ID != #{TANKTRUCKINSPECTION_ID} + + + + + update + + set + ISDELETE = '1', + DELETEOR = #{DELETEOR}, + DELETEORNAME = #{DELETEORNAME}, + DELETTIME = #{DELETTIME} + where + TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID} + AND + CORPINFO_ID = #{CORPINFO_ID} + + + + + update + + set + INSPECTION_SITE = #{INSPECTION_SITE}, + REGULATORY_STATUS = #{REGULATORY_STATUS}, + OPERATOR = #{OPERATOR}, + OPERATORNAME = #{OPERATORNAME}, + OPERATTIME = #{OPERATTIME} + where + TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID} + + + INSERT INTO + bus_traffic_tank_truck_inspection_corp + (TANKTRUCKINSPECTION_ID,CORPINFO_ID,INSPECTION_SITE,REGULATORY_STATUS,ISDELETE,CREATOR,CREATORNAME,CREATTIME) + SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},INSPECTION_SITE,REGULATORY_STATUS,0, + #{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection where TANKTRUCKINSPECTION_ID != #{TANKTRUCKINSPECTION_ID} + union all + SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},#{INSPECTION_SITE},#{REGULATORY_STATUS},0, + #{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection where TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID} + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.xml b/src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.xml new file mode 100644 index 0000000..e461454 --- /dev/null +++ b/src/main/resources/mybatis/datasource/tankTruckInspection/TankTruckInspectionRecordMapper.xml @@ -0,0 +1,262 @@ + + + + + + + bus_traffic_tank_truck_inspection_record + + + + + + f.FREIGHTTRAILER_ID, + f.CORPINFO_ID, + f.NUM, + f.PLATE_NUMBER, + f.VIN, + f.VEHICLE_BODY_NUMBER, + f.TRAILER_TYPE, + f.OPER_CERTIFICATE_NUM, + f.BELONGING_DEPT, + f.CAR_OWNERS, + f.CAR_OWNERS_TEL, + f.CONTACTS, + f.CONTACT_PHONE, + f.INITIAL_REGISTRATION_DATE, + f.CERTIFICATE_DATE, + f.DUE_DATE, + f.TRAILER_BRAND, + f.TRAILER_MODEL, + f.APPROVED_TOTAL_MASS, + f.APPROVED_LOAD_CAPACITY, + f.VOLUME, + f.NOTES, + f.TRAILER_IMG, + f.DRIVING_LICENSE_IMG, + f.OPER_CERTIFICATE_IMG, + f.TRAILER_INFO, + f.CREATOR, + f.CREATORNAME, + f.CREATTIME, + f.ISDELETE, + f.ISSCRAP, + f.ISASSIGNED + + + + + + TANKTRUCKINSPECTIONRECORD_ID, + CORPINFO_ID, + VEHICLE, + INSPECTION_DATE, + INSPECTIONTOR, + DUE_DATE, + INSPECTION_CYCLE, + REMINDER_DAYS, + REMINDER_DATE, + REMINDER_STATUS, + INSPECTION_ATTACHMENT, + INSPECTION_IMG, + NOTES, + CREATOR, + CREATORNAME, + CREATTIME, + ISDELETE + + + + + #{TANKTRUCKINSPECTIONRECORD_ID}, + #{CORPINFO_ID}, + #{VEHICLE}, + #{INSPECTION_DATE}, + #{INSPECTIONTOR}, + #{DUE_DATE}, + #{INSPECTION_CYCLE}, + #{REMINDER_DAYS}, + #{REMINDER_DATE}, + #{REMINDER_STATUS}, + #{INSPECTION_ATTACHMENT}, + #{INSPECTION_IMG}, + #{NOTES}, + #{CREATOR}, + #{CREATORNAME}, + #{CREATTIME}, + #{ISDELETE} + + + + + insert into + + ( + + ) values ( + + ) + + + insert into + bus_traffic_tank_truck_inspection_record_detail + ( + RECORDDETAIL_ID, + CORPINFO_ID, + MAIN_ID, + INSPECTION_SITE, + REGULATORY_STATUS, + INSPECTION_STATUS, + DATA_SORT, + ISDELETE, + CREATOR, + CREATORNAME, + CREATTIME + ) values ( + #{RECORDDETAIL_ID}, + #{CORPINFO_ID}, + #{MAIN_ID}, + #{INSPECTION_SITE}, + #{REGULATORY_STATUS}, + #{INSPECTION_STATUS}, + #{DATA_SORT}, + #{ISDELETE}, + #{CREATOR}, + #{CREATORNAME}, + #{CREATTIME} + ) + + + + + update + + set + ISDELETE = '1', + DELETEOR = #{DELETEOR}, + DELETEORNAME = #{DELETEORNAME}, + DELETTIME = #{DELETTIME} + where + TANKTRUCKINSPECTIONRECORD_ID = #{TANKTRUCKINSPECTIONRECORD_ID} + + + update + bus_traffic_tank_truck_inspection_record_detail + set + ISDELETE = '1', + DELETEOR = #{DELETEOR}, + DELETEORNAME = #{DELETEORNAME}, + DELETTIME = #{DELETTIME} + where + MAIN_ID = #{TANKTRUCKINSPECTIONRECORD_ID} + + + + + update + + set + VEHICLE = #{VEHICLE}, + INSPECTION_DATE = #{INSPECTION_DATE}, + INSPECTIONTOR = #{INSPECTIONTOR}, + DUE_DATE = #{DUE_DATE}, + INSPECTION_CYCLE = #{INSPECTION_CYCLE}, + REMINDER_DAYS = #{REMINDER_DAYS}, + REMINDER_DATE = #{REMINDER_DATE}, + REMINDER_STATUS = #{REMINDER_STATUS}, + INSPECTION_ATTACHMENT = #{INSPECTION_ATTACHMENT}, + INSPECTION_IMG = #{INSPECTION_IMG}, + NOTES = #{NOTES}, + OPERATOR = #{OPERATOR}, + OPERATORNAME = #{OPERATORNAME}, + OPERATTIME = #{OPERATTIME} + where + TANKTRUCKINSPECTIONRECORD_ID = #{TANKTRUCKINSPECTIONRECORD_ID} + + + + + + + + + + + + + + From 3ddaa3b2c5902c9645d0ec244f1fae39c8d0a1c1 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Mon, 13 May 2024 18:00:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=90=A5=E8=BF=90=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5=E8=A1=8C=E8=BD=A6=E4=B8=89?= =?UTF-8?q?=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/beidou/BeidouController.java | 2 + ...SecurityWaybillRegistrationController.java | 4 ++ ...cSecurityCustomerManagementController.java | 1 + ...SecurityWaybillRegistrationController.java | 17 ++++++++ .../InspectAnnuallyController.java | 3 ++ .../OperatingVehiclesController.java | 3 ++ .../operations/OperationsController.java | 2 + .../TaxationManageController.java | 40 +++++++++++++++++++ .../impl/TrafficDrivingTypeServiceImpl.java | 1 + ...afficSecurityWaybillRegistrationMapper.xml | 8 +++- 10 files changed, 79 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/beidou/BeidouController.java b/src/main/java/com/zcloud/controller/beidou/BeidouController.java index d768dcb..d33a155 100644 --- a/src/main/java/com/zcloud/controller/beidou/BeidouController.java +++ b/src/main/java/com/zcloud/controller/beidou/BeidouController.java @@ -234,6 +234,8 @@ public class BeidouController extends BaseController { data.put("ARCHIVES_TYPE", "1"); } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { data.put("ARCHIVES_TYPE", "2"); + }else { + data.put("ARCHIVES_TYPE", "0"); } return false; }); diff --git a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java index 7d6f1b2..dfd070c 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java @@ -55,6 +55,10 @@ public class AppTrafficSecurityWaybillRegistrationController extends BaseControl if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); page.setPd(pd); List varList = trafficSecurityWaybillRegistrationService.listForSecurityWaybill(page); + varList.stream().forEach(data -> { + data.put("TRANSPORTVEHICLE", data.getString("PLATE_NUMBER")); + }); + System.out.println("varList = " + varList); map.put("varList", varList); map.put("page", page); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java index f9c3ec5..0f4030b 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java @@ -142,6 +142,7 @@ public class TrafficSecurityCustomerManagementController extends BaseController pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID List varList = customerManagementService.getTrafficCustomerSelectList(pd); + System.out.println("varList = " + varList); map.put("varList", varList); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index 08f12d8..ab879ee 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -6,6 +6,7 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.comprehensive.*; +import com.zcloud.service.operatingvehicles.OperatingVehiclesService; import com.zcloud.service.system.UsersService; import com.zcloud.util.*; import org.apache.commons.lang.ObjectUtils; @@ -39,6 +40,9 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController @Autowired private TrafficDrivingSignService trafficDrivingSignService; + @Autowired + private OperatingVehiclesService operatingVehiclesService; + @Autowired private UsersService usersService; @@ -53,6 +57,10 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = trafficSecurityWaybillRegistrationService.listForSecurityWaybill(page); + varList.forEach(data -> { + data.put("TRANSPORTVEHICLE", data.getString("PLATE_NUMBER")); + }); + System.out.println("varList = " + varList); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); @@ -199,6 +207,7 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController pd = trafficSecurityWaybillRegistrationService.findById(pd);//根据ID读 pd.put("ENTRUST_PERSON", pd.getString("CLIENTCONTACTPERSON")); pd.put("CONFIRM_PERSON", pd.getString("CONFIRMINGPERSON")); + pd.put("TRANSPORTVEHICLE", pd.getString("PLATE_NUMBER")); List dispatchers = Arrays.stream(pd.getString("DISPATCHER").split(",")).collect(Collectors.toList()); List names = new ArrayList<>(); dispatchers.forEach(data -> { @@ -269,7 +278,15 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController } } } + PageData pageData = new PageData(); + pageData.put("PLATE_NUMBER", pd.getString("TRANSPORTVEHICLE")); + pageData.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); + PageData vehicle = operatingVehiclesService.findByfindByPlateNumber(pageData); + if(!ObjectUtil.isEmpty(vehicle)) { + pd.put("TRANSPORTVEHICLE", vehicle.getString("OPERATING_ID")); + } trafficSecurityWaybillRegistrationService.edit(pd); + map.put("result", errInfo); map.put("pd", pd); return map; diff --git a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java index 47bf071..c88b087 100644 --- a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java +++ b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java @@ -180,11 +180,14 @@ public class InspectAnnuallyController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = inspectAnnuallyService.list(page); //列出年检列表 + System.out.println("varList = " + varList); varList.stream().anyMatch(data -> { if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { data.put("ARCHIVES_TYPE", "2"); } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { data.put("ARCHIVES_TYPE", "1"); + }else{ + data.put("ARCHIVES_TYPE", "0"); } return false; }); diff --git a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java index 45aacfa..ed855e7 100644 --- a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java +++ b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java @@ -28,7 +28,10 @@ import org.springframework.web.servlet.ModelAndView; import java.io.File; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; +import java.util.stream.Stream; @Controller @RequestMapping("/operatingvehicles") diff --git a/src/main/java/com/zcloud/controller/operations/OperationsController.java b/src/main/java/com/zcloud/controller/operations/OperationsController.java index 4e25fa9..5e200fd 100644 --- a/src/main/java/com/zcloud/controller/operations/OperationsController.java +++ b/src/main/java/com/zcloud/controller/operations/OperationsController.java @@ -178,6 +178,8 @@ public class OperationsController extends BaseController { data.put("ARCHIVES_TYPE", "2"); } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { data.put("ARCHIVES_TYPE", "1"); + }else{ + data.put("ARCHIVES_TYPE", "0"); } return false; }); diff --git a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java index d6657a9..4bb4358 100644 --- a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java +++ b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java @@ -2,6 +2,7 @@ package com.zcloud.controller.taxationManage; import cn.hutool.core.util.ObjectUtil; import com.alibaba.excel.util.DateUtils; +import com.aliyuncs.facebody.model.v20191230.PedestrianDetectAttributeResponse; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -168,6 +171,43 @@ public class TaxationManageController extends BaseController { } return false; }); + varList.forEach(data -> { + Date dueDate = DateUtil.fomatDate(data.getString("EXPIRE_DATE")); + Date reminderDate = DateUtil.fomatDate(data.getString("REMINDER_DATA")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String toDay = sdf.format(new Date()); + Date date = null; + try { + date = sdf.parse(toDay); + } catch (ParseException e) { + throw new RuntimeException(e); + } + // 已到期 + if(dueDate.before(date)) { + data.put("EXPIRE_STATUS", "0"); + try { + taxationManageService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 即将到期 + } else if ((dueDate.after(date) || dueDate.equals(date)) && (reminderDate.before(date) || reminderDate.equals(date))) { + data.put("EXPIRE_STATUS", "2"); + try { + taxationManageService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 未到期 + }else{ + data.put("EXPIRE_STATUS", "1"); + try { + taxationManageService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java index e083778..fb8445c 100644 --- a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java +++ b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java @@ -77,6 +77,7 @@ public class TrafficDrivingTypeServiceImpl implements TrafficDrivingTypeService */ public PageData infoCategory(PageData pd)throws Exception{ PageData cpd = TrafficSecurityWaybillRegistrationMapper.findById(pd); // 根据ID读取 + cpd.put("TRANSPORTVEHICLE", cpd.getString("PLATE_NUMBER")); List varOList = trafficDrivingTypeMapper.findListbyDetail(pd); List vList = trafficDrivingTypeMapper.findCategory(pd); diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml index 32ac66a..cbeade6 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml @@ -206,7 +206,8 @@ c.CUSTOMERNAME AS CLIENT_NAME, c2.CUSTOMERNAME AS CONFIRMER_NAME, t.OPERATTIME AS STARTTIME, - p.OPERATTIME AS STOPTIME + p.OPERATTIME AS STOPTIME, + bto.PLATE_NUMBER from f left join bus_corp_info i on f.CORPINFO_ID = i.CORPINFO_ID @@ -217,6 +218,7 @@ left join bus_traffic_customer_management c2 on f.CONFIRMER = c2.CUSTOMERNAME_ID left join bus_traffic_driving_sign t on t.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and t.CHECKTYPE_ID = 'status001' left join bus_traffic_driving_sign p on p.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and p.CHECKTYPE_ID = 'status003' + left join bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.TRANSPORTVEHICLE where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.WAYBILLSTATUS = #{pd.WAYBILLSTATUS} @@ -260,7 +262,8 @@ b2.ADMINISTRATIVEREGIONS AS GOAL_ADDR, oa.NAME AS DEPARTMENTNAME, btcc.CONTACT AS ENTRUSTPERSON, - btcc2.CONTACT AS CONFIRMPERSON + btcc2.CONTACT AS CONFIRMPERSON, + bto.PLATE_NUMBER from f left join bus_traffic_operatingvehicle e on f.TRANSPORTVEHICLE = e.PLATE_NUMBER @@ -275,6 +278,7 @@ left join bus_traffic_customer_contact btcc on btcc.CONTACT_ID = f.CLIENTCONTACTPERSON left join bus_traffic_customer_contact btcc2 on btcc2.CONTACT_ID = f.CONFIRMINGPERSON left join oa_department oa on oa.DEPARTMENT_ID = f.DEPARTMENT_ID + left join bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.TRANSPORTVEHICLE where f.WAYBILLREGISTRATION_ID = #{WAYBILLREGISTRATION_ID} AND