Browse Source

手动留期限皮功能、计量期限时间配置接口

dengyj 4 years ago
parent
commit
180c46565b

+ 139 - 0
src/main/java/com/steerinfo/baseinfo/appphonehelp/controller/AppPhoneHelpController.java

@@ -0,0 +1,139 @@
+package com.steerinfo.baseinfo.appphonehelp.controller;
+
+import com.steerinfo.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp;
+import com.steerinfo.baseinfo.appphonehelp.service.IAppPhoneHelpService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.apache.shiro.crypto.hash.Hash;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.math.BigDecimal;
+
+/**
+ * AppPhoneHelp RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-03-18 05:31
+ * 类描述
+ * 修订历史:
+ * 日期:2022-03-18
+ * 作者:generator
+ * 参考:
+ * 描述:AppPhoneHelp RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/appphonehelps")
+public class AppPhoneHelpController extends BaseRESTfulController {
+
+    @Autowired
+    IAppPhoneHelpService appPhoneHelpService;
+
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("appphonehelp:view")
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<AppPhoneHelp> list = appPhoneHelpService.queryForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+
+    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("appphonehelp:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<AppPhoneHelp> list = appPhoneHelpService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+    
+    @ApiOperation(value="创建", notes="根据AppPhoneHelp对象创建")
+    @ApiImplicitParam(name = "appPhoneHelp", value = "详细实体appPhoneHelp", required = true, dataType = "AppPhoneHelp")
+    //@RequiresPermissions("appphonehelp:create")
+    @PostMapping(value = "/")
+    public RESTfulResult add(@ModelAttribute AppPhoneHelp model){
+        AppPhoneHelp appPhoneHelp = appPhoneHelpService.add(model);
+        return success(appPhoneHelp);
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("appphonehelp:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        AppPhoneHelp appPhoneHelp = appPhoneHelpService.getById(id);
+        return success(appPhoneHelp);
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的appPhoneHelp信息来更新详细信息")
+    @ApiImplicitParams({
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+        @ApiImplicitParam(name = "appPhoneHelp", value = "详细实体appPhoneHelp", required = true, dataType = "AppPhoneHelp")
+    })
+    //@RequiresPermissions("appphonehelp:update")
+    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody AppPhoneHelp model){
+        model.setId(id);
+        AppPhoneHelp appPhoneHelp = appPhoneHelpService.modify(model);
+        return success(appPhoneHelp);
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("appphonehelp:delete")
+    @DeleteMapping(value = "/{id}")//String
+    public RESTfulResult delete(@PathVariable String id){
+    	List<String> list = Arrays.asList(id.split(","));
+    	if(ListUtils.isNotEmpty(list)) {
+	    	List<String> ids = ListUtils.convertList(list);
+			  appPhoneHelpService.delete(ids);
+    	}
+      return success();
+    }
+
+    @ApiOperation(value = "App端远程求助按钮", notes = "App端远程求助按钮")
+    @GetMapping(value = "/phoneHelp")
+    public RESTfulResult phoneHelp(@RequestParam HashMap<String, Object> param) {
+        RESTfulResult rm = failed();
+        String carNo = param.get("carNo") == null ? "":param.get("carNo").toString();
+        String phoneNo = param.get("phoneNo") == null ? "" : param.get("phoneNo").toString();
+        String driverName = param.get("driverName") == null ? "" : param.get("driverName").toString();
+        try{
+            if(carNo == null){
+                rm.setMessage("车号不能为空!!");
+                return rm;
+            }else if(phoneNo == null){
+                rm.setMessage("电话号码不能为空!!");
+                return rm;
+            }else if(driverName == null){
+                rm.setMessage("司机姓名不能为空!!");
+                return rm;
+            }else{
+                appPhoneHelpService.phoneHelp(carNo, phoneNo, driverName);
+            }
+
+        }catch(Exception e){
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!!");
+        }
+        return rm;
+    }
+}

+ 10 - 0
src/main/java/com/steerinfo/baseinfo/appphonehelp/mapper/AppPhoneHelpMapper.java

@@ -0,0 +1,10 @@
+package com.steerinfo.baseinfo.appphonehelp.mapper;
+
+import com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AppPhoneHelpMapper extends IBaseMapper<AppPhoneHelp, String> {
+}

+ 342 - 0
src/main/java/com/steerinfo/baseinfo/appphonehelp/mapper/AppPhoneHelpMapper.xml

@@ -0,0 +1,342 @@
+<?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.steerinfo.baseinfo.appphonehelp.mapper.AppPhoneHelpMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp">
+    <id column="HELP_ID" jdbcType="VARCHAR" property="helpId" />
+    <result column="CAR_NO" jdbcType="VARCHAR" property="carNo" />
+    <result column="PHONE_NO" jdbcType="VARCHAR" property="phoneNo" />
+    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime" />
+    <result column="CREATE_NO" jdbcType="VARCHAR" property="createNo" />
+    <result column="CREATE_NAME" jdbcType="VARCHAR" property="createName" />
+    <result column="RESULT" jdbcType="VARCHAR" property="result" />
+    <result column="VALUE_FLAG" jdbcType="VARCHAR" property="valueFlag" />
+    <result column="DRIVER_NAME" jdbcType="VARCHAR" property="driverName" />
+  </resultMap>
+  <sql id="columns">
+    HELP_ID, CAR_NO, PHONE_NO, CREATE_TIME, END_TIME, CREATE_NO, CREATE_NAME, RESULT, 
+    VALUE_FLAG, DRIVER_NAME
+  </sql>
+  <sql id="columns_alias">
+    t.HELP_ID, t.CAR_NO, t.PHONE_NO, t.CREATE_TIME, t.END_TIME, t.CREATE_NO, t.CREATE_NAME, 
+    t.RESULT, t.VALUE_FLAG, t.DRIVER_NAME
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM APP_PHONE_HELP
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM APP_PHONE_HELP t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="helpId != null and helpId != ''">
+        and HELP_ID = #{helpId}
+      </if>
+      <if test="carNo != null and carNo != ''">
+        and CAR_NO = #{carNo}
+      </if>
+      <if test="phoneNo != null and phoneNo != ''">
+        and PHONE_NO = #{phoneNo}
+      </if>
+      <if test="createTime != null">
+        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
+      </if>
+      <if test="endTime != null">
+        and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
+      </if>
+      <if test="createNo != null and createNo != ''">
+        and CREATE_NO = #{createNo}
+      </if>
+      <if test="createName != null and createName != ''">
+        and CREATE_NAME = #{createName}
+      </if>
+      <if test="result != null and result != ''">
+        and RESULT = #{result}
+      </if>
+      <if test="valueFlag != null and valueFlag != ''">
+        and VALUE_FLAG = #{valueFlag}
+      </if>
+      <if test="driverName != null and driverName != ''">
+        and DRIVER_NAME = #{driverName}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="helpId != null and helpId != ''">
+        and HELP_ID LIKE '%${helpId}%'
+      </if>
+      <if test="carNo != null and carNo != ''">
+        and CAR_NO LIKE '%${carNo}%'
+      </if>
+      <if test="phoneNo != null and phoneNo != ''">
+        and PHONE_NO LIKE '%${phoneNo}%'
+      </if>
+      <if test="createTime != null">
+        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
+      </if>
+      <if test="endTime != null">
+        and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
+      </if>
+      <if test="createNo != null and createNo != ''">
+        and CREATE_NO LIKE '%${createNo}%'
+      </if>
+      <if test="createName != null and createName != ''">
+        and CREATE_NAME LIKE '%${createName}%'
+      </if>
+      <if test="result != null and result != ''">
+        and RESULT LIKE '%${result}%'
+      </if>
+      <if test="valueFlag != null and valueFlag != ''">
+        and VALUE_FLAG LIKE '%${valueFlag}%'
+      </if>
+      <if test="driverName != null and driverName != ''">
+        and DRIVER_NAME LIKE '%${driverName}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from APP_PHONE_HELP
+    where HELP_ID = #{helpId,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from APP_PHONE_HELP
+    where 1!=1 
+      <if test="carNo != null and carNo != ''">
+        or CAR_NO = #{carNo}
+      </if>
+      <if test="phoneNo != null and phoneNo != ''">
+        or PHONE_NO = #{phoneNo}
+      </if>
+      <if test="createTime != null">
+        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
+      </if>
+      <if test="endTime != null">
+        or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
+      </if>
+      <if test="createNo != null and createNo != ''">
+        or CREATE_NO = #{createNo}
+      </if>
+      <if test="createName != null and createName != ''">
+        or CREATE_NAME = #{createName}
+      </if>
+      <if test="result != null and result != ''">
+        or RESULT = #{result}
+      </if>
+      <if test="valueFlag != null and valueFlag != ''">
+        or VALUE_FLAG = #{valueFlag}
+      </if>
+      <if test="driverName != null and driverName != ''">
+        or DRIVER_NAME = #{driverName}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp">
+    insert into APP_PHONE_HELP (HELP_ID, CAR_NO, PHONE_NO, 
+      CREATE_TIME, END_TIME, CREATE_NO, 
+      CREATE_NAME, RESULT, VALUE_FLAG, 
+      DRIVER_NAME)
+    values (#{helpId,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, #{phoneNo,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{createNo,jdbcType=VARCHAR}, 
+      #{createName,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{valueFlag,jdbcType=VARCHAR}, 
+      #{driverName,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp">
+    insert into APP_PHONE_HELP
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="helpId != null">
+        HELP_ID,
+      </if>
+      <if test="carNo != null">
+        CAR_NO,
+      </if>
+      <if test="phoneNo != null">
+        PHONE_NO,
+      </if>
+      <if test="createTime != null">
+        CREATE_TIME,
+      </if>
+      <if test="endTime != null">
+        END_TIME,
+      </if>
+      <if test="createNo != null">
+        CREATE_NO,
+      </if>
+      <if test="createName != null">
+        CREATE_NAME,
+      </if>
+      <if test="result != null">
+        RESULT,
+      </if>
+      <if test="valueFlag != null">
+        VALUE_FLAG,
+      </if>
+      <if test="driverName != null">
+        DRIVER_NAME,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="helpId != null">
+        #{helpId,jdbcType=VARCHAR},
+      </if>
+      <if test="carNo != null">
+        #{carNo,jdbcType=VARCHAR},
+      </if>
+      <if test="phoneNo != null">
+        #{phoneNo,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null">
+        #{endTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createNo != null">
+        #{createNo,jdbcType=VARCHAR},
+      </if>
+      <if test="createName != null">
+        #{createName,jdbcType=VARCHAR},
+      </if>
+      <if test="result != null">
+        #{result,jdbcType=VARCHAR},
+      </if>
+      <if test="valueFlag != null">
+        #{valueFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="driverName != null">
+        #{driverName,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp">
+    update APP_PHONE_HELP
+    set CAR_NO = #{carNo,jdbcType=VARCHAR},
+      PHONE_NO = #{phoneNo,jdbcType=VARCHAR},
+      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      END_TIME = #{endTime,jdbcType=TIMESTAMP},
+      CREATE_NO = #{createNo,jdbcType=VARCHAR},
+      CREATE_NAME = #{createName,jdbcType=VARCHAR},
+      RESULT = #{result,jdbcType=VARCHAR},
+      VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
+      DRIVER_NAME = #{driverName,jdbcType=VARCHAR}
+    where HELP_ID = #{helpId,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp">
+    update APP_PHONE_HELP
+    <set>
+      <if test="carNo != null">
+        CAR_NO = #{carNo,jdbcType=VARCHAR},
+      </if>
+      <if test="phoneNo != null">
+        PHONE_NO = #{phoneNo,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null">
+        END_TIME = #{endTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createNo != null">
+        CREATE_NO = #{createNo,jdbcType=VARCHAR},
+      </if>
+      <if test="createName != null">
+        CREATE_NAME = #{createName,jdbcType=VARCHAR},
+      </if>
+      <if test="result != null">
+        RESULT = #{result,jdbcType=VARCHAR},
+      </if>
+      <if test="valueFlag != null">
+        VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="driverName != null">
+        DRIVER_NAME = #{driverName,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where HELP_ID = #{helpId,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where HELP_ID = #{helpId,jdbcType=VARCHAR}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into APP_PHONE_HELP 
+      (HELP_ID, 
+      CAR_NO, PHONE_NO, CREATE_TIME, 
+      END_TIME, CREATE_NO, CREATE_NAME, 
+      RESULT, VALUE_FLAG, DRIVER_NAME
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.helpId,jdbcType=VARCHAR}, 
+      #{item.carNo,jdbcType=VARCHAR}, #{item.phoneNo,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
+      #{item.endTime,jdbcType=TIMESTAMP}, #{item.createNo,jdbcType=VARCHAR}, #{item.createName,jdbcType=VARCHAR}, 
+      #{item.result,jdbcType=VARCHAR}, #{item.valueFlag,jdbcType=VARCHAR}, #{item.driverName,jdbcType=VARCHAR}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update APP_PHONE_HELP
+     set
+       HELP_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.helpId,jdbcType=VARCHAR}
+       </foreach>
+       ,CAR_NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
+       </foreach>
+       ,PHONE_NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.phoneNo,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,END_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,CREATE_NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.createNo,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATE_NAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.createName,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.result,jdbcType=VARCHAR}
+       </foreach>
+       ,VALUE_FLAG=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
+       </foreach>
+       ,DRIVER_NAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case HELP_ID" close="end">
+          when #{item.helpId,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
+       </foreach>
+     where HELP_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.helpId,jdbcType=VARCHAR}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from APP_PHONE_HELP
+    where HELP_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>

+ 182 - 0
src/main/java/com/steerinfo/baseinfo/appphonehelp/model/AppPhoneHelp.java

@@ -0,0 +1,182 @@
+package com.steerinfo.baseinfo.appphonehelp.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value="司机电话远程求助表")
+public class AppPhoneHelp implements IBasePO<String> {
+    /**
+     * 主键(HELP_ID,VARCHAR,20)
+     */
+    @ApiModelProperty(value="主键",required=true)
+    private String helpId;
+
+    /**
+     * 车号(CAR_NO,VARCHAR,11)
+     */
+    @ApiModelProperty(value="车号",required=false)
+    private String carNo;
+
+    /**
+     * 电话号码(PHONE_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="电话号码",required=false)
+    private String phoneNo;
+
+    /**
+     * 求助时间(CREATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="求助时间",required=false)
+    private Date createTime;
+
+    /**
+     * 结束时间(END_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="结束时间",required=false)
+    private Date endTime;
+
+    /**
+     * 处理人编号(CREATE_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="处理人编号",required=false)
+    private String createNo;
+
+    /**
+     * 处理人(CREATE_NAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="处理人",required=false)
+    private String createName;
+
+    /**
+     * 处理结果(RESULT,VARCHAR,2)
+     */
+    @ApiModelProperty(value="处理结果",required=false)
+    private String result;
+
+    /**
+     * 是否接听(0:未接听,1:已接听)(VALUE_FLAG,VARCHAR,1)
+     */
+    @ApiModelProperty(value="是否接听(0:未接听,1:已接听)",required=false)
+    private String valueFlag;
+
+    /**
+     * 司机姓名(DRIVER_NAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="司机姓名",required=false)
+    private String driverName;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public String getId() {
+        return this.helpId;
+    }
+
+    @Override
+    public void setId(String helpId) {
+        this.helpId = helpId == null ? null : helpId.trim();
+    }
+
+    public String getHelpId() {
+        return helpId;
+    }
+
+    public void setHelpId(String helpId) {
+        this.helpId = helpId == null ? null : helpId.trim();
+    }
+
+    public String getCarNo() {
+        return carNo;
+    }
+
+    public void setCarNo(String carNo) {
+        this.carNo = carNo == null ? null : carNo.trim();
+    }
+
+    public String getPhoneNo() {
+        return phoneNo;
+    }
+
+    public void setPhoneNo(String phoneNo) {
+        this.phoneNo = phoneNo == null ? null : phoneNo.trim();
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getCreateNo() {
+        return createNo;
+    }
+
+    public void setCreateNo(String createNo) {
+        this.createNo = createNo == null ? null : createNo.trim();
+    }
+
+    public String getCreateName() {
+        return createName;
+    }
+
+    public void setCreateName(String createName) {
+        this.createName = createName == null ? null : createName.trim();
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result == null ? null : result.trim();
+    }
+
+    public String getValueFlag() {
+        return valueFlag;
+    }
+
+    public void setValueFlag(String valueFlag) {
+        this.valueFlag = valueFlag == null ? null : valueFlag.trim();
+    }
+
+    public String getDriverName() {
+        return driverName;
+    }
+
+    public void setDriverName(String driverName) {
+        this.driverName = driverName == null ? null : driverName.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", helpId=").append(helpId);
+        sb.append(", carNo=").append(carNo);
+        sb.append(", phoneNo=").append(phoneNo);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", endTime=").append(endTime);
+        sb.append(", createNo=").append(createNo);
+        sb.append(", createName=").append(createName);
+        sb.append(", result=").append(result);
+        sb.append(", valueFlag=").append(valueFlag);
+        sb.append(", driverName=").append(driverName);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 24 - 0
src/main/java/com/steerinfo/baseinfo/appphonehelp/service/IAppPhoneHelpService.java

@@ -0,0 +1,24 @@
+package com.steerinfo.baseinfo.appphonehelp.service;
+
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * AppPhoneHelp服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-03-18 05:31
+ * 类描述
+ * 修订历史:
+ * 日期:2022-03-18
+ * 作者:generator
+ * 参考:
+ * 描述:AppPhoneHelp服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAppPhoneHelpService extends IBaseService<AppPhoneHelp, String>{
+    RESTfulResult phoneHelp(String carNo, String phoneNo, String driverName);
+}

+ 42 - 0
src/main/java/com/steerinfo/baseinfo/appphonehelp/service/impl/AppPhoneHelpServiceImpl.java

@@ -0,0 +1,42 @@
+package com.steerinfo.baseinfo.appphonehelp.service.impl;
+
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import com.steerinfo.baseinfo.appphonehelp.model.AppPhoneHelp;
+import com.steerinfo.baseinfo.appphonehelp.mapper.AppPhoneHelpMapper;
+import com.steerinfo.baseinfo.appphonehelp.service.IAppPhoneHelpService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * AppPhoneHelp服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-03-18 05:31
+ * 类描述
+ * 修订历史:
+ * 日期:2022-03-18
+ * 作者:generator
+ * 参考:
+ * 描述:AppPhoneHelp服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "appPhoneHelpService")
+public class AppPhoneHelpServiceImpl extends BaseServiceImpl<AppPhoneHelp, String> implements IAppPhoneHelpService {
+
+    @Autowired
+    private AppPhoneHelpMapper appPhoneHelpMapper;
+
+    @Override
+    protected IBaseMapper<AppPhoneHelp, String> getMapper() {
+        return appPhoneHelpMapper;
+    }
+
+    @Override
+    public RESTfulResult phoneHelp(String carNo, String phoneNo, String driverName) {
+        return null;
+    }
+}

+ 0 - 7
src/main/java/com/steerinfo/baseinfo/meterbasecar/controller/MeterBaseCarController.java

@@ -11,32 +11,25 @@ import com.steerinfo.baseinfo.meterbasedriver.service.IMeterBaseDriverService;
 import com.steerinfo.baseinfo.meterbasetravellingmerchant.mapper.MeterBaseTravellingMerchantMapper;
 import com.steerinfo.baseinfo.meterbasetravellingmerchant.model.MeterBaseTravellingMerchant;
 import com.steerinfo.baseinfo.meterbaseverificationcode.mapper.MeterBaseVerificationCodeMapper;
-import com.steerinfo.baseinfo.meterbaseverificationcode.model.MeterBaseVerificationCode;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
-import com.steerinfo.framework.user.UserPayload;
 import com.steerinfo.framework.utils.collection.ListUtils;
 import com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar;
 import com.steerinfo.baseinfo.meterbasecar.service.IMeterBaseCarService;
 import com.steerinfo.meterwork.except.MarkerMetException;
-import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
 import com.steerinfo.util.CommonPage;
 import com.steerinfo.util.SSOUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import javafx.scene.effect.Blend;
-import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.bind.annotation.*;
 
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.math.BigDecimal;
 

+ 5 - 2
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/controller/MeterBaseTermTareDataController.java

@@ -263,9 +263,12 @@ throw new MarkerMetException(500, "操作异常!!");
 
     @ApiOperation(value = "根据Id手动保存期限皮")
     @Transactional
-    @PostMapping(value = "/doSaveTerm")
-    public RESTfulResult doSaveTerm(@RequestBody String id) {
+    @GetMapping(value = "/doSaveTerm")
+    public RESTfulResult doSaveTerm(@RequestParam String id) {
         try {
+            if(id == null){
+                return failed(null, "计量数据编号有问题,请确认!!");
+            }
             RESTfulResult rm = meterBaseTermTareDataService.doSaveTerm(id);
             return rm;
         } catch (Exception e) {

+ 2 - 0
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/mapper/MeterBaseTermTareDataMapper.java

@@ -19,6 +19,8 @@ public interface MeterBaseTermTareDataMapper extends IBaseMapper<MeterBaseTermTa
 
     MeterBaseTermTareData selectByCarNo(HashMap<String, Object> mp);
 
+    MeterBaseTermTareData selectWhereCarNo(HashMap<String, Object> mp);
+
     MeterBaseTermTareData selectByDataNo(HashMap<String, Object> mp);
 
 }

+ 5 - 0
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/mapper/MeterBaseTermTareDataMapper.xml

@@ -602,4 +602,9 @@
     update METER_BASE_TERM_TARE_DATA set value_flag=#{valueFlag} where car_no=#{carNo}
   </update>
 
+  <select id="selectWhereCarNo" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    select * from METER_BASE_TERM_TARE_DATA
+    where CAR_NO = '${carNo}'
+    ORDER BY CREATE_TIME desc
+  </select>
 </mapper>

+ 77 - 18
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/service/impl/MeterBaseTermTareDataServiceImpl.java

@@ -14,6 +14,7 @@ import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData;
 import com.steerinfo.baseinfo.meterbasetermtaredata.mapper.MeterBaseTermTareDataMapper;
 import com.steerinfo.baseinfo.meterbasetermtaredata.service.IMeterBaseTermTareDataService;
+import com.steerinfo.framework.user.UserPayload;
 import com.steerinfo.metermonitor.metermonitornote.mapper.MeterMonitorNoteMapper;
 import com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote;
 import com.steerinfo.meterwork.except.MarkerMetException;
@@ -246,37 +247,95 @@ public class MeterBaseTermTareDataServiceImpl extends BaseServiceImpl<MeterBaseT
         RESTfulResult rm = new RESTfulResult();
         rm.setCode("200");
 
-        MeterWorkCarActualFirst modelTemp = meterWorkCarActualFirstMapper.selectByPrimaryKey(id);
-
+        //从一次计量表里取出:车号、计量点编号、计量点名称、计量时间、计量重量
+        String actualFirstNo = id;
+        MeterWorkCarActualFirst modelTemp = meterWorkCarActualFirstMapper.selectByPrimaryKey(actualFirstNo);
         String carNo = modelTemp.getCarNo();
         String baseSpotName = modelTemp.getBaseSpotName();
         String baseSpotNo = modelTemp.getBaseSpotNo();
         Date meterTime = modelTemp.getCreateTime();
-        Date startTime = modelTemp.getCreateTime();
-        Date createTime = new Date();
-        String createManNo = modelTemp.getCreateManNo();
-        String createManName = modelTemp.getCreateManName();
         BigDecimal meterWeight = modelTemp.getMeterWeight();
-
+        if(carNo == null){
+            rm.setMessage("车号不能为空,请确认!!");
+            rm.setCode("500");
+            return rm;
+        }
+        if(baseSpotNo == null && baseSpotName  == null){
+            rm.setMessage("计量点编号或者计量点名称为空,请确认!!");
+            rm.setCode("500");
+            return rm;
+        }
+        if(meterTime == null){
+            rm.setMessage("计量时间不能为空!!");
+            rm.setCode("500");
+            return rm;
+        }
+        UserPayload payload = UserPayload.getCurrUser();
+        String userId = payload.getId();
+        String userName = payload.getUserName();
+        if(userId == null && userName == null){
+            rm.setMessage("计量人编号或者计量员为空,请确认");
+            rm.setCode("500");
+            return rm;
+        }
+        //根据车号查询期限表的期限皮重信息
+        HashMap<String, Object> map = new HashMap();
+        map.put("carNo", carNo);
+        MeterBaseTermTareData modelTerm = meterBaseTermTareDataMapper.selectWhereCarNo(map);
+        //设置数据编号
         MeterBaseTermTareData model = new MeterBaseTermTareData();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
-        model.setDataNo(sdf.format(new Date()));
+
+        //设置计量点编号、名称、车号
         model.setBaseSpotName(baseSpotName);
         model.setBaseSpotNo(baseSpotNo);
-        model.setEndTime(createTime);
-        model.setWarnTime(createTime);
-        model.setUpWeight(0L);
         model.setCarNo(carNo);
+        //设置皮重时间、开始时间、结束时间、提醒留皮时间
+        HashMap<String, Object> tareTimemap = new HashMap();
+        tareTimemap.put("valueFlag", "0");
+        MeterBaseTermTareTime tareTimeModel = meterBaseTermTareTimeMapper.selectByMap(tareTimemap);
+        if(tareTimeModel != null){
+            Date endDate = new Date();
+            Date warnDate = new Date();
+            int day = tareTimeModel.getFixedValue();
+            endDate.setDate(endDate.getDate()+day);
+            warnDate.setDate(warnDate.getDate()+tareTimeModel.getWarnValue());
+            model.setStartTime(new Date());
+            model.setEndTime(new Date(endDate.getTime()));
+            model.setWarnTime(new Date(warnDate.getTime()));
+        }else{
+            rm.setMessage("计量人编号或者计量员为空,请确认");
+            rm.setCode("500");
+            return rm;
+        }
         model.setMeterTime(meterTime);
-        model.setStartTime(startTime);
-        model.setCreateTime(createTime);
+
+        //设置状态(0:有效;1:无效)、创建人编号、创建人、创建时间
         model.setValueFlag("0");
-        model.setCreateManNo("createManNo");
-        model.setCreateManName("createManName");
+        model.setCreateManNo(userId);
+        model.setCreateManName(userName);
+
+        //model.setCreateManNo("userId");
+        //model.setCreateManName("userName");
+        model.setCreateTime(new Date());
+        //设置皮重次数(默认7次)、设置皮重
         model.setMeterNum(7L);
         model.setMeterWeight(meterWeight);
-
-        meterBaseTermTareDataMapper.insertSelective(model);
+        //期限皮表未查到车号信息,直接插入,否则,更新车号信息
+        if(modelTerm == null){
+            model.setUpWeight(meterWeight.longValue());
+            model.setAvgWeight(meterWeight.longValue());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+            model.setDataNo(sdf.format(new Date()));
+            meterBaseTermTareDataMapper.insertSelective(model);
+        }else if(modelTerm.getCarNo().equals(carNo)){
+            //设置上一次皮重、平均皮重
+            model.setUpWeight(modelTerm.getMeterWeight().longValue());  //BigDecimal转long类型
+            long avg = modelTerm.getAvgWeight()+modelTerm.getMeterWeight().longValue();
+            model.setAvgWeight(avg/2);
+            model.setDataNo(modelTerm.getDataNo());
+            meterBaseTermTareDataMapper.updateByPrimaryKeySelective(model);
+        }
+        rm.setMessage("操作成功");
         return rm;
     }
 

+ 3 - 0
src/main/java/com/steerinfo/baseinfo/meterbasetermtaretime/mapper/MeterBaseTermTareTimeMapper.java

@@ -4,7 +4,10 @@ import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.baseinfo.meterbasetermtaretime.model.MeterBaseTermTareTime;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.HashMap;
+
 @Mapper
 public interface MeterBaseTermTareTimeMapper extends IBaseMapper<MeterBaseTermTareTime, String> {
      String GetNewID();
+     MeterBaseTermTareTime selectByMap(HashMap<String, Object> map);
 }

+ 6 - 0
src/main/java/com/steerinfo/baseinfo/meterbasetermtaretime/mapper/MeterBaseTermTareTimeMapper.xml

@@ -551,4 +551,10 @@
     SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(TIME_NO, LENGTH(TIME_NO) -3))),0) + 1,4,'0') TIME_NO
     FROM METER_BASE_TERM_TARE_TIME
   </select>
+
+  <select id="selectByMap" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+    order by CREATE_TIME  desc
+  </select>
 </mapper>