From ad703f44063beafca0c1ec0913cb7d487179ef8f Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期五, 22 十二月 2023 15:53:44 +0800 Subject: [PATCH] 2023-12-22 朱宝民 农户添加和查询 --- pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java | 19 + pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml | 26 + pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClient.java | 96 +++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java | 9 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml | 340 ++++++++++++++++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoClient.java | 50 ++ pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java | 76 ++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClient.java | 179 +++++++++ pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryVo.java | 46 ++ pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java | 156 ++++++++ pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/java/com/dy/pipIrrDemo/demo/DemoCtrl.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java | 30 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java | 49 ++ 13 files changed, 1,076 insertions(+), 2 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java index 8916527..b941586 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java @@ -3,8 +3,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoBa.BaDistrict; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; @Mapper public interface BaDistrictMapper extends BaseMapper<BaDistrict> { @@ -73,4 +75,11 @@ */ int deleteLogicById(Long id); + /** + * 鏍规嵁鏉戠紪鍙疯幏鍙�5绾у尯鍒掍俊鎭� + * @param villageId 鏉戠紪鍙凤紙涓婚敭锛� + * @return 5绾ц鏀垮尯鍒掍俊鎭� + */ + Map getDistrictsByVillageId(@Param("villageId") Long villageId); + } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java new file mode 100644 index 0000000..ee1e40d --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java @@ -0,0 +1,49 @@ +package com.dy.pipIrrGlobal.daoSe; + +import com.dy.pipIrrGlobal.pojoSe.SeClient; +import com.dy.pipIrrGlobal.voSe.VoClient; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author ZhuBaoMin + * @date 2023/12/22 9:50 + * @LastEditTime 2023/12/22 9:50 + * @Description + */ +public interface SeClientMapper { + int deleteByPrimaryKey(Long id); + + int insert(SeClient record); + + int insertSelective(SeClient record); + + SeClient selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(SeClient record); + + int updateByPrimaryKey(SeClient record); + + /** + * 鏍规嵁6浣嶅尯鍒掍覆妯$硦鏌ヨ鍐滄埛缂栧彿 + * @param district8 + * @return + */ + String getClientNumOfMax(@Param("district8") String district8); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛璁板綍鏁� + * @param params + * @return + */ + Long getRecordCount(Map<?, ?> params); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏁版嵁 + * @param params + * @return + */ + List<VoClient> getClients(Map<?, ?> params); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClient.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClient.java new file mode 100644 index 0000000..9e38e29 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClient.java @@ -0,0 +1,179 @@ +package com.dy.pipIrrGlobal.pojoSe; + +/** + * @author ZhuBaoMin + * @date 2023/12/21 19:08 + * @LastEditTime 2023/12/21 19:08 + * @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.*; +import lombok.*; +import org.hibernate.validator.constraints.Length; + +import java.util.Date; + +/** + * 鍐滄埛琛� + */ + +@TableName(value="se_client", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "鍐滄埛瀹炰綋") +public class SeClient implements BaseEntity { + public static final long serialVersionUID = 202311141539001L; + + /** + * 涓婚敭 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Long id; + + /** + * 鍘縄D + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ幙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ幙涓嶈兘涓虹┖") + private Long countyid; + + /** + * 闀嘔D + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄩ晣ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄩ晣涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + private Long townid; + + /** + * 鏉慖D + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄦ潙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄦ潙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + private Long villageid; + + /** + * 鐗囧尯ID + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄧ墖鍖篒D", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄧ墖鍖轰笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + private Long blockid; + + /** + * 鍒嗘按鎴縄D + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ垎姘存埧ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ垎姘存埧涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + private Long divideid; + + /** + * 鍐滄埛濮撳悕 + */ + @Schema(description = "鍐滄埛濮撳悕", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "鍐滄埛濮撳悕涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍐滄埛濮撳悕涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + private String name; + + /** + * 鍐滄埛缂栧彿;6浣嶅尯鍒� + 4涓洪『搴忓彿 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED) + //@NotBlank(message = "鍐滄埛缂栧彿涓嶈兘涓虹┖") + private String clientnum; + + /** + * 鍖哄垝缂栫爜涓�;鐪佸尯鍒�+甯傚尯鍒�+鍘垮尯鍒�+闀囧尯鍒�+鏉戝尯鍒� + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @Schema(description = "鍖哄垝缂栫爜涓�", requiredMode = Schema.RequiredMode.REQUIRED) + //@NotNull(message = "鍖哄垝缂栫爜涓蹭笉鑳戒负绌�") + private Long districtnum; + + /** + * 鍖哄垝鍚嶇О涓�;鍘垮悕+闀囧悕+鏉戝悕锛岀敤浜庡綊灞炲湴 + */ + @Schema(description = "鍖哄垝鍚嶇О涓�", requiredMode = Schema.RequiredMode.REQUIRED) + //@NotBlank(message = "鍖哄垝鍚嶇О涓�") + private String districttitle; + + /** + * 鎵嬫満鍙� + */ + @Schema(description = "鍐滄埛鎵嬫満鍙�", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鍐滄埛鎵嬫満鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍐滄埛鎵嬫満鍙峰繀椤粄max}浣嶆暟鎹�", min = 11, max = 11) + private String phone; + + /** + * 韬唤璇佸彿 + */ + @Schema(description = "鍐滄埛韬唤璇佸彿", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "鍐滄埛韬唤璇佸彿涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍐滄埛韬唤璇佸彿蹇呴』{max}浣嶆暟鎹�", min = 18, max = 18) + private String idcard; + + /** + * 绉嶆闈㈢Н + */ + @Schema(description = "鍐滄埛绉嶆闈㈢Н", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Double area; + + /** + * 琛楅亾鍙婇棬鐗屽彿 + */ + @Schema(description = "琛楅亾+闂ㄧ墝鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "鍦板潃涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 50) + private String address; + + /** + * 澶囨敞淇℃伅 + */ + @Schema(description = "澶囨敞", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "澶囨敞涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 200) + private String remarks; + + /** + * 鎿嶄綔浜虹紪鍙� + */ + @Schema(description = "鎿嶄綔浜虹紪鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @NotNull(message = "鎿嶄綔浜虹紪鍙蜂笉鑳戒负绌�") + private Long operator; + + /** + * 鎿嶄綔鏃堕棿 + */ + @Schema(description = "鎿嶄綔鏃堕棿", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Date operatedt; + + /** + * 绂佹鏍囧織;0-鏈锛�1-宸茬 + */ + @Schema(description = "鏄惁绂佺敤", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Max(message = "鏄惁绂佺敤鍙兘0鎴�1", value = 1) + @Min(message = "鏄惁绂佺敤鍙兘0鎴�1",value = 0) + private Byte disabled; + + /** + * 閫昏緫鍒犻櫎鏍囪瘑;0-鏈垹闄わ紝1-鍒犻櫎 + */ + @Schema(description = "鍒犻櫎鏍囪瘑锛宖orm琛ㄥ崟涓笉瀛樺湪锛屽彧鍦ㄦ煡璇㈡樉绀轰腑鏈夋晥", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Byte deleted; + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoClient.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoClient.java new file mode 100644 index 0000000..2a1cf2d --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoClient.java @@ -0,0 +1,50 @@ +package com.dy.pipIrrGlobal.voSe; + +import com.dy.common.po.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author ZhuBaoMin + * @date 2023/12/22 11:43 + * @LastEditTime 2023/12/22 11:43 + * @Description + */ + +@Data +@Schema(title = "鍐滄埛瑙嗗浘瀵硅薄") +public class VoClient implements BaseEntity { + private static final long serialVersionUID = 1L; + + @Schema(title = "ID") + private Long id; + + @Schema(title = "鍐滄埛濮撳悕") + private String name; + + @Schema(title = "鍐滄埛缂栧彿") + private String clientNum; + + @Schema(title = "鎵嬫満鍙�") + private String phone; + + @Schema(title = "韬唤璇佸彿") + private String idCard; + + @Schema(title = "鍗$墖鏁伴噺") + private Integer cardCount; + + @Schema(title = "鍦板潃") + private String address; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Schema(title = "娉ㄥ唽鏃堕棿") + private Date operateDt; + + +} diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml index 4234af5..23dd4ce 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml @@ -139,4 +139,30 @@ update ba_district set deleted = 1 where id = #{id,jdbcType=BIGINT} </delete> + + <!--鏍规嵁鏉戠紪鍙疯幏鍙�5绾у尯鍒掍俊鎭�--> + <select id="getDistrictsByVillageId" resultType="java.util.Map"> + SELECT + pro.id AS provinceId, + pro.num AS provinceNum, + pro.name AS provinceName, + cit.id AS cityId, + cit.num AS cityNum, + cit.name AS cityName, + con.id AS countryId, + con.num AS countyNum, + con.name AS countryName, + tow.id AS townId, + tow.num AS townNum, + tow.name AS townName, + vil.id AS villageId, + vil.num AS villageNum, + vil.name AS villageName + FROM ba_district vil + INNER JOIN ba_district tow ON vil.supperId = tow.id + INNER JOIN ba_district con ON tow.supperId = con.id + INNER JOIN ba_district cit ON con.supperId = cit.id + INNER JOIN ba_district pro ON cit.supperId = pro.id + WHERE vil.id = ${villageId} + </select> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml new file mode 100644 index 0000000..9975113 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml @@ -0,0 +1,340 @@ +<?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.dy.pipIrrGlobal.daoSe.SeClientMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeClient"> + <!--@mbg.generated--> + <!--@Table se_client--> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="countyId" jdbcType="BIGINT" property="countyid" /> + <result column="townId" jdbcType="BIGINT" property="townid" /> + <result column="villageId" jdbcType="BIGINT" property="villageid" /> + <result column="blockId" jdbcType="BIGINT" property="blockid" /> + <result column="divideId" jdbcType="BIGINT" property="divideid" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> + <result column="districtNum" jdbcType="BIGINT" property="districtnum" /> + <result column="districtTitle" jdbcType="VARCHAR" property="districttitle" /> + <result column="phone" jdbcType="VARCHAR" property="phone" /> + <result column="idCard" jdbcType="VARCHAR" property="idcard" /> + <result column="area" jdbcType="DOUBLE" property="area" /> + <result column="address" jdbcType="VARCHAR" property="address" /> + <result column="remarks" jdbcType="VARCHAR" property="remarks" /> + <result column="operator" jdbcType="BIGINT" property="operator" /> + <result column="operateDt" jdbcType="TIMESTAMP" property="operatedt" /> + <result column="disabled" jdbcType="TINYINT" property="disabled" /> + <result column="deleted" jdbcType="TINYINT" property="deleted" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, countyId, townId, villageId, blockId, divideId, `name`, clientNum, districtNum, + districtTitle, phone, idCard, area, address, remarks, `operator`, operateDt, disabled, + deleted + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from se_client + where id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from se_client + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> + <!--@mbg.generated--> + insert into se_client (id, countyId, townId, + villageId, blockId, divideId, + `name`, clientNum, districtNum, + districtTitle, phone, idCard, + area, address, remarks, + `operator`, operateDt, disabled, + deleted) + values (#{id,jdbcType=BIGINT}, #{countyid,jdbcType=BIGINT}, #{townid,jdbcType=BIGINT}, + #{villageid,jdbcType=BIGINT}, #{blockid,jdbcType=BIGINT}, #{divideid,jdbcType=BIGINT}, + #{name,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{districtnum,jdbcType=BIGINT}, + #{districttitle,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, + #{area,jdbcType=DOUBLE}, #{address,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, + #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}, #{disabled,jdbcType=TINYINT}, + #{deleted,jdbcType=TINYINT}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> + <!--@mbg.generated--> + insert into se_client + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="countyid != null"> + countyId, + </if> + <if test="townid != null"> + townId, + </if> + <if test="villageid != null"> + villageId, + </if> + <if test="blockid != null"> + blockId, + </if> + <if test="divideid != null"> + divideId, + </if> + <if test="name != null"> + `name`, + </if> + <if test="clientnum != null"> + clientNum, + </if> + <if test="districtnum != null"> + districtNum, + </if> + <if test="districttitle != null"> + districtTitle, + </if> + <if test="phone != null"> + phone, + </if> + <if test="idcard != null"> + idCard, + </if> + <if test="area != null"> + area, + </if> + <if test="address != null"> + address, + </if> + <if test="remarks != null"> + remarks, + </if> + <if test="operator != null"> + `operator`, + </if> + <if test="operatedt != null"> + operateDt, + </if> + <if test="disabled != null"> + disabled, + </if> + <if test="deleted != null"> + deleted, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="countyid != null"> + #{countyid,jdbcType=BIGINT}, + </if> + <if test="townid != null"> + #{townid,jdbcType=BIGINT}, + </if> + <if test="villageid != null"> + #{villageid,jdbcType=BIGINT}, + </if> + <if test="blockid != null"> + #{blockid,jdbcType=BIGINT}, + </if> + <if test="divideid != null"> + #{divideid,jdbcType=BIGINT}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="clientnum != null"> + #{clientnum,jdbcType=VARCHAR}, + </if> + <if test="districtnum != null"> + #{districtnum,jdbcType=BIGINT}, + </if> + <if test="districttitle != null"> + #{districttitle,jdbcType=VARCHAR}, + </if> + <if test="phone != null"> + #{phone,jdbcType=VARCHAR}, + </if> + <if test="idcard != null"> + #{idcard,jdbcType=VARCHAR}, + </if> + <if test="area != null"> + #{area,jdbcType=DOUBLE}, + </if> + <if test="address != null"> + #{address,jdbcType=VARCHAR}, + </if> + <if test="remarks != null"> + #{remarks,jdbcType=VARCHAR}, + </if> + <if test="operator != null"> + #{operator,jdbcType=BIGINT}, + </if> + <if test="operatedt != null"> + #{operatedt,jdbcType=TIMESTAMP}, + </if> + <if test="disabled != null"> + #{disabled,jdbcType=TINYINT}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=TINYINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> + <!--@mbg.generated--> + update se_client + <set> + <if test="countyid != null"> + countyId = #{countyid,jdbcType=BIGINT}, + </if> + <if test="townid != null"> + townId = #{townid,jdbcType=BIGINT}, + </if> + <if test="villageid != null"> + villageId = #{villageid,jdbcType=BIGINT}, + </if> + <if test="blockid != null"> + blockId = #{blockid,jdbcType=BIGINT}, + </if> + <if test="divideid != null"> + divideId = #{divideid,jdbcType=BIGINT}, + </if> + <if test="name != null"> + `name` = #{name,jdbcType=VARCHAR}, + </if> + <if test="clientnum != null"> + clientNum = #{clientnum,jdbcType=VARCHAR}, + </if> + <if test="districtnum != null"> + districtNum = #{districtnum,jdbcType=BIGINT}, + </if> + <if test="districttitle != null"> + districtTitle = #{districttitle,jdbcType=VARCHAR}, + </if> + <if test="phone != null"> + phone = #{phone,jdbcType=VARCHAR}, + </if> + <if test="idcard != null"> + idCard = #{idcard,jdbcType=VARCHAR}, + </if> + <if test="area != null"> + area = #{area,jdbcType=DOUBLE}, + </if> + <if test="address != null"> + address = #{address,jdbcType=VARCHAR}, + </if> + <if test="remarks != null"> + remarks = #{remarks,jdbcType=VARCHAR}, + </if> + <if test="operator != null"> + `operator` = #{operator,jdbcType=BIGINT}, + </if> + <if test="operatedt != null"> + operateDt = #{operatedt,jdbcType=TIMESTAMP}, + </if> + <if test="disabled != null"> + disabled = #{disabled,jdbcType=TINYINT}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> + <!--@mbg.generated--> + update se_client + set countyId = #{countyid,jdbcType=BIGINT}, + townId = #{townid,jdbcType=BIGINT}, + villageId = #{villageid,jdbcType=BIGINT}, + blockId = #{blockid,jdbcType=BIGINT}, + divideId = #{divideid,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + clientNum = #{clientnum,jdbcType=VARCHAR}, + districtNum = #{districtnum,jdbcType=BIGINT}, + districtTitle = #{districttitle,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + idCard = #{idcard,jdbcType=VARCHAR}, + area = #{area,jdbcType=DOUBLE}, + address = #{address,jdbcType=VARCHAR}, + remarks = #{remarks,jdbcType=VARCHAR}, + `operator` = #{operator,jdbcType=BIGINT}, + operateDt = #{operatedt,jdbcType=TIMESTAMP}, + disabled = #{disabled,jdbcType=TINYINT}, + deleted = #{deleted,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> + + <!--鏍规嵁6浣嶅尯鍒掍覆妯$硦鏌ヨ鍐滄埛缂栧彿--> + <select id="getClientNumOfMax" resultType="java.lang.String"> + SELECT clientNum + FROM se_client + WHERE clientNum LIKE CONCAT('%',#{district8},'%') + ORDER BY clientNum desc + LIMIT 0,1 + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛璁板綍鏁�--> + <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> + SELECT + COUNT(*) AS recordCount + FROM se_client cli + , (SELECT @i:=0) AS itable + <where> + AND disabled = 0 + AND deleted = 0 + <if test = "name != null and name !=''"> + AND name like CONCAT('%',#{name},'%') + </if> + + <if test = "num != null and num !=''"> + AND clientNum like CONCAT('%',#{num},'%') + </if> + + <if test = "phone != null and phone !=''"> + AND phone like CONCAT('%',#{phone},'%') + </if> + </where> + + </select> + + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏁版嵁--> + <select id="getClients" resultType="com.dy.pipIrrGlobal.voSe.VoClient"> + SELECT + (@i:=@i+1) AS id, + name, + clientNum, + phone, + idCard, + (SELECT COUNT(*) FROM se_client_card WHERE clientNum = cli.clientNum) AS cardCount, + address, + operateDt + FROM se_client cli + , (SELECT @i:=0) AS itable + <where> + AND disabled = 0 + AND deleted = 0 + <if test = "name != null and name !=''"> + AND name like CONCAT('%',#{name},'%') + </if> + + <if test = "clientNum != null and clientNum !=''"> + AND clientNum like CONCAT('%',#{clientNum},'%') + </if> + + <if test = "phone != null and phone !=''"> + AND phone like CONCAT('%',#{phone},'%') + </if> + + <if test = "address != null and address !=''"> + AND address like CONCAT('%',#{address},'%') + </if> + </where> + ORDER BY operateDt DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${pageCurr}, ${pageSize} + </if> + </select> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/java/com/dy/pipIrrDemo/demo/DemoCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/java/com/dy/pipIrrDemo/demo/DemoCtrl.java index 002e818..0d361bc 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/java/com/dy/pipIrrDemo/demo/DemoCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/java/com/dy/pipIrrDemo/demo/DemoCtrl.java @@ -67,7 +67,7 @@ }) @GetMapping("info/{id}/") //http://127.0.0.1:8000/demo/demo/info/123234234/?name=寮犱笁 - @SsoAop(power="123456", ifAllPower = {"123", "456"}) + @SsoAop() public BaseResponse<String> info(@PathVariable String id, @RequestParam String name) throws GlException{ if(name == null || name.trim().equals("")){ return BaseResponseUtils.buildFail(ResultCodeMsg.RsMsg.ERROR_PARAM); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java index 989cf44..f6d2a12 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java @@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -84,7 +85,7 @@ }) @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) @Transactional(rollbackFor = Exception.class) - @SsoAop()//@SsoAop(power = "-1") + @SsoAop() public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid PrDivide po, @Parameter(hidden = true) BindingResult bindingResult){ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); if(bindingResult != null && bindingResult.hasErrors()){ @@ -101,6 +102,11 @@ } + /** + * 瀵煎嚭鍒嗘按鎴垮垪琛� + * @param response + * @param vo + */ @SneakyThrows(IOException.class) @RequestMapping(value = "/exportDivides", method = RequestMethod.GET) public void exportDivides(HttpServletResponse response, QueryVo vo) { @@ -115,6 +121,17 @@ .doWrite(memberList); } + @SneakyThrows + @RequestMapping(value = "/importDivides", method = RequestMethod.POST) + @ResponseBody + public BaseResponse<Boolean> importDivides(@RequestPart("file") MultipartFile file) { + List<VoDivide> memberList = EasyExcel.read(file.getInputStream()) + .head(VoDivide.class) + .sheet() + .doReadSync(); + return BaseResponseUtils.buildSuccess(memberList) ; + } + /** * 璁剧疆excel涓嬭浇鍝嶅簲澶村睘鎬� */ diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java new file mode 100644 index 0000000..bcccdf0 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java @@ -0,0 +1,156 @@ +package com.dy.pipIrrSell.client; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoBa.BaClient; +import com.dy.pipIrrGlobal.pojoSe.SeClient; +import com.dy.pipIrrGlobal.voSe.VoClient; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +/** + * @author ZhuBaoMin + * @date 2023/12/21 19:17 + * @LastEditTime 2023/12/21 19:17 + * @Description + */ + +@Slf4j +@Tag(name = "鍐滄埛绠$悊", description = "鍐滄埛鎿嶄綔") +@RestController +@RequestMapping(path="client") +@RequiredArgsConstructor +public class ClientCtrl { + private final ClientSv clientSv; + + @Operation(summary = "鑾峰緱涓�椤靛啘鎴�", description = "杩斿洖涓�椤靛啘鎴锋暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛啘鎴锋暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BaClient.class))} + ) + }) + @GetMapping(path = "get") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoClient>>> get(QueryVo vo){ + try { + QueryResultVo<List<VoClient>> res = clientSv.getClients(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鏌ヨ鍐滄埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + @Operation(summary = "娣诲姞鍐滄埛璁板綍", description = "娣诲姞鍐滄埛璁板綍") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) + @Transactional(rollbackFor = Exception.class) + @SsoAop() + public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + // 鎺ユ敹鏉戠紪鍙凤紙涓婚敭锛� + Long villageId = po.getVillageid(); + + /** + * 鑾峰彇5绾ц鏀垮尯鍒掍俊鎭� + */ + Map map_districts = Optional.ofNullable(clientSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); + if(map_districts.size() <= 0) { + return BaseResponseUtils.buildFail("鍖哄垝淇℃伅鏈夎"); + } + + String provinceNum = map_districts.get("provinceNum").toString(); + String cityNum = map_districts.get("cityNum").toString(); + Long countryId = Long.parseLong(map_districts.get("countryId").toString()); + String countyNum = map_districts.get("countyNum").toString(); + String countryName = map_districts.get("countryName").toString(); + Long townId = Long.parseLong(map_districts.get("townId").toString()); + String townNum = map_districts.get("townNum").toString(); + String townName = map_districts.get("townName").toString(); + String villageNum = map_districts.get("villageNum").toString(); + String villageName = map_districts.get("villageName").toString(); + + // 鐢熸垚8浣嶈鏀垮尯鍒掔紪鐮侊紝鐢熸垚鍐滄埛缂栧彿鐢� + String district8 = countyNum + townNum + villageNum; + // 鐢熸垚鍐滄埛缂栧彿 + String clientNum = generateClientNum(district8); + // 鐢熸垚12浣�5绾ц鏀垮尯鍒掔紪鐮佷覆鍙婂悕绉颁覆 + Long districtNum = Long.parseLong(provinceNum + cityNum + district8); + String districtTitle = countryName + townName + villageName; + + SeClient seClient = DtoClientToSeClient.INSTANCT.po2vo(po); + seClient.setCountyid(countryId); + seClient.setTownid(townId); + seClient.setClientnum(clientNum); + seClient.setDistrictnum(districtNum); + seClient.setDistricttitle(districtTitle); + Date operateTime = new Date(); + seClient.setOperatedt(operateTime); + + seClient.setDisabled((byte)0); + seClient.setDeleted((byte)0); + Integer rec = Optional.ofNullable(clientSv.addClient(seClient)).orElse(0); + if(rec == 0) { + return BaseResponseUtils.buildFail("娣诲姞鍐滄埛澶辫触"); + } + return BaseResponseUtils.buildSuccess(true) ; + } + + /** + * 鐢熸垚10涓哄啘鎴风紪鍙� + * 1. 鍒板啘鎴疯〃涓煡璇�6浣嶅尯鍒掍覆寮�澶寸殑鏈�澶х殑鍐滄埛缂栧彿 + * 2. 鏄惁鍙栧埌璁板綍 + * 2.1 鍙栧埌 + * 2.1.1 鍙栧嚭鍚�4浣嶉『搴忓彿骞惰浆鎴愭暣褰� + * 2.1.2. 鏁村舰鏍煎紡鐨勯『搴忓彿鍔�1骞跺垽鏂槸鍚﹀ぇ浜�9999 + * 2.1.2.1 濡傛灉澶т簬鍒欐彁绀虹敤鎴风紪鍙峰凡婊� + * 2.1.2.2 濡傛灉涓嶅ぇ 6浣嶅尯鍒掑姞涓婃牸寮忓寲鍚庣殑椤哄簭鍙� + * 2.2 鏈彇鍒� 6浣嶅尯鍒掑姞涓�0001 + * 3. 杩斿洖鍐滄埛缂栧彿 + */ + private String generateClientNum(String district8) { + String clientNum = Optional.ofNullable(clientSv.getClientNumOfMax(district8)).orElse(""); + if(clientNum != null && clientNum.trim().length() > 0) { + Integer number = Integer.parseInt(clientNum.substring(8)); + number = number + 1; + if(number > 9999) { + return "鍐滄埛缂栧彿瓒呴檺"; + } + clientNum = clientNum.substring(0, 8) + String.format("%04d", number); + } else { + clientNum = district8 + "0001"; + } + return clientNum; + } + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java new file mode 100644 index 0000000..eb16e9d --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java @@ -0,0 +1,76 @@ +package com.dy.pipIrrSell.client; + +import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; +import com.dy.pipIrrGlobal.daoSe.SeClientMapper; +import com.dy.pipIrrGlobal.pojoSe.SeClient; +import com.dy.pipIrrGlobal.voSe.VoClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.common.utils.PojoUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @author ZhuBaoMin + * @date 2023/12/21 19:17 + * @LastEditTime 2023/12/21 19:17 + * @Description + */ + +@Slf4j +@Service +public class ClientSv { + @Autowired + private SeClientMapper seClientMapper; + + @Autowired + private BaDistrictMapper baDistrictMapper; + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏁版嵁 + * @param vo + * @return + */ + public QueryResultVo<List<VoClient>> getClients(QueryVo vo){ + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ; + Long itemTotal = seClientMapper.getRecordCount(params); + + QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ; + rsVo.pageSize = vo.pageSize ; + rsVo.pageCurr = vo.pageCurr ; + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = seClientMapper.getClients(params); + + return rsVo ; + } + + /** + * 澧炲紑鍐滄埛 + * @param po + * @return + */ + public Integer addClient(SeClient po) { + return seClientMapper.insert(po); + } + + /** + * 鏍规嵁6浣嶅尯鍒掍覆妯$硦鏌ヨ鍐滄埛缂栧彿 + * @param district6 + * @return + */ + public String getClientNumOfMax(String district6) { + return seClientMapper.getClientNumOfMax(district6); + } + + /** + * 鏍规嵁鏉戠紪鍙疯幏鍙�5绾у尯鍒掍俊鎭� + * @param villageId 鏉戠紪鍙凤紙涓婚敭锛� + * @return 5绾ц鏀垮尯鍒掍俊鎭� + */ + public Map getDistrictsByVillageId(Long villageId) { + return baDistrictMapper.getDistrictsByVillageId(villageId); + } +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClient.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClient.java new file mode 100644 index 0000000..7d417ca --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClient.java @@ -0,0 +1,96 @@ +package com.dy.pipIrrSell.client; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import lombok.*; +import org.hibernate.validator.constraints.Length; + +/** + * @author ZhuBaoMin + * @date 2023/12/22 8:41 + * @LastEditTime 2023/12/22 8:41 + * @Description + */ + +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "鍒涘缓鍐滄埛浼犲叆瀵硅薄") +public class DtoClient { + public static final long serialVersionUID = 1L; + + /** + * 鏉慖D + */ + @Schema(description = "鎵�鍦ㄦ潙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄦ潙涓嶈兘涓虹┖") + private Long villageid; + + /** + * 鐗囧尯ID + */ + @Schema(description = "鎵�鍦ㄧ墖鍖篒D", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄧ墖鍖轰笉鑳戒负绌�") + private Long blockid; + + /** + * 鍒嗘按鎴縄D + */ + @Schema(description = "鎵�鍦ㄥ垎姘存埧ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ垎姘存埧涓嶈兘涓虹┖") + private Long divideid; + + /** + * 鍐滄埛濮撳悕 + */ + @Schema(description = "鍐滄埛濮撳悕", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "鍐滄埛濮撳悕涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍐滄埛濮撳悕涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + private String name; + + /** + * 鎵嬫満鍙� + */ + @Schema(description = "鍐滄埛鎵嬫満鍙�", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鍐滄埛鎵嬫満鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍐滄埛鎵嬫満鍙峰繀椤粄max}浣嶆暟鎹�", min = 11, max = 11) + private String phone; + + /** + * 韬唤璇佸彿 + */ + @Schema(description = "鍐滄埛韬唤璇佸彿", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "鍐滄埛韬唤璇佸彿涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍐滄埛韬唤璇佸彿蹇呴』{max}浣嶆暟鎹�", min = 18, max = 18) + private String idcard; + + /** + * 绉嶆闈㈢Н + */ + @Schema(description = "鍐滄埛绉嶆闈㈢Н", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Double area; + + /** + * 琛楅亾鍙婇棬鐗屽彿 + */ + @Schema(description = "琛楅亾+闂ㄧ墝鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "鍦板潃涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 50) + private String address; + + /** + * 澶囨敞淇℃伅 + */ + @Schema(description = "澶囨敞", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "澶囨敞涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 200) + private String remarks; + + /** + * 鎿嶄綔浜虹紪鍙� + */ + @Schema(description = "鎿嶄綔浜虹紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎿嶄綔浜虹紪鍙蜂笉鑳戒负绌�") + private Long operator; + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java new file mode 100644 index 0000000..2130c60 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java @@ -0,0 +1,30 @@ +package com.dy.pipIrrSell.client; + +import com.dy.pipIrrGlobal.pojoSe.SeClient; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +/** + * @author ZhuBaoMin + * @date 2023/12/22 9:23 + * @LastEditTime 2023/12/22 9:23 + * @Description + */ + +@Mapper +public interface DtoClientToSeClient { + DtoClientToSeClient INSTANCT = Mappers.getMapper(DtoClientToSeClient.class); + + @Mapping(target = "villageid", source = "villageid") + @Mapping(target = "blockid", source = "blockid") + @Mapping(target = "divideid", source = "divideid") + @Mapping(target = "name", source = "name") + @Mapping(target = "phone", source = "phone") + @Mapping(target = "idcard", source = "idcard") + @Mapping(target = "area", source = "area") + @Mapping(target = "address", source = "address") + @Mapping(target = "remarks", source = "remarks") + @Mapping(target = "operator", source = "operator") + SeClient po2vo(DtoClient po); +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryVo.java new file mode 100644 index 0000000..28d645c --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryVo.java @@ -0,0 +1,46 @@ +package com.dy.pipIrrSell.client; + +import com.dy.common.webUtil.QueryConditionVo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * @author ZhuBaoMin + * @date 2023/12/21 19:18 + * @LastEditTime 2023/12/21 19:18 + * @Description + */ + +@Data +@EqualsAndHashCode(callSuper = false) +@ToString(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@Builder +@Schema(name = "鍐滄埛鏌ヨ鏉′欢") +public class QueryVo extends QueryConditionVo { + + //@Schema(description = "鍘縄D") + //public Long countyId ; + // + //@Schema(description = "闀嘔D") + //public Long townId ; + // + //@Schema(description = "鏉慖D") + //public Long villageId ; + // + //@Schema(description = "鐗囧尯ID") + //public Long blockId ; + + @Schema(description = "鍐滄埛濮撳悕") + public String name; + + @Schema(description = "鍐滄埛缂栧彿") + public String clientNum; + + @Schema(description = "鍐滄埛鐢佃瘽") + public String phone; + + @Schema(description = "鍦板潃") + public String address; +} \ No newline at end of file -- Gitblit v1.8.0