Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/5 16:03 |
| | | * @LastEditTime 2023/12/5 16:03 |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/27 15:00 |
| | | * @LastEditTime :2024/6/27 15:00 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SePaymentMethodMapper extends BaseMapper<SePaymentMethod> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取全部未删除付款方式 |
| | | * |
| | | * @return 未删除付款方式 |
| | | */ |
| | | List<SePaymentMethod> getPaymentMethods(); |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/5 16:03 |
| | | * @LastEditTime 2023/12/5 16:03 |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/27 15:00 |
| | | * @LastEditTime :2024/6/27 15:00 |
| | | * @Description |
| | | */ |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * 付款方式表 |
| | | */ |
| | | |
| | | @TableName(value="se_payment_method", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "付款方式实体") |
| | | public class SePaymentMethod implements BaseEntity { |
| | | public class SePaymentMethod { |
| | | public static final long serialVersionUID = 202401151518006L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * 付款方式 |
| | | */ |
| | | @Schema(description = "付款方式名称", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "付款方式名称不能为空") //不能为空也不能为null |
| | | @Length(message = "付款方式名称名称不大于{max}字,不小于{min}字", min = 1, max = 10) |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注长度小于{max}字", min = 1, max = 200) |
| | | * 备注信息 |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | @Schema(description = "付款方式删除标志,表单不用填写", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | private Byte deleted; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getRemarks() { |
| | | return remarks; |
| | | } |
| | | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public Byte getDeleted() { |
| | | return deleted; |
| | | } |
| | | |
| | | public void setDeleted(Byte deleted) { |
| | | this.deleted = deleted; |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.voBa; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | |
| | | private static final long serialVersionUID = 202406262059001L; |
| | | |
| | | /** |
| | | * 字典项ID |
| | | */ |
| | | @JSONField(serializeUsing = ObjectWriterImplToString.class) |
| | | private Long dictItemId; |
| | | |
| | | /** |
| | | * 标签 |
| | | */ |
| | | private String name; |
| | |
| | | private String villageName; |
| | | |
| | | @Schema(title = "片区ID") |
| | | private String blockid; |
| | | private String blockId; |
| | | @Schema(title = "片区名称") |
| | | private String bolckName; |
| | | private String blockName; |
| | | |
| | | @Schema(title = "分水房ID") |
| | | private String divideId; |
| | |
| | | private String phone; |
| | | |
| | | @Schema(title = "身份证号") |
| | | private String idcard; |
| | | private String idCard; |
| | | |
| | | @Schema(title = "种植面积") |
| | | private Double area; |
| | |
| | | |
| | | pipIrr: |
| | | global: |
| | | dev: true #是否开发阶段,true或false |
| | | dev: false #是否开发阶段,true或false |
| | | dsName: ym #开发阶段,设置临时的数据库名称 |
| | | mw: |
| | | webPort: 8070 |
| | |
| | | </province> |
| | | </districts> |
| | | <user name="超级管理员" phone="admin" password="admin" supperAdmin="1" /> |
| | | <payments> |
| | | <item1 name="现金"/> |
| | | <item2 name="微信支付"/> |
| | | <item3 name="支付宝支付"/> |
| | | <item4 name="银行转账"/> |
| | | </payments> |
| | | <settings> |
| | | <item1 item_name="lng" item_value="101.87345" remarks="经度"/> |
| | | <item2 item_name="lat" item_value="25.70424" remarks="纬度"/> |
| | | <item3 item_name="projectNo" item_value="10" remarks="项目编号"/> |
| | | <item4 item_name="controllerType" item_value="57" remarks="控制器类型"/> |
| | | <item5 item_name="protocolName" item_value="p206V202404" remarks="协议名称"/> |
| | | </settings> |
| | | </org1> |
| | | </orgs> |
| | | </config> |
| | |
| | | <!--根据字典Code获取字典项--> |
| | | <select id="getDictItemsByDictCode" resultType="com.dy.pipIrrGlobal.voBa.VoDictItem"> |
| | | SELECT |
| | | name, value |
| | | id AS dictItemId, |
| | | name, |
| | | value |
| | | FROM ba_dict_item |
| | | WHERE deleted = 0 AND status = 1 AND dict_code = #{dictCode} |
| | | ORDER BY sort |
| | |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP}, |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP} |
| | | <!-- disabled = #{disabled,jdbcType=TINYINT},--> |
| | | <!-- deleted = #{deleted,jdbcType=TINYINT}--> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | CAST(cli.villageId AS char) AS villageId, |
| | | dis_village.name AS villageName, |
| | | CAST(cli.blockId AS char) AS blockId, |
| | | blo.name AS bolckName, |
| | | blo.name AS blockName, |
| | | CAST(cli.divideId AS char) AS divideId, |
| | | divi.name AS divideName, |
| | | CAST(cli.typeId AS char) AS waterTypeId, |
| | |
| | | |
| | | <!--根据农户编号获取5级行政区划代码--> |
| | | <select id="getAreaCodeByNum" resultType="java.lang.Long"> |
| | | SELECT districtNum FROM se_client WHERE clientNum = ${clientNum} |
| | | SELECT districtNum FROM se_client WHERE clientNum = ${clientNum} LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用--> |
| | |
| | | |
| | | <!--根据农户编号获取农户ID--> |
| | | <select id="getClientIdByNum" resultType="java.lang.Long"> |
| | | SELECT id FROM se_client WHERE clientNum = ${clientNum} |
| | | SELECT id FROM se_client WHERE clientNum = ${clientNum} LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据电话号码获取农户ID--> |
| | |
| | | from se_payment_method |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--获取全部未删除付款方式--> |
| | | <select id="getPaymentMethods" resultType="com.dy.pipIrrGlobal.pojoSe.SePaymentMethod"> |
| | | SELECT * FROM se_payment_method WHERE deleted = 0 |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_payment_method |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SePaymentMethod" useGeneratedKeys="true"> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SePaymentMethod" > |
| | | <!--@mbg.generated--> |
| | | insert into se_payment_method (`name`, remarks, deleted |
| | | insert into se_payment_method (id, `name`, remarks, deleted |
| | | ) |
| | | values (#{name,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{deleted,jdbcType=TINYINT} |
| | | values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{deleted,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SePaymentMethod" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_payment_method |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="name != null"> |
| | | `name`, |
| | | </if> |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | |
| | | deleted = #{deleted,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <!--获取全部未删除付款方式--> |
| | | <select id="getPaymentMethods" resultType="com.dy.pipIrrGlobal.pojoSe.SePaymentMethod"> |
| | | SELECT * FROM se_payment_method WHERE deleted = 0 |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
| | | <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_16"> |
| | | <output url="file://$MODULE_DIR$/target/classes" /> |
| | | <output-test url="file://$MODULE_DIR$/target/test-classes" /> |
| | | <content url="file://$MODULE_DIR$"> |
| | | <excludeFolder url="file://$MODULE_DIR$/target" /> |
| | | </content> |
| | | <orderEntry type="inheritedJdk" /> |
| | | <orderEntry type="sourceFolder" forTests="false" /> |
| | | </component> |
| | | </module> |
| | |
| | | }) |
| | | } |
| | | ) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoBa"}) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoSe"}) |
| | | public class PipIrrBaseApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | import com.dy.common.util.MD5; |
| | | import com.dy.common.webListener.ConfigListener; |
| | | import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaUserMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaDistrict; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaSettings; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.util.DistrictLevel; |
| | | import org.jdom2.Document; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | private BaDistrictMapper distriDao ; |
| | | private BaUserMapper userDao ; |
| | | private SePaymentMethodMapper paymentMethodDao ; |
| | | private BaSettingsMapper settingsDao ; |
| | | |
| | | @Autowired |
| | | public void setDistriDao(BaDistrictMapper distriDao){ |
| | |
| | | @Autowired |
| | | public void setUserDao(BaUserMapper userDao){ |
| | | this.userDao = userDao ; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setPaymentDao(SePaymentMethodMapper paymentMethodDao){ |
| | | this.paymentMethodDao = paymentMethodDao ; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setSettingsDao(BaSettingsMapper settingsDao){ |
| | | this.settingsDao = settingsDao ; |
| | | } |
| | | |
| | | |
| | |
| | | this.saveUser(orgTag, name, phone, password, supperAdmin); |
| | | } |
| | | } |
| | | if(!this.existPayments()){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".payments")){ |
| | | for(int i = 1 ; i < 10000; i++){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".payments.item" + i)){ |
| | | String name = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".payments.item" + i,"name", null, false, null) ; |
| | | this.savePayment(orgTag, name); |
| | | }else{ |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(!this.existSettings()){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".settings")){ |
| | | for(int i = 1 ; i < 10000; i++){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".settings.item" + i)){ |
| | | String item_name = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".settings.item" + i,"item_name", null, false, null) ; |
| | | String item_value = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".settings.item" + i,"item_value", null, false, null) ; |
| | | String remarks = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".settings.item" + i,"remarks", null, false, null) ; |
| | | this.saveSettings(orgTag, item_name, item_value, remarks); |
| | | }else{ |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | break ; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在行政区划数据 |
| | | * 数据库中是否存在用户数据 |
| | | * @return 存在否 |
| | | */ |
| | | private boolean existUsers(){ |
| | | Long total = this.userDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在支付方式数据 |
| | | * @return 存在否 |
| | | */ |
| | | private boolean existPayments(){ |
| | | Long total = this.paymentMethodDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在系统配置数据 |
| | | * @return 存在否 |
| | | */ |
| | | private boolean existSettings(){ |
| | | Long total = this.settingsDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | |
| | | this.userDao.putin(po) ; |
| | | } |
| | | } |
| | | /** |
| | | * 保存支付方式 |
| | | * @param orgTag 机构标签 |
| | | * @param name 名称 |
| | | */ |
| | | private void savePayment(String orgTag, String name) throws Exception{ |
| | | if(name != null && !name.trim().equals("")){ |
| | | SePaymentMethod po = new SePaymentMethod() ; |
| | | po.setName(name); |
| | | po.setDeleted(Deleted.NO.code); |
| | | this.paymentMethodDao.insert(po) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存系统配置 |
| | | * @param item_name 配置项 |
| | | * @param item_value 配置项值 |
| | | * @param remarks 备注信息 |
| | | * @throws Exception |
| | | */ |
| | | private void saveSettings(String orgTag,String item_name, String item_value,String remarks) throws Exception{ |
| | | if((item_name != null && !item_name.trim().equals("")) && |
| | | (item_value != null && !item_value.trim().equals("")) && |
| | | (remarks != null && !remarks.trim().equals(""))){ |
| | | BaSettings po = new BaSettings() ; |
| | | po.setItemName(item_name); |
| | | po.setItemValue(item_value); |
| | | po.setRemarks(remarks); |
| | | this.settingsDao.insert(po) ; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据控制器编号逻辑删除控制 |
| | | * 根据控制器编号物理删除控制 |
| | | * |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer deleteControllerById(Long controllerId) { |
| | | return prControllerMapper.deleteControllerById(controllerId); |
| | | return prControllerMapper.deleteByPrimaryKey(controllerId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param bindingResult |
| | | * @return 水卡编号 |
| | | */ |
| | | @Operation(summary = "开卡", description = "新开农户卡") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "active", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | |
| | | } |
| | | |
| | | // 获取5级行政区划串areaCode |
| | | String areaCode = String.valueOf(cardOperateSv.getAreaCodeByNum(po.getClientNum())); |
| | | String areaCode = cardOperateSv.getAreaCodeByNum(po.getClientNum()); |
| | | if(areaCode.trim().length() == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.AREA_CODE_MISTAKE.getMessage()); |
| | | } |
| | | |
| | | // p206V1_0_1协议,将前6位行政区划改为100000 |
| | | if(po.getProtocol().trim().equals("p206V1_0_1")) { |
| | | areaCode = "100000" + areaCode.substring(6); |
| | | } |
| | | |
| | | /** |
| | | * 根据行政区划串(areaCode)在水卡表中针对水卡编号(cardNum)进行模糊查询 |
| | |
| | | if(cardNum != null && cardNum.trim().length() > 0) { |
| | | Integer number = Integer.parseInt(cardNum.substring(12)); |
| | | number = number + 1; |
| | | if(number > 9999) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_OVERRUN.getMessage()); |
| | | if(number > 65535) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_OVERRUN.getMessage()); |
| | | } |
| | | cardNum = cardNum.substring(0, 12) + String.format("%04d", number); |
| | | cardNum = cardNum.substring(0, 12) + String.format("%05d", number); |
| | | } else { |
| | | cardNum = areaCode + "0001"; |
| | | cardNum = areaCode + "00001"; |
| | | } |
| | | |
| | | /** |
| | |
| | | * 根据农户编号获取农户ID |
| | | */ |
| | | Long clientId = cardOperateSv.getClientIdByNum(clientNum); |
| | | if(clientId == null) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.CLIENT_NUM_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加农户卡记录,退还金额作为当前余额 |
| | |
| | | seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode()); |
| | | Long cardId = Optional.ofNullable(clientCardSv.add(seClientCard)).orElse(0L) ; |
| | | if(cardId == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | |
| | | seCardOperate.setOperateDt(activeTime); |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR.getMessage()); |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | |
| | | dtoRecharge.setPrice(0f); |
| | | BaseResponse<Boolean> job = cardOperateSv.addRecharge(dtoRecharge); |
| | | if(!job.getCode().equals("0001")) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_RECHARGE_EXCEPTION.getMessage()); |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.ACTIVE_FAIL_RECHARGE_EXCEPTION.getMessage()); |
| | | } |
| | | } |
| | | |
| | | if(po.getProtocol().trim().equals("p206V1_0_1")) { |
| | | cardNum = cardNum.substring(6,12) + cardNum.substring(13); |
| | | } |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("projectCode", Constant.projectCode_ym); |
| | | map.put("projectNo", String.format("%02x", Integer.parseInt(cardOperateSv.getProjectNo()))); |
| | | map.put("orderNumber", cardId); |
| | | map.put("cardNum", cardNum); |
| | | return BaseResponseUtils.buildSuccess(map) ; |
| | | } |
| | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | |
| | | @Autowired |
| | | private SeGeneralMapper seGeneralMapper; |
| | | |
| | | @Autowired |
| | | private BaSettingsMapper baSettingsMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加开卡记录 |
| | |
| | | * @param clientNum 农户编号 |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | public Long getAreaCodeByNum(String clientNum) { |
| | | return seClientMapper.getAreaCodeByNum(clientNum); |
| | | public String getAreaCodeByNum(String clientNum) { |
| | | Long areaCode = seClientMapper.getAreaCodeByNum(clientNum); |
| | | if (areaCode == null) { |
| | | return ""; |
| | | } |
| | | return String.valueOf(areaCode); |
| | | } |
| | | |
| | | /** |
| | |
| | | public Integer updateClientCard(SeClientCard po) { |
| | | return seClientCardMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 获取项目编号 |
| | | * @return |
| | | */ |
| | | public String getProjectNo() { |
| | | return baSettingsMapper.getItemValue("projectNo"); |
| | | } |
| | | } |
| | |
| | | @Schema(name = "开卡传入对象") |
| | | public class DtoActiveCard { |
| | | public static final long serialVersionUID = 202401181945001L; |
| | | |
| | | /** |
| | | * 协议名称 |
| | | */ |
| | | @NotBlank(message = "您必须选择一个协议") |
| | | private String protocol; |
| | | |
| | | /** |
| | | * 水卡地址,仅保存,无业务 |
| | | */ |
| | |
| | | * 农户编号,开卡使用 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientNum; |
| | | |
| | | /** |
| | |
| | | String villageName = map_districts.get("villageName").toString(); |
| | | |
| | | // 生成8位行政区划编码,生成农户编号用 |
| | | String district8 = countyNum + townNum + villageNum; |
| | | String district8 = String.format("%02d", Integer.parseInt(countyNum)) + String.format("%03d", Integer.parseInt(townNum)) + String.format("%03d", Integer.parseInt(villageNum)); |
| | | // 生成农户编号 |
| | | String clientNum = generateClientNum(district8); |
| | | // 生成12位5级行政区划编码串及名称串 |
| | |
| | | @Mapping(target = "name", source = "name") |
| | | @Mapping(target = "clientNum", source = "clientnum") |
| | | @Mapping(target = "phone", source = "phone") |
| | | @Mapping(target = "idcard", source = "idcard") |
| | | @Mapping(target = "idCard", source = "idcard") |
| | | //@Mapping(target = "cardCount", source = "cardCount") |
| | | @Mapping(target = "address", source = "address") |
| | | @Mapping(target = "operateDt", source = "operatedt") |
| | |
| | | * 开卡/补卡 |
| | | */ |
| | | AREA_CODE_MISTAKE(10001, "该农户行政区划异常"), |
| | | CLIENT_NUM_ERROR(10001, "农户编号错误"), |
| | | CARD_NUMBER_OVERRUN(10002, "水卡编号已满"), |
| | | ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR(10003, "开卡失败-农户卡写入异常"), |
| | | ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR(10004, "开卡失败-开卡记录写入异常"), |