Commit 57f14343 authored by wanghao's avatar wanghao

1 液化石油气-安检记录 外部接口开发。

parent 527db5f1
......@@ -3,6 +3,7 @@ package com.zehong.web.controller.tool;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.utils.StringUtils;
import java.io.UnsupportedEncodingException;
......@@ -158,15 +159,65 @@ public class DESEncoder {
// System.out.println(DESEncoder.encrypt(skcs1,"23546324"));
String lpggasdata = "[\n" +
"{\"onState\":\"1\",\"vehicleLimt\":\"车辆限乘01\",\"vehicleLoad\":\"车辆载重01\",\"carNum\":\"SE123\",\"vehicleCode\":\"代码01\",\"brandModel\":\"品牌型号01\",\"vehicleInspect\":\"车辆检查信息01\",\"vehicleUser\":\"使用人01\",\"carNumber\":\"车辆编号01\",\"phone\":\"888888888\",\"personLiable\":\"责任人88888888\",\"stationName\":\"储备站88888888\",\"vehicleSize\":\"车辆大小01\",\"vehicleType\":\"车辆类型01\",\"remarks\":\"备注01\"},\n" +
"{\"onState\":\"0\",\"vehicleLimt\":\"车辆限乘02\",\"vehicleLoad\":\"车辆载重02\",\"carNum\":\"SE456\",\"vehicleCode\":\"代码02\",\"brandModel\":\"品牌型号02\",\"vehicleInspect\":\"车辆检查信息02\",\"vehicleUser\":\"使用人02\",\"carNumber\":\"车辆编号02\",\"phone\":\"联系电话02\",\"personLiable\":\"责任人02\",\"stationName\":\"储备站02\",\"vehicleSize\":\"车辆大小02\",\"vehicleType\":\"车辆类型02\",\"remarks\":\"备注02\"}\n" +
"{\"onState\":\"1\",\"vehicleLimt\":\"车辆限乘01\",\"vehicleLoad\":\"车辆载重01\",\"carNum\":\"SE123\",\"vehicleCode\":\"代码01\",\"brandModel\":\"品牌型号01\",\"vehicleInspect\":\"车辆检查信息01\",\"vehicleUser\":\"使用人01\",\"carNumber\":\"车辆编号01\",\"phone\":\"888888888\",\"personLiable\":\"责任人88888888\",\"stationName\":\"储备站88888888\",\"vehicleSize\":\"车辆大小01\",\"vehicleType\":\"车辆类型01\",\"remarks\":\"备注01\"},\n" +
"]";
" {\n" +
" \"userOwnId\": \"1\",\n" +
" \"stationName\": \"储备站01-接口来的-01\",\n" +
" \"gasUser\": \"用户名01-接口来的-01\",\n" +
" \"telNum\": \"电话01-接口来的-01\",\n" +
" \"gasUserAddress\": \"用户地址01-接口来的-01\",\n" +
" \"gasUserType\": \"0\",\n" +
" \"safeCheckDate\": \"2024-12-16\",\n" +
" \"safeCheckPerson\": \"安检人-接口来的-01\",\n" +
" \"bottleNum\": \"15\",\n" +
" \"checkInStatus\": \"0\",\n" +
" \"stoveCheckStatus\": \"0\",\n" +
" \"hoseCheckStatus\": \"0\",\n" +
" \"valveCheckStatus\": \"0\",\n" +
" \"bottleCheckStatus\": \"0\",\n" +
" \"alarmCheckStatus\": \"0\",\n" +
" \"placeCheckStatus\": \"0\",\n" +
"\n" +
" \"stoveCheckPic\": \"0\",\n" +
" \"hoseCheckPic\": \"0\",\n" +
" \"valveCheckPic\": \"0\",\n" +
" \"bottleCheckPic\": \"0\",\n" +
" \"alarmCheckPic\": \"0\",\n" +
" \"placeCheckPic\": \"0\",\n" +
" },\n" +
" {\n" +
" \"userOwnId\": \"2\",\n" +
" \"stationName\": \"储备站01-接口来的-01\",\n" +
" \"gasUser\": \"用户名01-接口来的-01\",\n" +
" \"telNum\": \"电话01-接口来的-01\",\n" +
" \"gasUserAddress\": \"用户地址01-接口来的-01\",\n" +
" \"gasUserType\": \"用户类型-接口来的-01\",\n" +
" \"safeCheckDate\": \"2024-12-16\",\n" +
" \"safeCheckPerson\": \"安检人-接口来的-01\",\n" +
" \"bottleNum\": \"设定净重-接口来的-01\",\n" +
" \"checkInStatus\": \"入户状态01-接口来的-01\",\n" +
" \"stoveCheckStatus\": \"0\",\n" +
" \"hoseCheckStatus\": \"0\",\n" +
" \"valveCheckStatus\": \"0\",\n" +
" \"bottleCheckStatus\": \"0\",\n" +
" \"alarmCheckStatus\": \"0\",\n" +
" \"placeCheckStatus\": \"0\",\n" +
"\n" +
" \"stoveCheckPic\": \"0\",\n" +
" \"hoseCheckPic\": \"0\",\n" +
" \"valveCheckPic\": \"0\",\n" +
" \"bottleCheckPic\": \"0\",\n" +
" \"alarmCheckPic\": \"0\",\n" +
" \"placeCheckPic\": \"0\",\n" +
" }\n" +
"]\n" +
"\n";
JSONArray objects = JSON.parseArray(lpggasdata);
System.out.println(objects);
System.out.println(DESEncoder.encrypt(objects.toString(),"GCQYTRQ00001"));
}
}
......@@ -119,6 +119,12 @@ public class TLpgSafeCheckRecord extends BaseEntity
private Long userId;
/**
* 用户自有编号 接收第三方数据时暂时使用
*/
private String userOwnId;
public void setSafeCheckId(Long safeCheckId)
{
this.safeCheckId = safeCheckId;
......@@ -353,6 +359,14 @@ public class TLpgSafeCheckRecord extends BaseEntity
this.userId = userId;
}
public String getUserOwnId() {
return userOwnId;
}
public void setUserOwnId(String userOwnId) {
this.userOwnId = userOwnId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -43,6 +43,13 @@ public interface TLpgSafeCheckRecordMapper
* @return r
*/
public int insertBatch(@Param("list") List<TLpgSafeCheckRecord> list);
/**
* 批量插入 包含图片
* @param list list
* @return r
*/
public int insertBatchContainPic(@Param("list") List<TLpgSafeCheckRecord> list);
/**
* 修改液化石油安检记录
*
......
......@@ -84,6 +84,14 @@ public interface TYehuaqiUserMapper
*/
public List<TYehuaqiUser> selectForExportTYehuaqiUserList(TYehuaqiUser tDetectorUser);
/**
* 根据userOwnIds 和 enterpriseId 查询数据
* @param userOwnIds u
* @param enterpriseId e
* @return r
*/
public List<TYehuaqiUser> queryByUserOwnIdsAndEnterpriseId(@Param("userOwnIds") List<String> userOwnIds,@Param("enterpriseId") String enterpriseId);
public List<TYehuaqiUser> queryErrorDetectorUserList(String depId);
/**
* 修改燃气用户
......
......@@ -39,6 +39,13 @@ public interface ITLpgSafeCheckRecordService
*/
public int insertTLpgSafeCheckRecord(TLpgSafeCheckRecord tLpgSafeCheckRecord);
/**
* 批量插入
* @param tLpgSafeCheckRecords t
* @return r
*/
public int insertBatchContainPic(List<TLpgSafeCheckRecord> tLpgSafeCheckRecords);
/**
* 修改液化石油安检记录
*
......
......@@ -57,6 +57,14 @@ public interface ITYehuaqiUserService
*/
public List<TYehuaqiUser> selectForExportTYehuaqiUserList(TYehuaqiUser tDetectorUser);
/**
* 根据用户自有id 集合 和 企业id 查询数据
* @param userOwnIds u
* @param enterpriseId e
* @return r
*/
public List<TYehuaqiUser> queryByUserOwnIdsAndEnterpriseId(List<String> userOwnIds,String enterpriseId);
/**
* 查询导入的错误数据
* @return r
......
......@@ -70,6 +70,16 @@ public class TLpgSafeCheckRecordServiceImpl implements ITLpgSafeCheckRecordServi
return tLpgSafeCheckRecordMapper.insertTLpgSafeCheckRecord(tLpgSafeCheckRecord);
}
/**
* 批量插入
* @param tLpgSafeCheckRecords t
* @return r
*/
@Override
public int insertBatchContainPic(List<TLpgSafeCheckRecord> tLpgSafeCheckRecords) {
return tLpgSafeCheckRecordMapper.insertBatchContainPic(tLpgSafeCheckRecords);
}
/**
* 修改液化石油安检记录
*
......
......@@ -208,6 +208,17 @@ public class TYehuaqiUserServiceImpl implements ITYehuaqiUserService
return tYehuaqiUserMapper.selectForExportTYehuaqiUserList(yehuaqiUser);
}
/**
* 根据userOwnIds 和 enterpriseId 查询数据
* @param userOwnIds u
* @param enterpriseId e
* @return r
*/
@Override
public List<TYehuaqiUser> queryByUserOwnIdsAndEnterpriseId(List<String> userOwnIds, String enterpriseId) {
return tYehuaqiUserMapper.queryByUserOwnIdsAndEnterpriseId(userOwnIds,enterpriseId);
}
/**
* 处理解析好的 自定义模版的导入的数据 多sheet
* @param gasUserExportVos d 燃气用户数据
......
......@@ -105,7 +105,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertBatch" parameterType="list">
insert into t_lpg_safe_check_record (station_name, user_id,gas_user_type,gas_user_address,tel_num,safe_check_date,
safe_check_person,bottle_num,check_in_status,stove_check_status,hose_check_status,valve_check_status,bottle_check_status,
alarm_check_status,place_check_status)
......@@ -119,6 +118,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<insert id="insertBatchContainPic" parameterType="list">
insert into t_lpg_safe_check_record (station_name, user_id,gas_user_type,gas_user_address,tel_num,safe_check_date,
safe_check_person,bottle_num,check_in_status,stove_check_status,hose_check_status,valve_check_status,bottle_check_status,
alarm_check_status,place_check_status,stove_check_pic,hose_check_pic,valve_check_pic,bottle_check_pic,alarm_check_pic,place_check_pic)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.stationName,jdbcType=VARCHAR}, #{item.userId}, #{item.gasUserType,jdbcType=VARCHAR},
#{item.gasUserAddress,jdbcType=VARCHAR}, #{item.telNum,jdbcType=VARCHAR}, #{item.safeCheckDate},
#{item.safeCheckPerson},#{item.bottleNum},#{item.checkInStatus},#{item.stoveCheckStatus},
#{item.hoseCheckStatus},#{item.valveCheckStatus},#{item.bottleCheckStatus},#{item.alarmCheckStatus},
#{item.placeCheckStatus},#{item.stoveCheckPic},#{item.hoseCheckPic},#{item.valveCheckPic},#{item.bottleCheckPic},
#{item.alarmCheckPic},#{item.placeCheckPic}
)
</foreach>
</insert>
<insert id="insertTLpgSafeCheckRecord" parameterType="TLpgSafeCheckRecord" useGeneratedKeys="true" keyProperty="safeCheckId">
insert into t_lpg_safe_check_record
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -133,6 +133,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</select>
<select id="queryByUserOwnIdsAndEnterpriseId" resultMap="TYehuaqiUserResult">
<include refid="selectTYehuaqiUserVo"/>
where beyond_enterprise_id = #{enterpriseId} and user_own_id in
<foreach collection="userOwnIds" close=")" separator="," open="(" item="item" index="i">
#{item}
</foreach>
</select>
<select id="selectForExportTYehuaqiUserList" parameterType="TYehuaqiUser" resultMap="TYehuaqiUserExportResult">
select a.user_id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment