货运挂车后端

dev
277151821@qq.com 2024-03-05 11:08:48 +08:00
parent 437c8ccc89
commit b244cb0985
6 changed files with 685 additions and 4 deletions

View File

@ -0,0 +1,205 @@
package com.zcloud.controller.freighttrailer;
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.freighttrailer.FreightTrailerService;
import com.zcloud.service.system.ImgFilesService;
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("/freightTrailer")
public class FreighttTrailerController extends BaseController {
@Autowired
private FreightTrailerService freightTrailerService;
@Autowired
private ImgFilesService imgfilesService;
/**
*
*
* @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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("FREIGHTTRAILER_ID", this.get32UUID()); //主键
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
freightTrailerService.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<String, String> map = new HashMap<String, String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id
pd.put("DELETEORNAME", Jurisdiction.getUsername()); //删除人
pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间
freightTrailerService.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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
pd.put("OPERATORNAME", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
freightTrailerService.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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
page.setPd(pd);
List<PageData> varList = freightTrailerService.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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = freightTrailerService.findById(pd); //根据ID读取
pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID"));
pd.put("TYPE",120);
List<PageData> trailerImgs = imgfilesService.listAll(pd);//挂车照片
pd.put("TYPE",121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
pd.put("TYPE",122);
List<PageData> operCertificateImgs = imgfilesService.listAll(pd);//运营证照片
pd.put("TYPE",123);
List<PageData> trailerInfoImgs = imgfilesService.listAll(pd);//挂车资料图片
map.put("pd", pd);
map.put("trailerImgs", trailerImgs);
map.put("drivingLicenseImgs", drivingLicenseImgs);
map.put("operCertificateImgs", operCertificateImgs);
map.put("trailerInfoImgs", trailerInfoImgs);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/corpList")
// @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR)
@ResponseBody
@LogAnno(menuType = "基础信息管理", menuServer = "所属企业", instructionsOperate = "所属企业", instructionsType = "列表")
public Object corpList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> list = freightTrailerService.corpList(corpId); //列出Question列表
map.put("list", list);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/trailerList")
// @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR)
@ResponseBody
@LogAnno(menuType = "基础信息管理", menuServer = "货运挂车", instructionsOperate = "货运挂车", instructionsType = "列表")
public Object trailerList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> list = freightTrailerService.trailerList(corpId); //列出Question列表
map.put("list", list);
map.put("result", errInfo);
return map;
}
}

View File

@ -0,0 +1,70 @@
package com.zcloud.mapper.dsno2.freighttrailer;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* -
*/
public interface FreightTrailerMapper {
/**
*
*
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
*
*
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
*
*
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
*
*
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**
* id
*
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**
*
*
* @param
* @throws Exception
*/
List<PageData> corpList(String corpId);
/**
*
*
* @param
* @throws Exception
*/
List<PageData> trailerList(String corpId);
}

View File

@ -0,0 +1,71 @@
package com.zcloud.service.freighttrailer;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* -
*/
public interface FreightTrailerService {
/**
*
*
* @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<PageData> list(Page page) throws Exception;
/**
* id
*
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd) throws Exception;
/**
*
*
* @param
* @throws Exception
*/
public List<PageData> corpList(String corpId) throws Exception;
/**
*
*
* @param
* @throws Exception
*/
public List<PageData> trailerList(String corpId) throws Exception;
}

View File

@ -0,0 +1,97 @@
package com.zcloud.service.freighttrailer.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.dsno2.freighttrailer.FreightTrailerMapper;
import com.zcloud.service.freighttrailer.FreightTrailerService;
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 FreightTrailerServiceImpl implements FreightTrailerService {
@Autowired
private FreightTrailerMapper freightTrailerMapper;
/**
*
*
* @param pd
* @throws Exception
*/
public void save(PageData pd) throws Exception {
freightTrailerMapper.save(pd);
}
/**
*
*e
* @param pd
* @throws Exception
*/
public void delete(PageData pd) throws Exception {
freightTrailerMapper.delete(pd);
}
/**
*
*
* @param pd
* @throws Exception
*/
public void edit(PageData pd) throws Exception {
freightTrailerMapper.edit(pd);
}
/**
*
*
* @param page
* @throws Exception
*/
public List<PageData> list(Page page) throws Exception {
return freightTrailerMapper.datalistPage(page);
}
/**
* id
*
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd) throws Exception {
return freightTrailerMapper.findById(pd);
}
/**
*
*
* @param
* @throws Exception
*/
public List<PageData> corpList(String corpId) throws Exception {
return freightTrailerMapper.corpList(corpId);
}
/**
*
*
* @param
* @throws Exception
*/
public List<PageData> trailerList(String corpId) throws Exception {
return freightTrailerMapper.trailerList(corpId);
}
}

View File

@ -2,15 +2,15 @@ spring.application.name=integrated_traffic
server.port=8093
datasource.no1.driver-class-name: com.mysql.cj.jdbc.Driver
datasource.no1.url=jdbc:mysql://192.168.0.64:3306/qa-traffic-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
datasource.no1.url=jdbc:mysql://121.22.38.202:3310/qa-traffic-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
datasource.no1.username=root
datasource.no1.password=root
datasource.no1.password=^7m!F2H%bn
#\u6570\u636E\u6E902(\u9ED8\u8BA4\u6CA1\u7528\uFF0C\u4FE9\u5730\u5740\u5199\u4E00\u6837\u5373\u53EF)
datasource.no2.driver-class-name: com.mysql.cj.jdbc.Driver
datasource.no2.url=jdbc:mysql://192.168.0.64:3306/qa-traffic-admin?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
datasource.no2.url=jdbc:mysql://121.22.38.202:3310/qa-traffic-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
datasource.no2.username=root
datasource.no2.password=root
datasource.no2.password=^7m!F2H%bn
#druid\u8FDE\u63A5\u6C60
spring.datasource.type: com.alibaba.druid.pool.DruidDataSource

View File

@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.dsno2.freighttrailer.FreightTrailerMapper">
<!--表名 -->
<sql id="tableName">
bus_traffic_mechanical_freighttrailer
</sql>
<!-- 字段 -->
<sql id="Field2">
FREIGHTTRAILER_ID,
CORPINFO_ID,
INDUSTRY_TYPE,
INDUSTRY_TYPE_TREE,
INDUSTRY_TYPE_NAMES,
NUM,
PLATE_NUMBER,
VIN,
VEHICLE_BODY_NUMBER,
TRAILER_TYPE,
OPER_CERTIFICATE_NUM,
BELONGING_DEPT,
CAR_OWNERS,
CAR_OWNERS_TEL,
CONTACTS,
CONTACT_PHONE,
INITIAL_REGISTRATION_DATE,
CERTIFICATE_DATE,
DUE_DATE,
TRAILER_BRAND,
TRAILER_MODEL,
APPROVED_TOTAL_MASS,
APPROVED_LOAD_CAPACITY,
VOLUME,
NOTES,
TRAILER_IMG,
DRIVING_LICENSE_IMG,
OPER_CERTIFICATE_IMG,
TRAILER_INFO,
CREATOR,
CREATORNAME,
CREATTIME,
ISDELETE
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{FREIGHTTRAILER_ID},
#{CORPINFO_ID},
#{INDUSTRY_TYPE},
#{INDUSTRY_TYPE_TREE},
#{INDUSTRY_TYPE_NAMES},
#{NUM},
#{PLATE_NUMBER},
#{VIN},
#{VEHICLE_BODY_NUMBER},
#{TRAILER_TYPE},
#{OPER_CERTIFICATE_NUM},
#{BELONGING_DEPT},
#{CAR_OWNERS},
#{CAR_OWNERS_TEL},
#{CONTACTS},
#{CONTACT_PHONE},
#{INITIAL_REGISTRATION_DATE},
#{CERTIFICATE_DATE},
#{DUE_DATE},
#{TRAILER_BRAND},
#{TRAILER_MODEL},
#{APPROVED_TOTAL_MASS},
#{APPROVED_LOAD_CAPACITY},
#{VOLUME},
#{NOTES},
#{TRAILER_IMG},
#{DRIVING_LICENSE_IMG},
#{OPER_CERTIFICATE_IMG},
#{TRAILER_INFO},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME},
#{ISDELETE}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
DELETEOR = #{DELETEOR},
DELETEORNAME = #{DELETEORNAME},
DELETTIME = #{DELETTIME}
where
FREIGHTTRAILER_ID = #{FREIGHTTRAILER_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
INDUSTRY_TYPE = #{INDUSTRY_TYPE},
INDUSTRY_TYPE_TREE = #{INDUSTRY_TYPE_TREE},
INDUSTRY_TYPE_NAMES = #{INDUSTRY_TYPE_NAMES},
NUM = #{NUM},
PLATE_NUMBER = #{PLATE_NUMBER},
VIN = #{VIN},
VEHICLE_BODY_NUMBER = #{VEHICLE_BODY_NUMBER},
TRAILER_TYPE = #{TRAILER_TYPE},
OPER_CERTIFICATE_NUM = #{OPER_CERTIFICATE_NUM},
BELONGING_DEPT = #{BELONGING_DEPT},
CAR_OWNERS = #{CAR_OWNERS},
CAR_OWNERS_TEL = #{CAR_OWNERS_TEL},
CONTACTS = #{CONTACTS},
CONTACT_PHONE = #{CONTACT_PHONE},
INITIAL_REGISTRATION_DATE = #{INITIAL_REGISTRATION_DATE},
CERTIFICATE_DATE = #{CERTIFICATE_DATE},
DUE_DATE = #{DUE_DATE},
TRAILER_BRAND = #{TRAILER_BRAND},
TRAILER_MODEL = #{TRAILER_MODEL},
APPROVED_TOTAL_MASS = #{APPROVED_TOTAL_MASS},
APPROVED_LOAD_CAPACITY = #{APPROVED_LOAD_CAPACITY},
VOLUME = #{VOLUME},
NOTES = #{NOTES},
TRAILER_IMG = #{TRAILER_IMG},
DRIVING_LICENSE_IMG = #{DRIVING_LICENSE_IMG},
OPER_CERTIFICATE_IMG = #{OPER_CERTIFICATE_IMG},
TRAILER_INFO = #{TRAILER_INFO},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
FREIGHTTRAILER_ID = #{FREIGHTTRAILER_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
f.FREIGHTTRAILER_ID,
f.CORPINFO_ID,
f.INDUSTRY_TYPE,
f.INDUSTRY_TYPE_TREE,
f.INDUSTRY_TYPE_NAMES,
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,
(select t.FILEPATH from bus_imgfiles t where t.TYPE = 120 and t.FOREIGN_KEY = f.FREIGHTTRAILER_ID limit 1) as TRAILER_IMG,
(select t.FILEPATH from bus_imgfiles t where t.TYPE = 121 and t.FOREIGN_KEY = f.FREIGHTTRAILER_ID limit 1) as DRIVING_LICENSE_IMG,
(select t.FILEPATH from bus_imgfiles t where t.TYPE = 122 and t.FOREIGN_KEY = f.FREIGHTTRAILER_ID limit 1) as OPER_CERTIFICATE_IMG,
(select t.FILEPATH from bus_imgfiles t where t.TYPE = 123 and t.FOREIGN_KEY = f.FREIGHTTRAILER_ID limit 1) as TRAILER_INFO,
f.CREATOR,
f.CREATORNAME,
f.CREATTIME,
f.ISDELETE
from
<include refid="tableName"></include> f
where
f.FREIGHTTRAILER_ID = #{FREIGHTTRAILER_ID}
</select>
<!-- 列表
PLATE_NUMBER 车牌号
VIN 车架号
NUM 自编号
BELONGING_DEPT 归属部门 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
f.*,
de.name DEPARTMENT_NAME
from
<include refid="tableName"></include> f
left join OA_DEPARTMENT de on f.BELONGING_DEPT = de.DEPARTMENT_ID
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and f.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.VIN != null and pd.VIN != ''">
and f.VIN LIKE CONCAT(CONCAT('%', #{pd.VIN}),'%')
</if>
<if test="pd.NUM != null and pd.NUM != ''">
and f.NUM = #{pd.NUM}
</if>
<if test="pd.BELONGING_DEPT != null and pd.BELONGING_DEPT != ''">
and f.BELONGING_DEPT LIKE CONCAT(CONCAT('%', #{pd.BELONGING_DEPT}),'%')
</if>
<if test="pd.DEPARTMENT_NAME != null and pd.DEPARTMENT_NAME != ''">
and de.NAME LIKE CONCAT(CONCAT('%', #{pd.DEPARTMENT_NAME}),'%')
</if>
ORDER BY f.CREATTIME DESC
</select>
<!-- 所属企业列表 -->
<select id="corpList" parameterType="page" resultType="pd">
select
*
from
bus_corp_info f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{corpId}
</select>
<!-- 货运挂车列表ALL -->
<select id="trailerList" parameterType="page" resultType="pd">
select
*
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{corpId}
</select>
</mapper>