Browse Source

顾客インターフェース修正

zdsong 2 weeks ago
parent
commit
d29beac94b

+ 5 - 0
farm-crm-biz/src/main/java/jp/yamoto/farm/crm/biz/master/domain/vo/MastFarmerVo.java

@@ -117,6 +117,11 @@ public class MastFarmerVo extends BaseEntity {
     private Integer discontinuedFlg;
 
     /**
+     * 廃止フラグ(利用状態)ラベル
+     */
+    private String discontinuedFlgLabel;
+
+    /**
      * 廃止日
      */
     private String discontinuedDate;

+ 15 - 9
farm-crm-biz/src/main/java/jp/yamoto/farm/crm/biz/master/service/impl/MastFarmerServiceImpl.java

@@ -49,7 +49,7 @@ public class MastFarmerServiceImpl implements IMastFarmerService {
         }
 
         // 検索結果をリセット
-        this.restSearchData4View(mastFarmerVo);
+        this.restSearchData4View(mastFarmerVo,true);
         return mastFarmerVo;
     }
 
@@ -67,7 +67,7 @@ public class MastFarmerServiceImpl implements IMastFarmerService {
         // エリによってリストが返されました。
         List<MastFarmerVo> farmerLst =  mastFarmerMapper.selectList(mastFarmer);
         for (MastFarmerVo p : farmerLst) {
-            this.restSearchData4View(p);
+            this.restSearchData4View(p,false);
         }
         return farmerLst;
     }
@@ -154,6 +154,7 @@ public class MastFarmerServiceImpl implements IMastFarmerService {
      *
      * @param mastFarmer 農家マスタ情報
      */
+    @SneakyThrows
     private void buildFarmerInfo4Save(MastFarmer mastFarmer) {
         // ログインユーザー情報を取得します
         LoginUser loginUser = SecurityUtils.getLoginUser();
@@ -167,7 +168,6 @@ public class MastFarmerServiceImpl implements IMastFarmerService {
             mastFarmer.setIssuedDate(DateUtils.getDate());
 
             // パスワード
-            //
             String defaultPwd = generateFarmerInitPwd();
             mastFarmer.setUserPassword(defaultPwd);
 //            mastFarmer.setUserPassword(SecurityUtils.encryptPassword(mastFarmer.getUserPassword()));
@@ -181,11 +181,11 @@ public class MastFarmerServiceImpl implements IMastFarmerService {
 
         // メールアドレス
         if (ValueUtils.isNotEmpty(mastFarmer.getMailAddress())) {
-//            mastFarmer.setMailAddress(DecryptUtils.encryptAES(mastFarmer.getMailAddress()));
+            mastFarmer.setMailAddress(DecryptUtils.encryptAES(mastFarmer.getMailAddress()));
         }
         // 電話番号
         if (ValueUtils.isNotEmpty(mastFarmer.getMailAddress())) {
-//            mastFarmer.setPhoneNumber(DecryptUtils.encryptAES(mastFarmer.getPhoneNumber()));
+            mastFarmer.setPhoneNumber(DecryptUtils.encryptAES(mastFarmer.getPhoneNumber()));
         }
 
     }
@@ -194,14 +194,20 @@ public class MastFarmerServiceImpl implements IMastFarmerService {
      * 検索結果をリセット
      *
      * @param mastFarmerVo 農家マスタ詳細情報Vo
+     * @param isDecryptMail 農家マスタ詳細情報Vo
      */
     @SneakyThrows
-    private void restSearchData4View(MastFarmerVo mastFarmerVo) {
-        // デコードページにはアイテムが表示されます
+    private void restSearchData4View(MastFarmerVo mastFarmerVo,boolean isDecryptMail) {
 
+        // デコードページにはアイテムが表示されます
         // 電話番号
-//        String PhoneNumber = DecryptUtils.decryptAES(mastFarmerVo.getPhoneNumber());
-//        mastFarmerVo.setPhoneNumber(PhoneNumber);
+        String PhoneNumber = DecryptUtils.decryptAES(mastFarmerVo.getPhoneNumber());
+        mastFarmerVo.setPhoneNumber(PhoneNumber);
+        // プレーンテキストメール
+        if (isDecryptMail) {
+            String mailAddress = DecryptUtils.decryptAES(mastFarmerVo.getMailAddress());
+            mastFarmerVo.setMailAddress(mailAddress);
+        }
     }
 
     /**

+ 58 - 54
farm-crm-biz/src/main/resources/mapper/crm/MastFarmerMapper.xml

@@ -26,6 +26,7 @@
         <result property="rakuuruCartPwd" column="rakuuru_cart_pwd"/>
         <result property="userPassword" column="user_password"/>
         <result property="discontinuedFlg" column="discontinued_flg"/>
+        <result property="discontinuedFlgLabel" column="discontinued_flg_label"/>
         <result property="discontinuedDate" column="discontinued_date"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
@@ -39,115 +40,118 @@
 
     <sql id="selectMastFarmerVo">
         select
-        id,
-        farmer_id,
-        farmer_name,
-        farmer_name_kn,
-        phone_number,
-        mail_address,
-        postal_code,
-        prefecture,
-        city,
-        town_street_area,
-        building_etc,
-        address,
-        representative_name,
-        representative_name_kn,
-        issued_by,
-        issued_date,
-        login_cnt,
-        rakuuru_cart_id,
-        rakuuru_cart_pwd,
-        user_password,
-        discontinued_flg,
-        discontinued_date,
-        create_time,
-        create_by,
-        create_pg_id,
-        update_time,
-        update_by,
-        update_pg_id,
-        version
-        from mast_farmer
+            mf.id,
+            mf.farmer_id,
+            mf.farmer_name,
+            mf.farmer_name_kn,
+            mf.phone_number,
+            mf.mail_address,
+            mf.postal_code,
+            mf. prefecture,
+            mf. city,
+            mf.town_street_area,
+            mf.building_etc,
+            mf.address,
+            mf.representative_name,
+            mf.representative_name_kn,
+            mf.issued_by,
+            mf.issued_date,
+            mf.login_cnt,
+            mf.rakuuru_cart_id,
+            mf.rakuuru_cart_pwd,
+            mf.user_password,
+            mf.discontinued_flg,
+            mf.discontinued_date,
+            mf.create_time,
+            mf.create_by,
+            mf.create_pg_id,
+            mf.update_time,
+            mf.update_by,
+            mf.update_pg_id,
+            mf. version,
+            sdd.dict_label as discontinued_flg_label
+        from mast_farmer mf inner join  sys_dict_data sdd
+        on CAST(mf.discontinued_flg  AS VARCHAR) = sdd.dict_value and sdd.dict_type = 'usage_status_type'
     </sql>
 
     <select id="selectList" parameterType="MastFarmer" resultMap="MastFarmerResult">
         <include refid="selectMastFarmerVo"/>
         <where>
+            sdd.dict_type = 'usage_status_type'
             <if test="id != null  and id != ''">
-                and id = #{id}
+                and mf.id = #{id}
             </if>
             <if test="farmerId != null  and farmerId != ''">
-                and farmer_id = #{farmerId}
+                and mf.farmer_id = #{farmerId}
             </if>
             <if test="farmerName != null  and farmerName != ''">
-                and farmer_name like '%' || #{farmerName} || '%'
+                and mf.farmer_name like '%' || #{farmerName} || '%'
             </if>
             <if test="farmerNameKn != null  and farmerNameKn != ''">
-                and farmer_name_kn = #{farmerNameKn}
+                and mf.farmer_name_kn = #{farmerNameKn}
             </if>
             <if test="phoneNumber != null  and phoneNumber != ''">
-                and phone_number = #{phoneNumber}
+                and mf.phone_number = #{phoneNumber}
             </if>
             <if test="mailAddress != null  and mailAddress != ''">
-                and mail_address = #{mailAddress}
+                and mf.mail_address = #{mailAddress}
             </if>
             <if test="prefecture != null  and prefecture != ''">
-                and prefecture = #{prefecture}
+                and mf.prefecture = #{prefecture}
             </if>
             <if test="city != null  and city != ''">
-                and city = #{city}
+                and mf.city = #{city}
             </if>
             <if test="townStreetArea != null  and townStreetArea != ''">
-                and town_street_area = #{townStreetArea}
+                and mf.town_street_area = #{townStreetArea}
             </if>
             <if test="buildingEtc != null  and buildingEtc != ''">
-                and building_etc = #{buildingEtc}
+                and mf.building_etc = #{buildingEtc}
             </if>
             <if test="address != null  and address != ''">
-                and address = #{address}
+                and mf.address = #{address}
             </if>
             <if test="representativeName != null  and representativeName != ''">
-                and representative_name = #{representativeName}
+                and mf.representative_name like '%' || #{representativeName} || '%'
             </if>
             <if test="representativeNameKn != null  and representativeNameKn != ''">
-                and representative_name_kn = #{representativeNameKn}
+                and mf.representative_name_kn = #{representativeNameKn}
             </if>
             <if test="issuedBy != null  and issuedBy != ''">
-                and issued_by = #{issuedBy}
+                and mf.issued_by = #{issuedBy}
             </if>
             <if test="issuedDate != null  and issuedDate != ''">
-                and issued_date = #{issuedDate}
+                and mf.issued_date = #{issuedDate}
             </if>
             <if test="loginCnt != null ">
-                and login_cnt = #{loginCnt}
+                and mf.login_cnt = #{loginCnt}
             </if>
             <if test="rakuuruCartId != null  and rakuuruCartId != ''">
-                and rakuuru_cart_id = #{rakuuruCartId}
+                and mf.rakuuru_cart_id = #{rakuuruCartId}
             </if>
             <if test="rakuuruCartPwd != null  and rakuuruCartPwd != ''">
-                and rakuuru_cart_pwd = #{rakuuruCartPwd}
+                and mf.rakuuru_cart_pwd = #{rakuuruCartPwd}
             </if>
             <if test="userPassword != null  and userPassword != ''">
-                and user_password = #{userPassword}
+                and mf.user_password = #{userPassword}
             </if>
             <if test="discontinuedFlg != null ">
-                and discontinued_flg = #{discontinuedFlg}
+                and mf.discontinued_flg = #{discontinuedFlg}
             </if>
             <if test="discontinuedDate != null  and discontinuedDate != ''">
-                and discontinued_date = #{discontinuedDate}
+                and mf.discontinued_date = #{discontinuedDate}
             </if>
             <if test="postalCode != null  and postalCode != ''">
-                and postal_code = #{postalCode}
+                and mf.postal_code = #{postalCode}
             </if>
 
         </where>
-        order by farmer_id asc
+        order by mf.farmer_id asc
     </select>
 
     <select id="selectById" parameterType="String"  resultMap="MastFarmerResult">
         <include refid="selectMastFarmerVo"/>
-        where id = #{id}
+        where    mf.id = #{id}
 
     </select>