后端修改

dev
277151821@qq.com 2024-03-07 11:06:17 +08:00
parent 14674ea26c
commit cb0952eae5
10 changed files with 634 additions and 7 deletions

View File

@ -215,8 +215,16 @@ public class FreighttTrailerController extends BaseController {
public Object vehicleList() 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列表
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
List<PageData> list = freightTrailerService.vehicleList(pd); //列出Question列表
if(pd.containsKey("ID")){
pd.put("FOREIGN_KEY", pd.getString("ID"));
pd.put("TYPE",121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs);
}
map.put("list", list);
map.put("result", errInfo);
return map;

View File

@ -0,0 +1,185 @@
package com.zcloud.controller.inspectAnnually;
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.inspectAnnually.InspectAnnuallyService;
import com.zcloud.service.system.ImgFilesService;
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.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("/inspectAnnually")
public class InspectAnnuallyController extends BaseController {
@Autowired
private InspectAnnuallyService inspectAnnuallyService;
@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("INSPECTANNUALLY_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
pd.put("ARCHIVES_TYPE", "正常"); //档案状态
inspectAnnuallyService.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())); //删除时间
inspectAnnuallyService.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())); //修改时间
inspectAnnuallyService.edit(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/edit2")
// @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR)
@ResponseBody
@LogAnno(menuType = "机务档案", menuServer = "年检管理", instructionsOperate = "年检管理", instructionsType = "修改")
public Object edit2() 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())); //修改时间
inspectAnnuallyService.edit2(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 = inspectAnnuallyService.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 = inspectAnnuallyService.findById(pd); //根据ID读取
pd.put("FOREIGN_KEY", pd.getString("INSPECTANNUALLY_ID"));
pd.put("TYPE",124);
List<PageData> inspectinfoImgs = imgfilesService.listAll(pd);//年检资料图片
map.put("pd", pd);
map.put("inspectinfoImgs", inspectinfoImgs);
map.put("result", errInfo);
return map;
}
}

View File

@ -73,6 +73,6 @@ public interface FreightTrailerMapper {
* @param
* @throws Exception
*/
List<PageData> vehicleList(String corpId);
List<PageData> vehicleList(PageData pd);
}

View File

@ -0,0 +1,64 @@
package com.zcloud.mapper.datasource.inspectAnnually;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* -
*/
public interface InspectAnnuallyMapper {
/**
*
*
* @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 pd
* @throws Exception
*/
void edit2(PageData pd);
/**
*
*
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**
* id
*
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -73,7 +73,7 @@ public interface FreightTrailerService {
* @param
* @throws Exception
*/
public List<PageData> vehicleList(String corpId) throws Exception;
public List<PageData> vehicleList(PageData pd) throws Exception;
}

View File

@ -99,8 +99,8 @@ public class FreightTrailerServiceImpl implements FreightTrailerService {
* @param
* @throws Exception
*/
public List<PageData> vehicleList(String corpId) throws Exception {
return freightTrailerMapper.vehicleList(corpId);
public List<PageData> vehicleList(PageData pd) throws Exception {
return freightTrailerMapper.vehicleList(pd);
}
}

View File

@ -0,0 +1,64 @@
package com.zcloud.service.inspectAnnually;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* -
*/
public interface InspectAnnuallyService {
/**
*
*
* @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 pd
* @throws Exception
*/
public void edit2(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;
}

View File

@ -0,0 +1,88 @@
package com.zcloud.service.inspectAnnually.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.inspectAnnually.InspectAnnuallyMapper;
import com.zcloud.service.inspectAnnually.InspectAnnuallyService;
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 InspectAnnuallyServiceImpl implements InspectAnnuallyService {
@Autowired
private InspectAnnuallyMapper inspectAnnuallyMapper;
/**
*
*
* @param pd
* @throws Exception
*/
public void save(PageData pd) throws Exception {
inspectAnnuallyMapper.save(pd);
}
/**
*
*
* @param pd
* @throws Exception
*/
public void delete(PageData pd) throws Exception {
inspectAnnuallyMapper.delete(pd);
}
/**
*
*
* @param pd
* @throws Exception
*/
public void edit(PageData pd) throws Exception {
inspectAnnuallyMapper.edit(pd);
}
/**
*
*
* @param pd
* @throws Exception
*/
public void edit2(PageData pd) throws Exception {
inspectAnnuallyMapper.edit2(pd);
}
/**
*
*
* @param page
* @throws Exception
*/
public List<PageData> list(Page page) throws Exception {
return inspectAnnuallyMapper.datalistPage(page);
}
/**
* id
*
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd) throws Exception {
return inspectAnnuallyMapper.findById(pd);
}
}

View File

@ -231,10 +231,13 @@
*
from
v_traffic f
where f.CORPINFO_ID = #{corpId}
where f.CORPINFO_ID = #{CORPINFO_ID}
<if test="TRAFFIC_TYPE != null and TRAFFIC_TYPE != ''">
and f.TRAFFIC_TYPE = #{TRAFFIC_TYPE}
</if>
<if test="ID != null and ID != ''">
and f.ID = #{ID}
</if>
</select>
</mapper>

View File

@ -0,0 +1,215 @@
<?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.datasource.inspectAnnually.InspectAnnuallyMapper">
<!--表名 -->
<sql id="tableName">
bus_traffic_mechanical_inspect_annually
</sql>
<!-- 字段 -->
<sql id="Field">
INSPECTANNUALLY_ID,
CORPINFO_ID,
NUM,
VEHICLE_MODEL,
VEHICLE,
CAR_OWNERS,
TELEPHONE,
REGISTRANT,
PROCESSING_DATE,
ANNUAL_INSPECTION_CYCLE,
DUE_DATE,
INSPECTFEES,
ACTUAL_COLLECTION,
ADDRESS,
REMINDER_DAYS,
REMINDER_DATE,
REMINDER_STATUS,
INSPECTINFO,
NOTES,
ARCHIVES_TYPE,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{INSPECTANNUALLY_ID},
#{CORPINFO_ID},
#{NUM},
#{VEHICLE_MODEL},
#{VEHICLE},
#{CAR_OWNERS},
#{TELEPHONE},
#{REGISTRANT},
#{PROCESSING_DATE},
#{ANNUAL_INSPECTION_CYCLE},
#{DUE_DATE},
#{INSPECTFEES},
#{ACTUAL_COLLECTION},
#{ADDRESS},
#{REMINDER_DAYS},
#{REMINDER_DATE},
#{REMINDER_STATUS},
#{INSPECTINFO},
#{NOTES},
#{ARCHIVES_TYPE},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field"></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
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
NUM = #{NUM},
VEHICLE_MODEL = #{VEHICLE_MODEL},
VEHICLE = #{VEHICLE},
CAR_OWNERS = #{CAR_OWNERS},
TELEPHONE = #{TELEPHONE},
REGISTRANT = #{REGISTRANT},
PROCESSING_DATE = #{PROCESSING_DATE},
ANNUAL_INSPECTION_CYCLE = #{ANNUAL_INSPECTION_CYCLE},
DUE_DATE = #{DUE_DATE},
INSPECTFEES = #{INSPECTFEES},
ACTUAL_COLLECTION = #{ACTUAL_COLLECTION},
ADDRESS = #{ADDRESS},
REMINDER_DAYS = #{REMINDER_DAYS},
REMINDER_DATE = #{REMINDER_DATE},
REMINDER_STATUS = #{REMINDER_STATUS},
INSPECTINFO = #{INSPECTINFO},
NOTES = #{NOTES},
ARCHIVES_TYPE = #{ARCHIVES_TYPE},
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
where
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</update>
<!-- 修改 -->
<update id="edit2" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="REMINDER_STATUS != null">
REMINDER_STATUS = #{REMINDER_STATUS},
</if>
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
where
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
f.INSPECTANNUALLY_ID,
f.CORPINFO_ID,
f.NUM,
f.VEHICLE_MODEL,
f.VEHICLE,
f.CAR_OWNERS,
f.TELEPHONE,
f.REGISTRANT,
f.PROCESSING_DATE,
f.ANNUAL_INSPECTION_CYCLE,
f.DUE_DATE,
f.INSPECTFEES,
f.ACTUAL_COLLECTION,
f.ADDRESS,
f.REMINDER_DAYS,
f.REMINDER_DATE,
f.REMINDER_STATUS,
f.INSPECTINFO,
f.NOTES,
f.ARCHIVES_TYPE,
f.ISDELETE,
f.CREATOR,
f.CREATORNAME,
f.CREATTIME,
(SELECT sd.NAME FROM sys_dictionaries sd where sd.DICTIONARIES_ID=f.ANNUAL_INSPECTION_CYCLE) as ANNUAL_INSPECTION_CYCLE_NAME
from
<include refid="tableName"></include>
f
where
f.INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</select>
<!-- 列表
BASICINFO_LICENSE_PLATE 车牌号
CAR_OWNERS 车主业户
REGISTRANT 登记人
DUE_DATE 到期日期
VEHICLE_MODEL 营运车型
REMINDER_STATUS 提醒状态
-->
<select id="datalistPage" parameterType="page" resultType="pd">
select
f.*,
case when f.DUE_DATE &lt; NOW() then 1 else 0 end as DUE_DATE_TYPE,
v1.PLATE_NUMBER,
(SELECT sd.NAME FROM sys_dictionaries sd where sd.DICTIONARIES_ID=f.ANNUAL_INSPECTION_CYCLE) as ANNUAL_INSPECTION_CYCLE_NAME
from
<include refid="tableName"></include>
f
INNER JOIN v_traffic v1 on f.VEHICLE=v1.ID
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.CAR_OWNERS != null and pd.CAR_OWNERS != ''">
and f.CAR_OWNERS LIKE CONCAT(CONCAT('%', #{pd.CAR_OWNERS}),'%')
</if>
<if test="pd.REGISTRANT != null and pd.REGISTRANT != ''">
and f.REGISTRANT LIKE CONCAT(CONCAT('%', #{pd.REGISTRANT}),'%')
</if>
<if test="pd.DUE_DATE != null and pd.DUE_DATE != ''">
and f.DUE_DATE = #{pd.DUE_DATE}
</if>
<if test="pd.VEHICLE_MODEL != null and pd.VEHICLE_MODEL != ''">
and f.VEHICLE_MODEL LIKE CONCAT(CONCAT('%', #{pd.VEHICLE_MODEL}),'%')
</if>
<if test="pd.REMINDER_STATUS != null and pd.REMINDER_STATUS != ''">
and f.REMINDER_STATUS = #{pd.REMINDER_STATUS}
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
and case when f.DUE_DATE &lt; NOW() then 1 else 0 end = #{pd.DUE_DATE_TYPE}
</if>
</select>
</mapper>