Commit 332a411c authored by wujiang's avatar wujiang

Merge branch 'developer' of http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz into developer

parents 13077bd1 bafceab7
......@@ -83,7 +83,7 @@
LEFT JOIN wl_equipment_category cate ON cate.id = eq.category_id
<where>
<if test="whereConditionStr != null and whereConditionStr != '' ">
eq.name like CONCAT("%",#{whereConditionStr},"%" )
eq.name like CONCAT('%',#{whereConditionStr},'%' )
</if>
<if test="isIot != null and isIot != '' ">
eq.is_iot = #{isIot}
......@@ -102,7 +102,7 @@
LEFT JOIN wl_equipment_category cate ON cate.id = eq.category_id
<where>
<if test="whereConditionStr != null and whereConditionStr != '' ">
eq.name like CONCAT("%",#{whereConditionStr},"%" )
eq.name like CONCAT('%',#{whereConditionStr},'%' )
</if>
</where>
</select>
......
......@@ -220,10 +220,10 @@
<where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">
CONCAT_WS(' ', wles.position,wled.area) like
concat(concat("%",#{param.warehouseStructureName}),"%")
concat(concat('%',#{param.warehouseStructureName}),'%')
</if>
<if test="param.equipCode != null and param.equipCode != ''">AND wles.code like
concat(concat("%",#{param.equipCode}),"%")
concat(concat('%',#{param.equipCode}),'%')
</if>
<if test="param.beginDate!=null">AND wlesal.create_date <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND wlesal.create_date <![CDATA[<=]]> #{param.endDate}</if>
......@@ -400,10 +400,10 @@
and wlesal.id = #{param.alarmLogId}
</if>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">
and wlesal.location like concat(concat("%",#{param.warehouseStructureName}),"%")
and wlesal.location like concat(concat('%',#{param.warehouseStructureName}),'%')
</if>
<if test="param.equipCode != null and param.equipCode != ''">
AND wlesal.equipment_specific_code like concat(concat("%",#{param.equipCode}),"%")
AND wlesal.equipment_specific_code like concat(concat('%',#{param.equipCode}),'%')
</if>
<if test="param.confirmType != null and param.confirmType != '' and param.confirmType == 1">
AND wlesal.confirm_type <![CDATA[<>]]> ''
......@@ -443,16 +443,16 @@
wlesal.type != 'FIREALARM'
</if>
<if test="param.equipmentCode != null and param.equipmentCode != ''">
AND wlesal.equipment_code like concat(concat("%",#{param.equipmentCode}),"%")
AND wlesal.equipment_code like concat(concat('%',#{param.equipmentCode}),'%')
</if>
<if test="param.equipDetailCode != null and param.equipDetailCode != ''">
AND wlesal.equipment_code like concat(concat("%",#{param.equipDetailCode}),"%")
AND wlesal.equipment_code like concat(concat('%',#{param.equipDetailCode}),'%')
</if>
<if test="param.indexTypeCode != null and param.indexTypeCode != ''">
AND wlesal.type = #{param.indexTypeCode}
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wlesal.equipment_specific_index_key like concat(concat("%",#{param.fireEquipmentSpecificIndexKey}),"%")
AND wlesal.equipment_specific_index_key like concat(concat('%',#{param.fireEquipmentSpecificIndexKey}),'%')
</if>
</where>
ORDER BY wlesal.create_date DESC
......@@ -526,10 +526,10 @@
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''">
d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
concat(concat('%',#{warehouseStructureName}),'%')
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{equipCode}),"%")
concat(concat('%',#{equipCode}),'%')
</if>
<if test="beginDate!=null">AND d.createDate >= #{beginDate}</if>
<if test="endDate!=null">AND d.createDate <![CDATA[<=]]> #{endDate}</if>
......
......@@ -190,7 +190,7 @@
`wes`.`system_id`
)) AS `code`,
wes.system_id systemId,
( SELECT GROUP_CONCAT(fs.name) FROM f_fire_fighting_system fs WHERE `wes`.`system_id` like CONCAT("%",fs.id,'%') ) AS systemName
( SELECT GROUP_CONCAT(fs.name) FROM f_fire_fighting_system fs WHERE `wes`.`system_id` like CONCAT('%',fs.id,'%') ) AS systemName
FROM
wl_equipment_specific AS wes
......@@ -454,9 +454,9 @@
<if test="companyId != null and companyId != ''">
and spec.agency_id = #{companyId}
</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat("%", #{equipCode}, "%")</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat('%', #{equipCode}, '%')</if>
<if test="equipName != '' and equipName != null">
and spec.name like CONCAT("%", #{equipName},'%')
and spec.name like CONCAT('%', #{equipName},'%')
</if>
<if test="current != null and size != null">
Limit #{current},#{size}
......@@ -501,9 +501,9 @@
<if test="companyId != null and companyId != ''">
and spec.agency_id = #{companyId}
</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat("%", #{equipCode}, "%")</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat('%', #{equipCode}, '%')</if>
<if test="equipName != '' and equipName != null">
and spec.name like CONCAT("%", #{equipName},'%')
and spec.name like CONCAT('%', #{equipName},'%')
</if>
</select>
......
......@@ -46,7 +46,7 @@
LEFT JOIN wl_unit u1 ON u1.id = u.id
OR u1.parent_id = u.id
WHERE
u1.`name` LIKE concat(concat("%",#{name}),"%")
u1.`name` LIKE concat(concat('%',#{name}),'%')
</if>
ORDER BY
u.code
......
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
/**
* 聚富通枚举
*
* <p>
* ProjectName: amos-boot-zx-biz
* PackageName: com.yeejoin.amos.boot.module.hygf.api.Enum
*
* @author yangyang
* @version v1.0
* @date 2024/7/18 11:51
*/
@Data
public class IcbcEnum {
/**
* 开户状态
*/
@Getter
@NoArgsConstructor
@AllArgsConstructor
public static enum OpenAccountState {
INITIAL("初始", "00"),
OPENING("开户中", "01"),
SUCCESSFULLY("开户成功", "02"),
FAIL("开户失败", "03");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
public static String getNameByCode(String code, String defaultName) {
for (OpenAccountState state : OpenAccountState.values()) {
if (state.getCode().equals(code)) {
return state.getName();
}
}
if (StringUtils.isNotEmpty(defaultName)) {
return defaultName;
}
return null;
}
}
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@Getter
@NoArgsConstructor
@AllArgsConstructor
enum ProtocolStatus {
NOT_EFFECTIVE("未生效", "0"),
EFFECTIVE("已生效", "1"),
OVERDUE("过期", "2"),
DISCARD("作废", "3"),
WAITTING_SMS("待短信确认", "4");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
}
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* (hygf_icbc_record)实体类
*
* @author yangyang
* @description
* @since 2024-07-18 11:40:46
*/
@Data
@NoArgsConstructor
@ApiModel (value = "HygfIcbcRecordDTO", description = "聚富通钱包开户DTO")
public class HygfIcbcRecordDTO {
private static final long serialVersionUID = 1L;
protected Long sequenceNbr;
@ApiModelProperty (value = "农户姓名")
private String custName;
/**
* 身份证号
*/
@ApiModelProperty (value = "身份证号")
private String idCard;
/**
* 手机号码
*/
@ApiModelProperty (value = "手机号码")
private String phone;
/**
* 聚富通电子账户账号
*/
@ApiModelProperty (value = "聚富通电子账户账")
private String mediumId;
/**
* 项目编号
*/
@ApiModelProperty (value = "项目编号")
private String projectId;
/**
* 开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败
*/
@ApiModelProperty (value = "开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败")
private String openAccountStatus;
@ApiModelProperty (value = "开户状态Name")
private String openAccountStatusName;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ApiModelProperty (value = "协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认")
private String protocolStatus;
@ApiModelProperty (value = "协议状态Name")
private String protocolStatusName;
/**
* 协议开始日期
*/
@ApiModelProperty (value = "协议开始日期")
private String protocolStartTime;
/**
* 协议终止日期
*/
@ApiModelProperty (value = "协议终止日期")
private String protocolEndTime;
/**
* 单笔限额
*/
@ApiModelProperty (value = "单笔限额")
private String trxLimitAmount;
/**
* 日累计限额
*/
@ApiModelProperty (value = "日累计限额")
private String dayLimitAmount;
/**
* 协议总限额
*/
@ApiModelProperty (value = "协议总限额")
private String protocolLimitAmount;
/**
* 合作方 appid
*/
@ApiModelProperty (value = "合作方 appid")
private String appId;
/**
* 外部用户编号
*/
@ApiModelProperty (value = "外部用户编号")
private String outUserId;
/**
* 企业外系统编号
*/
@ApiModelProperty (value = "企业外系统编号")
private String outVendorId;
/**
* signEntrsutPrtlStatus
*/
@ApiModelProperty (value = "signEntrsutPrtlStatus")
private String signEntrsutPrtlStatus;
/**
* 作废申请状态
*/
@ApiModelProperty (value = "作废申请状态")
private String discardStatus;
@ApiModelProperty(value = "农户id")
private String amosUserId;
@ApiModelProperty(value = "电站信息")
private List<IcbcPeasantHousehold> peasantHouseholds;
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class IcbcPeasantHousehold {
/**
* 农户信息编号
*/
@ApiModelProperty(value = "农户信息编号")
private String peasantHouseholdNo;
/**
* 项目地址
*/
@ApiModelProperty(value = "项目地址")
private List<Integer> projectAddress;
/**
* 项目地址
*/
@ApiModelProperty(value = "项目地址")
private String projectAddressName;
/*
* 区域公司id
* */
@ApiModelProperty(value = "区域公司id")
private Long regionalCompaniesSeq;
/*
* 区域公司code
* */
@ApiModelProperty(value = "区域公司code")
private String regionalCompaniesCode;
/*
* 区域公司名称
* */
@ApiModelProperty(value = "区域公司名称")
private String regionalCompaniesName;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <p>
* ProjectName: amos-boot-zx-biz
* PackageName: com.yeejoin.amos.boot.module.hygf.api.dto
*
* @author yangyang
* @version v1.0
* @date 2024/7/18 14:36
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HygfIcbcRecordQueryDTO {
@ApiModelProperty (value = "开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败")
private String openAccountStatus;
@ApiModelProperty (value = "农户姓名")
private String custName;
@ApiModelProperty (value = "身份证号")
private String idCard;
@ApiModelProperty (value = "手机号码")
private String phone;
@ApiModelProperty (value = "区域公司")
private String regionalCompaniesSeq;
@ApiModelProperty (value = "所属地址")
private String address;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
* (hygf_icbc_record)实体类
*
* @author yangyang
* @description
* @since 2024-07-18 11:40:46
*/
@Data
@NoArgsConstructor
@Accessors (chain = true)
@TableName (value = "hygf_icbc_record", autoResultMap = true)
public class HygfIcbcRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 农户姓名
*/
@TableField ("cust_name")
private String custName;
/**
* 身份证号
*/
@TableField ("id_card")
private String idCard;
/**
* 手机号码
*/
@TableField ("phone")
private String phone;
/**
* 聚富通电子账户账号
*/
@TableField ("medium_id")
private String mediumId;
/**
* 项目编号
*/
@TableField ("project_id")
private String projectId;
/**
* 开户状态, 00-初始,01-开户中,02-开户成功,03-开户失败
*/
@TableField ("open_account_status")
private String openAccountStatus;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@TableField ("protocol_status")
private String protocolStatus;
/**
* 协议开始日期
*/
@TableField ("protocol_start_time")
private String protocolStartTime;
/**
* 协议终止日期
*/
@TableField ("protocol_end_time")
private String protocolEndTime;
/**
* 单笔限额
*/
@TableField ("trx_limit_amount")
private String trxLimitAmount;
/**
* 日累计限额
*/
@TableField ("day_limit_amount")
private String dayLimitAmount;
/**
* 协议总限额
*/
@TableField ("protocol_limit_amount")
private String protocolLimitAmount;
/**
* 合作方 appid
*/
@TableField ("app_id")
private String appId;
/**
* 外部用户编号
*/
@TableField ("out_user_id")
private String outUserId;
/**
* 企业外系统编号
*/
@TableField ("out_vendor_id")
private String outVendorId;
/**
* signEntrsutPrtlStatus
*/
@TableField ("sign_entrsut_prtl_status")
private String signEntrsutPrtlStatus;
/**
* 作废申请状态
*/
@TableField ("discard_status")
private String discardStatus;
/**
* 农户 用户 id
*/
@TableField("amos_user_id")
private String amosUserId;
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (hygf_icbc_record)数据Mapper
*
* @author yangyang
* @description
* @since 2024-07-18 11:40:46
*/
public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 服务接口
*
* @author yangyang
* @since 2024-07-18 11:40:46
* @description
*/
public interface HygfIcbcRecordService {
}
......@@ -52,13 +52,13 @@
AND hbga.grid_status IN ('2', '3', '4')
</if>
<if test="map.projectAddress != null and map.projectAddress!=''">
AND hph.project_address_name LIKE concat(concat("%", #{map.projectAddress}), "%")
AND hph.project_address_name LIKE concat(concat('%', #{map.projectAddress}), '%')
</if>
<if test="map.powerStationCode != null and map.powerStationCode !=''">
AND hph.peasant_household_no LIKE concat(concat("%", #{map.powerStationCode}), "%")
AND hph.peasant_household_no LIKE concat(concat('%', #{map.powerStationCode}), '%')
</if>
<if test="map.ownersName != null and map.ownersName !=''">
AND hph.owners_name LIKE concat(concat("%", #{map.ownersName}), "%")
AND hph.owners_name LIKE concat(concat('%', #{map.ownersName}), '%')
</if>
<if test="map.gridStatus != null and map.gridStatus !=''">
AND hbga.grid_status = #{map.gridStatus}
......
<?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.yeejoin.amos.boot.module.hygf.api.mapper.HygfIcbcRecordMapper">
<sql id="tableName">
hygf_icbc_record
</sql>
<sql id="baseColumn">
sequence_nbr,cust_name,id_card,phone,medium_id,project_id,open_account_state,protocol_status,protocol_start_time,protocol_end_time,trx_limit_amount,day_limit_amount,protocol_limit_amount,app_id,out_user_id,out_vendor_id,sign_entrsut_prtl_status
</sql>
<select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT DISTINCT
icbc.sequence_nbr,
ph.owners_name as custName,
ph.telephone as phone,
ph.id_card,
ph.amos_user_id,
icbc.open_account_status,
icbc.protocol_status
FROM
hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
<where>
ph.is_delete = 0
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
AND icbc.protocol_status = #{param.openAccountStatus}
</if>
<if test="param.custName != null and param.custName != ''">
AND ph.owners_name LIKE CONCAT('%', #{param.custName}, '%')
</if>
<if test="param.idCard != null and param.idCard != ''">
AND ph.id_card LIKE CONCAT('%', #{param.idCard}, '%')
</if>
<if test="param.phone != null and param.phone != ''">
AND ph.telephone LIKE CONCAT('%', #{param.phone}, '%')
</if>
<if test="param.regionalCompaniesSeq != null and param.regionalCompaniesSeq != ''">
AND ph.regional_companies_seq = #{param.regionalCompaniesSeq}
</if>
</if>
</where>
GROUP BY
ph.amos_user_id
ORDER BY
ph.rec_date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -14,13 +14,13 @@
on hygf_jp_station.third_station_id=hygf_jp_collector.third_station_id
<where>
<if test="dto.snCode!=null and dto.snCode!='' ">
and hygf_jp_station.sn_code like concat(concat("%",#{dto.snCode}),"%")
and hygf_jp_station.sn_code like concat(concat('%',#{dto.snCode}),'%')
</if>
<if test="dto.name!=null and dto.name!='' ">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......
......@@ -14,13 +14,13 @@
on hygf_jp_station.third_station_id=hygf_jp_inverter.third_station_id
<where>
<if test="dto.snCode!=null and dto.snCode!='' ">
and hygf_jp_station.sn_code like concat(concat("%",#{dto.snCode}),"%")
and hygf_jp_station.sn_code like concat(concat('%',#{dto.snCode}),'%')
</if>
<if test="dto.name!=null and dto.name!='' ">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......
......@@ -54,16 +54,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -107,10 +107,10 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -134,16 +134,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -166,16 +166,16 @@
<where>
is_delete=0
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.thirdStationIds!=null and dto.thirdStationIds.size()> 0 ">
and hygf_jp_station.third_station_id in
......@@ -207,16 +207,16 @@
<where>
is_delete=0
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.thirdStationIds!=null and dto.thirdStationIds.size()> 0 ">
and hygf_jp_station.third_station_id in
......@@ -247,7 +247,7 @@
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
<if test="regionName!=null and regionName!=''">
and privilege_company.COMPANY_NAME like concat("%",#{regionName}, "%")
and privilege_company.COMPANY_NAME like concat('%',#{regionName}, '%')
</if>
</select>
......@@ -268,7 +268,7 @@
and hygf_regional_companies.regional_companies_code =#{regionalCompaniesCode}
</if>
<if test="dealerName!=null and dealerName!=''">
and hygf_unit_info.`name` like concat("%",#{dealerName}, "%")
and hygf_unit_info.`name` like concat('%',#{dealerName}, '%')
</if>
and hygf_unit_info.amos_company_code is not null
GROUP BY hygf_unit_info.amos_company_code,hygf_unit_info.`name`
......@@ -320,10 +320,10 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -356,16 +356,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -399,16 +399,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -440,16 +440,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -483,16 +483,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -525,16 +525,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......@@ -610,16 +610,16 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
and hygf_jp_station.name like concat(concat('%',#{dto.name}),'%')
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
and hygf_jp_station.user_name like concat(concat('%',#{dto.userName}),'%')
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
and hygf_jp_station.address like concat(concat('%',#{dto.address}),'%')
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
and hygf_jp_station.area like concat(concat('%',#{dto.area}),'%')
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
......
......@@ -17,10 +17,10 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
and hygf_document_station.preparation_money_id !=#{ids}
</if>)
<if test="peasantHouseholdNo!=null and peasantHouseholdNo !=''">
and hygf_peasant_household.peasant_household_no like concat(concat("%",#{peasantHouseholdNo}),"%")
and hygf_peasant_household.peasant_household_no like concat(concat('%',#{peasantHouseholdNo}),'%')
</if>
<if test="ownersName!=null and ownersName !='' ">
and hygf_peasant_household.owners_name like concat(concat("%",#{ownersName}),"%")
and hygf_peasant_household.owners_name like concat(concat('%',#{ownersName}),'%')
</if>
<if test="orderBy !=null and orderBy !='' ">
ORDER BY ${orderBy}
......@@ -44,10 +44,10 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
</if>
)
<if test="peasantHouseholdNo!=null and peasantHouseholdNo !=''">
and hygf_peasant_household.peasant_household_no like concat(concat("%",#{peasantHouseholdNo}),"%")
and hygf_peasant_household.peasant_household_no like concat(concat('%',#{peasantHouseholdNo}),'%')
</if>
<if test="ownersName!=null and ownersName !='' ">
and hygf_peasant_household.owners_name like concat(concat("%",#{ownersName}),"%")
and hygf_peasant_household.owners_name like concat(concat('%',#{ownersName}),'%')
</if>
</select>
......
......@@ -30,13 +30,13 @@
where std_user_biz.is_delete=0
<if test="dto.realName!=null">
and std_user_biz.real_name like concat(concat("%",#{dto.realName}),"%")
and std_user_biz.real_name like concat(concat('%',#{dto.realName}),'%')
</if>
<if test="dto.lockStatus!=null">
and std_user_biz.lock_status=#{dto.lockStatus}
</if>
<if test="dto.amosUserName!=null">
and std_user_biz.amos_user_name like concat(concat("%",#{dto.amosUserName}),"%")
and std_user_biz.amos_user_name like concat(concat('%',#{dto.amosUserName}),'%')
</if>
<if test="dto.amosUnitOrgCode!=null">
and hygf_personnel_business.amos_unit_org_code like concat(concat(#{dto.amosUnitOrgCode}),"%")
......
......@@ -19,16 +19,16 @@
where hygf_power_station.is_delete=0
<if test="powerStationCode!=null and powerStationCode!=''">
and hygf_power_station.power_station_code like concat(concat("%",#{powerStationCode}),"%")
and hygf_power_station.power_station_code like concat(concat('%',#{powerStationCode}),'%')
</if>
<if test="ownersName!=null and ownersName!=''">
and hygf_power_station.owners_name like concat(concat("%",#{ownersName}),"%")
and hygf_power_station.owners_name like concat(concat('%',#{ownersName}),'%')
</if>
<if test="serviceAgent!=null and serviceAgent!=''">
and hygf_power_station.service_agent like concat(concat("%",#{serviceAgent}),"%")
and hygf_power_station.service_agent like concat(concat('%',#{serviceAgent}),'%')
</if>
<if test="regionalCompaniesName!=null and regionalCompaniesName!=''">
and hygf_peasant_household.regional_companies_name like concat(concat("%",#{regionalCompaniesName}),"%")
and hygf_peasant_household.regional_companies_name like concat(concat('%',#{regionalCompaniesName}),'%')
</if>
<if test="processStatus != null and processStatus != ''">
and hygf_power_station.process_status = #{processStatus}
......
......@@ -7,7 +7,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
where hygf_document_station.preparation_money_id=#{sequenceNbr}
<if test="ownersName!=null and ownersName!=''">
and hygf_peasant_household.owners_name like concat(concat("%",#{ownersName}),"%")
and hygf_peasant_household.owners_name like concat(concat('%',#{ownersName}),'%')
</if>
</select>
......
......@@ -26,7 +26,7 @@
where hygf_regional_companies.is_delete=0
<if test="regionalCompaniesName!=null and regionalCompaniesName!=''">
and hygf_regional_companies.regional_companies_name like concat(concat("%",#{regionalCompaniesName}),"%")
and hygf_regional_companies.regional_companies_name like concat(concat('%',#{regionalCompaniesName}),'%')
</if>
<if test="unitId!=null and unitId!=''">
......
......@@ -16,7 +16,7 @@
and hh.status =#{status}
</if>
<if test="name!=null and name!='' ">
and hh.name like concat(concat("%",#{name}),"%")
and hh.name like concat(concat('%',#{name}),'%')
</if>
</select>
</mapper>
......@@ -17,7 +17,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<if test="dto.companyName!=null">
and privilege_company.COMPANY_NAME like concat(concat("%",#{dto.companyName}),"%")
and privilege_company.COMPANY_NAME like concat(concat('%',#{dto.companyName}),'%')
</if>
<if test="dto.level!=null">
and privilege_company.LEVEL=#{dto.level}
......@@ -46,7 +46,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<where>
<if test="role!=null">
and std_user_biz.role like concat(concat("%",#{role}),"%")
and std_user_biz.role like concat(concat('%',#{role}),'%')
</if>
<if test="regionalCompaniesSeq!=null">
and hygf_personnel_business.regional_companies_seq=#{regionalCompaniesSeq}
......@@ -72,7 +72,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<where>
<if test="role!=null">
and std_user_biz.role like concat(concat("%",#{role}),"%")
and std_user_biz.role like concat(concat('%',#{role}),'%')
</if>
<if test="regionalCompaniesSeq!=null">
and hygf_personnel_business.regional_companies_seq=#{regionalCompaniesSeq}
......@@ -98,7 +98,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<where>
<if test="role!=null">
and std_user_biz.role like concat(concat("%",#{role}),"%")
and std_user_biz.role like concat(concat('%',#{role}),'%')
</if>
<if test="regionalCompaniesSeq!=null">
and hygf_personnel_business.regional_companies_seq=#{regionalCompaniesSeq}
......@@ -125,7 +125,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<where>
<if test="role!=null">
and std_user_biz.role like concat(concat("%",#{role}),"%")
and std_user_biz.role like concat(concat('%',#{role}),'%')
</if>
<if test="regionalCompaniesSeq!=null">
and hygf_personnel_business.regional_companies_seq=#{regionalCompaniesSeq}
......
......@@ -17,10 +17,10 @@
FROM hygf_work_order
WHERE hygf_work_order.is_delete=0
<if test="dto.workOrderNum!=null and dto.workOrderNum!=''">
and hygf_work_order.work_order_num like concat(concat("%",#{dto.workOrderNum}),"%")
and hygf_work_order.work_order_num like concat(concat('%',#{dto.workOrderNum}),'%')
</if>
<if test="dto.projectRegionManager!=null and dto.projectRegionManager!=''">
and hygf_work_order.project_region_manager like concat(concat("%",#{dto.projectRegionManager}),"%")
and hygf_work_order.project_region_manager like concat(concat('%',#{dto.projectRegionManager}),'%')
</if>
<if test="dto.workOrderStatus!=null and dto.workOrderStatus!=''">
and hygf_work_order.work_order_status=#{dto.workOrderStatus}
......@@ -80,23 +80,23 @@
</if>
<if test="dto.projectAddressName!=null and dto.projectAddressName!=''">
and hygf_peasant_household.project_address_name like concat(concat("%",#{dto.projectAddressName}),"%")
and hygf_peasant_household.project_address_name like concat(concat('%',#{dto.projectAddressName}),'%')
</if>
<if test="dto.peasantHouseholdNo!=null and dto.peasantHouseholdNo!=''">
and hygf_peasant_household.peasant_household_no like concat(concat("%",#{dto.peasantHouseholdNo}),"%")
and hygf_peasant_household.peasant_household_no like concat(concat('%',#{dto.peasantHouseholdNo}),'%')
</if>
<if test="dto.ownersName!=null and dto.ownersName!=''">
and hygf_peasant_household.owners_name like concat(concat("%",#{dto.ownersName}),"%")
and hygf_peasant_household.owners_name like concat(concat('%',#{dto.ownersName}),'%')
</if>
<if test="dto.workOrderNum!=null and dto.workOrderNum!=''">
and hygf_work_order.work_order_num like concat(concat("%",#{dto.workOrderNum}),"%")
and hygf_work_order.work_order_num like concat(concat('%',#{dto.workOrderNum}),'%')
</if>
<if test="dto.projectRegionManager!=null and dto.projectRegionManager!=''">
and hygf_work_order.project_region_manager like concat(concat("%",#{dto.projectRegionManager}),"%")
and hygf_work_order.project_region_manager like concat(concat('%',#{dto.projectRegionManager}),'%')
</if>
<if test="dto.powerStationConstructionStatus!=null and dto.powerStationConstructionStatus!=''">
and hygf_work_order_power_station.power_station_construction_status=#{dto.powerStationConstructionStatus}
......
......@@ -13,7 +13,7 @@
WHERE
hygf_work_order_power_station.work_order_id=#{sequenceNbr}
<if test="ownersName!=null and ownersName!=''">
and hygf_peasant_household.owners_name like concat(concat("%",#{ownersName}),"%")
and hygf_peasant_household.owners_name like concat(concat('%',#{ownersName}),'%')
</if>
</select>
......
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.icbc.api.response.JftApiUserEntrustopenacctQueryResponseV1;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HouseholdContractDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfIcbcServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -15,6 +23,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.List;
/**
......@@ -55,7 +64,51 @@ public class HygfIcbcController extends BaseController {
@GetMapping(value = "/getHygfIcbcWalletInfo")
@ApiOperation(httpMethod = "GET",value = "获取钱包信息", notes = "获取钱包信息")
public ResponseModel<JftApiUserEntrustopenacctQueryResponseV1> getHygfIcbcWalletInfo(HttpServletRequest req, HttpServletResponse resp) {
return ResponseHelper.buildResponse(hygfIcbcService.getHygfIcbcWalletInfo(req, resp));
return ResponseHelper.buildResponse(hygfIcbcService.getHygfIcbcWalletInfo(req.getParameter("userId")));
}
/**
* 开户签约异步通知
*
*
* @param request request
* @param response response
* @return {@link Object}
* @author yangyang
* @throws
* @date 2024/7/18 19:39
*/
@TycloudOperation (ApiLevel = UserType.PUBLIC, needAuth = false)
@PostMapping (value = "/notify")
@ApiOperation (httpMethod = "POST", value = "注册电子钱包回调", notes = "注册电子钱包回调")
public Object notify(HttpServletRequest request, HttpServletResponse response) throws Exception {
return hygfIcbcService.registerWalletCallback(request, response);
}
@TycloudOperation (ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping (value = "/{sequenceNbr}")
@ApiOperation (httpMethod = "GET", value = "根据sequenceNbr查询注册电子钱包", notes = "注册电子钱包")
public ResponseModel<HygfIcbcRecordDTO> getObject(@PathVariable String sequenceNbr) {
return ResponseHelper.buildResponse(hygfIcbcService.getObject(Long.valueOf(sequenceNbr)));
}
@TycloudOperation (ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping (value = "/list")
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包列表查询", notes = "聚富通电子钱包列表查询")
@UserLimits
public ResponseModel<List<HygfIcbcRecordDTO>> listObject(@ApiParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
return ResponseHelper.buildResponse(hygfIcbcService.listObject(hygfIcbcRecordQueryDTO));
}
@TycloudOperation (ApiLevel = UserType.AGENCY)
@GetMapping (value = "/page")
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询")
@UserLimits
public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@RequestParam (value = "current") int current,
@RequestParam(value = "size") int size,
@ApiParam @RequestParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(current, size, hygfIcbcRecordQueryDTO));
}
}
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.codec.Base64;
import com.alibaba.fastjson.JSONObject;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.icbc.api.IcbcConstants;
import com.icbc.api.UiIcbcClient;
import com.icbc.api.request.JftApiUserEntrustopenacctQueryRequestV1;
import com.icbc.api.request.JftUiUserEntrustopenacctSubmitRequestV1;
import com.icbc.api.response.JftApiUserEntrustopenacctQueryResponseV1;
import com.icbc.api.utils.IcbcSignature;
import com.icbc.api.utils.WebUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.IcbcEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRecord;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HygfIcbcRecordMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IHygfIcbcService;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSON;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
......@@ -34,7 +59,7 @@ import java.util.UUID;
*/
@Service
@Slf4j
public class HygfIcbcServiceImpl implements IHygfIcbcService {
public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbcRecord, HygfIcbcRecordMapper> implements IHygfIcbcService {
private static final String trxChannel = "05"; // 05表示小程序
......@@ -50,7 +75,7 @@ public class HygfIcbcServiceImpl implements IHygfIcbcService {
// private static final String OUT_VENDOR_ID = "071301";
// private static final String PROJECT_ID = "PJ14001401B000160171";
// 测试环境
// 测试环境
private static final String APP_ID = "11000000000000009254";
private static final String corpNo = "10000000000000088011";
private static final String MY_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCxMt/01YNUsTfG6ml8Nyw7Xs80k3G72mmnD8mpR5v6ZU0v7i8lynBJxqDWFRqo6brZr/yzneyuEM0c+qbhYA4NNgWuri87PFWZND5H249ZpEZPmnZSOg6R7RwiFQG8uhwMTlZwYkNJc6fBFnLvUwMu3pPHINx10iHh7dawbX1GZDKk82gUBaTzYMkg0CW8PtOUdGwW+4uyt5KGWp90MTqS47JmGCLWWwLMW3MhPe8/PBApFdRQi2cdOXHQ+HwleTL7kHXi2XEHnbIxZuOuyXUkiRog4fajs+ZS+o+YgC2JEhGN5om64LrSUXrEyeOZSdHMriKLxsBUbS5AUP8rOvqjAgMBAAECggEBAKwB55YhoK+Yq70ilSzn3b7wBJFTwyaIGOD7mVUCVy3UIf4x5oB3p1JmRoAp0kw/PorLo7CzzykU1BaaVV4XQOygERoEqYKFyc3DAeX9AoUQytPA67Rb+QK8OP/4hkwuGMX1UUEckZZ+d0wev4kDeuaHVsoIYxjX1t4aYrm2PtIRGFLYZvB44Chu8oCK/yesZ9JP+BKKPLJzsx1bEnxZHkQK4IJBWbxSbi/QGiJ254Q4nyinCPUuaRzpiiN/ZmbdLIZ4NYZeQr7sK4wXhgy6XMeMZFHm/WE0EKSBqR82oO6PL/AOR6v9GVMj9kGLfegQHsFyiDJKHzYqj80hX5tyZIkCgYEA6PdmNOpiplNBkg9xxGgSZIWqbRqKBTR51QDB2WPKkC27S7Biy1E+ncz7osSP9X16Y87eKV32ioqJzZ9eND1ri9DnETkPhnYfv4DJRsD3fTHZCtPh274KXASma4DyZnCJY913vjHKqAjJKwl10SR7EFGwQ1LOHKXkLrUa4rASvH0CgYEAwrfxXj+94YnFkialYNbVT3pYdYR0x6b9z70YnYktaZtWZO01hV8lpdpKi/6f5DMIrDC6d9QsjmVXEjZFv1YLlkqEc8FXsThsXWphCr27EtEwymlN90RiIjBInhUh4BrQqMRKbz8CAQgyxiNohEJUVwVlESNSBjfi0eNHFwRg3Z8CgYBE/X73DLJKLz2r04cNcwR/YFYoGUPmZrPtsFu31SWXrPNaZtHbBCRW9u1ONoerW41zIUAJYBoyzPQiQJ/VOJswvJyxLQS7/R9JxwnUOjEQkkKEQlsQiCbpOTdPftBKJemJ+XwMhxJM0M1CQXryhKstGgPo7Ay9zyLT8i4UE7B4wQKBgQCKiNo2Jv2OUDn7sHkq+84J3M7A1XtMbLfZq/yuYGGp6DXAWrAgcsBTToqJLaBOeCysbYLNLGyC5wDa2TgoWCyoQd4YiS89zBn1IHFodfJ6AdFHwUISMVnsXxPbPMe8LPfViso2ecqQN2gAZkK/Dn3458KvPcTm3a4HjD8Q1jGgmwKBgHbzvyt1R38BEGeDhJhqOaBuTeqgChPyQrd1dFRE2VicrTksldel3eHbLgq1iYRyw+l9M66a/03XiCa3yLMIGOn/hOQE7dGxmBI2x44Tf5LugBuQnc5WSXwJ3Qa4+Yjw5yMBL/Hw8hRFlt5ycpy2YyAZ/jdnoNiOuM5koFpQFvfs";
......@@ -60,7 +85,21 @@ public class HygfIcbcServiceImpl implements IHygfIcbcService {
private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB";
private static final String OUT_VENDOR_ID = "071301";
private static final String PROJECT_ID = "PJ14001401B000160171";
@Value ("${hygf.icbc.trxLmtAmt:200000}")
private String trxLmtAmt;
@Value ("${hygf.icbc.dayLmtAmt:200000}")
private String dayLmtAmt;
@Value ("${hygf.icbc.loanTotalAmt:200000}")
private String loanTotalAmt;
@Value ("${hygf.icbc.notifyUrl:}")
private String notifyUrl;
@Resource (type = PeasantHouseholdServiceImpl.class)
private PeasantHouseholdServiceImpl peasantHouseholdService;
@Resource (type = HygfIcbcRecordMapper.class)
private HygfIcbcRecordMapper hygfIcbcRecordMapper;
public void icbcRegisterWalletUrl(HttpServletRequest req, HttpServletResponse resp) {
try {
......@@ -85,18 +124,23 @@ public class HygfIcbcServiceImpl implements IHygfIcbcService {
bizContent.setBusiCode(userId); // 缴费编号
Calendar calendar = Calendar.getInstance();
Date date = new Date();//当前时间
Date date = new Date();// 当前时间
calendar.setTime(date);
int year = 26;//26年
calendar.add(Calendar.YEAR, year);//在年份增加
int year = 26;// 26年
calendar.add(Calendar.YEAR, year);// 在年份增加
Date newDate = calendar.getTime();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = formatter.format(newDate);
bizContent.setProtocolEndDate(formattedDate); // 协议到期日
bizContent.setProtocolLimitAmount("99999999999999999"); // 协议累计额
// bizContent.setTemplateParams();
// bizContent.setCallbackUrl("https://www.icbc.com.cn/notify");
JSONObject templateParams = new JSONObject();
templateParams.put("prtl_enddate", formattedDate);
templateParams.put("loan_total_amt", loanTotalAmt);
templateParams.put("trx_lmt_amt", trxLmtAmt);
templateParams.put("day_lmt_amt", dayLmtAmt);
bizContent.setTemplateParams(templateParams.toJSONString());
bizContent.setCallbackUrl(notifyUrl);
bizContent.setCamsPublicKey(CAMS_PUBLIC_KEY);
request.setBizContent(bizContent);
......@@ -112,19 +156,14 @@ public class HygfIcbcServiceImpl implements IHygfIcbcService {
out.write("</body>");
out.write("</html>");
} catch (Exception e) {
log.error(e.getMessage(),e);
log.error(e.getMessage(), e);
throw new BadRequest("报错了");
}
}
public JftApiUserEntrustopenacctQueryResponseV1 getHygfIcbcWalletInfo(HttpServletRequest req, HttpServletResponse resp) {
String userId = req.getParameter("userId");
public JftApiUserEntrustopenacctQueryResponseV1 getHygfIcbcWalletInfo(String userId) {
DefaultIcbcClient client = new DefaultIcbcClient(
APP_ID,
IcbcConstants.SIGN_TYPE_RSA2,
......@@ -151,9 +190,193 @@ public class HygfIcbcServiceImpl implements IHygfIcbcService {
return response;
} catch (IcbcApiException e) {
e.printStackTrace();
log.error("聚富通委托代扣签约同步开户结果查询数据接口error: ", e);
return null;
}
}
/**
* 户用光伏开户签约异步通知使用
*
* @param request request
* @param response response
* @return {@link Object}
* @throws
* @author yangyang
* @date 2024/7/18 20:15
*/
public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {
log.info("户用光伏开户签约异步通知, => 验签");
boolean verifyFlag = verifySignData(request, notifyUrl);
String returnJson;
// 获取其他参数略...
if (verifyFlag) {
// 验签成功
String biz_content = request.getParameter("biz_content");
String decode = URLDecoder.decode(biz_content, "utf-8");
Map<String, String> data = JSONObject.parseObject(decode, Map.class);
log.info("解密后参数:{}", data);// 进行自己的处理,此处默认处理成功,返回通知方成功,return_code=0
// 其中certNo、custName、newPayAcc字段进行了base64编码,可以调用示例代码中的base64Decode进行解码
String custName = base64Decode(data.get("custName"));
String certNo = base64Decode(data.get("certNo"));
String newPayAcc = base64Decode(data.get("newPayAcc"));
String outUserId = data.get("outUserId");
String projectId = data.get("projectId");
String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag");
String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag");
JftApiUserEntrustopenacctQueryResponseV1 jftApiUserEntrustopenacctQueryResponse = this.getHygfIcbcWalletInfo(outUserId);
System.out.println(jftApiUserEntrustopenacctQueryResponse);
// region 保存数据
HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, outUserId).last(" limit 1").one();
if (hygfIcbcRecord == null) {
hygfIcbcRecord = new HygfIcbcRecord();
}
hygfIcbcRecord.setCustName(custName);
hygfIcbcRecord.setIdCard(certNo);
// hygfIcbcRecord.setPhone();
hygfIcbcRecord.setMediumId(newPayAcc);
hygfIcbcRecord.setProjectId(projectId);
hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag);
hygfIcbcRecord.setProtocolStatus(jftApiUserEntrustopenacctQueryResponse.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(jftApiUserEntrustopenacctQueryResponse.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(jftApiUserEntrustopenacctQueryResponse.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(jftApiUserEntrustopenacctQueryResponse.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(jftApiUserEntrustopenacctQueryResponse.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(jftApiUserEntrustopenacctQueryResponse.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(jftApiUserEntrustopenacctQueryResponse.getAppId());
hygfIcbcRecord.setOutUserId(jftApiUserEntrustopenacctQueryResponse.getOutUserId());
hygfIcbcRecord.setOutVendorId(jftApiUserEntrustopenacctQueryResponse.getOutVendorId());
hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag);
// hygfIcbcRecord.setDiscardStatus();
hygfIcbcRecord.setAmosUserId(outUserId);
hygfIcbcRecord.setRecDate(new Date());
this.saveOrUpdate(hygfIcbcRecord);
// endregion
String copReturnCode = "0";// 通知合作方接收成功的返回码,固定
String copReturnMsg = "success";// 合作方的返回信息,固定
returnJson = sign(request, copReturnCode, copReturnMsg);
log.error("通知响应json结果:{}", returnJson);
return returnJson;
} else {// 验签失败
String copReturnCode = "‐12345";
String copReturnMsg = "icbc jft sign not pass.";
returnJson = sign(request, copReturnCode, copReturnMsg);
log.error("通知响应json结果:{}", returnJson);
}
return returnJson;
}
public HygfIcbcRecordDTO getObject(Long sequenceNbr) {
HygfIcbcRecordDTO hygfIcbcRecordDTO = this.queryBySeq(sequenceNbr);
return hygfIcbcRecordDTO;
}
public List<HygfIcbcRecordDTO> listObject(HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO);
return toModels(list);
}
public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
PageHelper.startPage(current, size);
// List<HygfIcbcRecord> hygfIcbcRecords = this.lambdaQuery().eq(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getOpenAccountState()), HygfIcbcRecord::getOpenAccountState, hygfIcbcRecordQueryDTO.getOpenAccountState()).like(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getCustName()), HygfIcbcRecord::getCustName, hygfIcbcRecordQueryDTO.getCustName()).like(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getIdCard()), HygfIcbcRecord::getIdCard, hygfIcbcRecordQueryDTO.getIdCard()).eq(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getPhone()), HygfIcbcRecord::getPhone, hygfIcbcRecordQueryDTO.getPhone()).list();
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO);
toModels(list);
PageInfo<HygfIcbcRecordDTO> pageInfo = new PageInfo<>(list);
Page<HygfIcbcRecordDTO> page = new Page<>();
page.setSize(pageInfo.getSize());
page.setCurrent(pageInfo.getPageNum());
page.setTotal(pageInfo.getTotal());
page.setRecords(list);
return page;
}
private List<HygfIcbcRecordDTO> toModels(List<HygfIcbcRecordDTO> hygfIcbcRecords) {
if (CollectionUtils.isEmpty(hygfIcbcRecords)) {
return Collections.emptyList();
}
List<String> amosUserIds = hygfIcbcRecords.stream().map(HygfIcbcRecordDTO::getAmosUserId).collect(Collectors.toList());
List<PeasantHousehold> peasantHouseholds = peasantHouseholdService.lambdaQuery().in(PeasantHousehold::getAmosUserId, amosUserIds).list();
Map<String, List<PeasantHousehold>> PeasantHouseholdMap = peasantHouseholds.stream().collect(Collectors.groupingBy(PeasantHousehold::getAmosUserId));// 根据农户 ID 分组
return hygfIcbcRecords.stream().map(hygfIcbcRecordDTO -> {
hygfIcbcRecordDTO.setOpenAccountStatusName(IcbcEnum.OpenAccountState.getNameByCode(hygfIcbcRecordDTO.getOpenAccountStatus(), IcbcEnum.OpenAccountState.INITIAL.getName()));
List<PeasantHousehold> peasantHouseholdList = PeasantHouseholdMap.get(hygfIcbcRecordDTO.getAmosUserId());
hygfIcbcRecordDTO.setPeasantHouseholds(Bean.toModels(peasantHouseholdList, HygfIcbcRecordDTO.IcbcPeasantHousehold.class));
return hygfIcbcRecordDTO;
}).collect(Collectors.toList());
}
/**
* 验签方法
*
* @param request
* @param path
* @return
* @throws Exception
*/
private boolean verifySignData(HttpServletRequest request, String path) throws Exception {
// 网关公钥
Map<String, String> params = new HashMap<>();
String api = request.getParameter("api");
String from = request.getParameter("from");
String app_id = request.getParameter("app_id");
String charset = request.getParameter("charset");
String format = request.getParameter("format");
String encrypt_type = request.getParameter("encrypt_type");
String timestamp = request.getParameter("timestamp");
String biz_content = request.getParameter("biz_content");
String sign_type = request.getParameter("sign_type");
String sign = request.getParameter("sign");
params.put("from", from);
params.put("api", api);
params.put("app_id", app_id);
params.put("charset", charset);
params.put("format", format);
params.put("encrypt_type", encrypt_type);
params.put("timestamp", timestamp);
params.put("biz_content", biz_content);
params.put("sign_type", sign_type);// 目前上行网关签名暂时仅支持RSA
/**********验证工行上行网关RSA签名**********/
String signStr = WebUtils.buildOrderedSignStr(path, params);
log.error("验签入参,signStr:[[{}]], sign_type:[[{}]], APIGW_PUBLIC_KEY: [[{}]],charset:[[{}]],sign:[[{}]]", signStr, sign_type, APIGW_PUBLIC_KEY, charset, sign);
boolean flag = IcbcSignature.verify(signStr, sign_type, APIGW_PUBLIC_KEY, charset, sign);
log.error("验签结果:[[{}]]", flag);
return flag;
}
/**
* 加签方法
*
* @param request
* @param copReturnCode
* @param copReturnMsg
* @return
* @throws Exception
*/
private String sign(HttpServletRequest request, String copReturnCode, String copReturnMsg) throws Exception {
String msg_id = new SimpleDateFormat("yyyyMMdd").format(new Date()) + new SimpleDateFormat("HHmmss").format(new Date());
String responseBizContent = "{\"return_code\":\"" + copReturnCode + "\",\"return_msg\":\"" + copReturnMsg + "\"" + ",\"msg_id\":\"" + msg_id + "\"}";
String charset = request.getParameter("charset");// 调用过程使用的编码格式
/**********商户对消息返回响应进行签名,签名方式需与在API平台登记APP的sign_type保持一致(目前基本都是RSA2)**********/
String signType = IcbcConstants.SIGN_TYPE_RSA2;
String signStr = "\"response_biz_content\":" + responseBizContent + "," + "\"sign_type\":" + "\"" + signType + "\"";
String signParam = IcbcSignature.sign(signStr, signType, MY_PRIVATE_KEY, charset);
String returnJson = "{\"response_biz_content\":" + responseBizContent + ",\"sign_type\":\"" + signType + "\"" + ",\"sign\":\"" + signParam + "\"}";
return returnJson;
}
/**
* base64Decode
*
* @param str
* @return
* @throws UnsupportedEncodingException
*/
public String base64Decode(String str) throws UnsupportedEncodingException {
if (str == null || "".equals(str)) {
return "";
}
char[] ch = str.toCharArray();
byte[] bt = Base64.decode(String.valueOf(ch));
return new String(bt, "UTF-8");
}
}
\ No newline at end of file
......@@ -246,3 +246,6 @@ spring.elasticsearch.rest.connection-timeout=30000
spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.read-timeout=30000
## 聚富通 配置
hygf.icbc.notifyUrl=http://47.92.234.253:8088/hygf/icbc/notify
\ No newline at end of file
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