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} + + + + + + + + + + + + + +