From 35d6ed3c85ab2fa5c36c8817989bf56801fb2de7 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期四, 20 六月 2024 11:52:15 +0800 Subject: [PATCH] zjh 2024/06/20-1 --- ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml | 8 +++ ltkj-admin/src/test/java/zjhTest.java | 37 +++++++++++++++++- ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjPackage.java | 6 +++ ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java | 4 ++ ltkj-hosp/src/main/resources/mapper/TjPackageMapper.xml | 7 +++ 5 files changed, 57 insertions(+), 5 deletions(-) diff --git a/ltkj-admin/src/test/java/zjhTest.java b/ltkj-admin/src/test/java/zjhTest.java index 7662430..db68e95 100644 --- a/ltkj-admin/src/test/java/zjhTest.java +++ b/ltkj-admin/src/test/java/zjhTest.java @@ -3,12 +3,15 @@ import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; +import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.extra.qrcode.QrCodeUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.LtkjApplication; import com.ltkj.common.core.redis.RedisCache; import com.ltkj.common.utils.SecurityUtils; import com.ltkj.hosp.domain.DictHosp; +import com.ltkj.hosp.domain.TjCustomer; +import com.ltkj.hosp.domain.TjPackage; import com.ltkj.hosp.domain.TjProject; import com.ltkj.hosp.service.*; import lombok.extern.slf4j.Slf4j; @@ -46,6 +49,10 @@ // private ITjGroupingProService groupingProService; @Autowired private ITjProjectService projectService; + @Resource + private ITjCustomerService tjCustomerService; + @Resource + private ITjPackageService tjPackageService; // // @Resource // private ITjOrderService tjOrderService; @@ -67,19 +74,43 @@ private String secret; @Test public void test() { +/* // 鐢熸垚鎸囧畾url瀵瑰簲鐨勪簩缁寸爜鍒版枃浠讹紝瀹藉拰楂橀兘鏄�300鍍忕礌 QrCodeUtil.generate("https://ltpeis.xaltjdkj.cn:5516/1000110001240327094056%E7%8E%89%E5%BF%A0_%E4%BD%93%E6%A3%80%E6%8A%A5%E5%91%8A.pdf", 300, 300, FileUtil.file("D:\\Users\\w\\Desktop\\qrcode.jpg")); +*/ + + List<TjProject> list = projectService.list(); + for (TjProject tjProject : list) { + tjProject.setProEngName(PinyinUtil.getFirstLetter(tjProject.getProName(),"")); + projectService.updateById(tjProject); + } + + List<TjCustomer> list1 = tjCustomerService.list(); + for (TjCustomer customer : list1) { + customer.setPym(PinyinUtil.getFirstLetter(customer.getCusName(),"")); + tjCustomerService.updateById(customer); + } + + List<TjPackage> list2 = tjPackageService.list(); + for (TjPackage tjPackage : list2) { + tjPackage.setPym(PinyinUtil.getFirstLetter(tjPackage.getPacName(),"")); + tjPackageService.updateById(tjPackage); + } + + +// PinyinUtil.getFirstLetter(); } // public static void main(String[] args) { // -// String a ="1,2,3"; -// boolean contains = a.contains("1"); -// System.out.println(contains); +// +// String a ="璧靛璞�"; +// String firstLetter = PinyinUtil.getFirstLetter(a, ""); +// System.out.println(firstLetter); // // } // diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java index d05b873..30cc387 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java @@ -49,6 +49,10 @@ private String cusName; + @ApiModelProperty(value = "鎷奸煶鐮�") + private String pym; + + @ApiModelProperty("灏辫瘖缂栧彿") private String cardId; diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjPackage.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjPackage.java index b8b48e7..1bc45b1 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjPackage.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjPackage.java @@ -52,6 +52,12 @@ @ApiModelProperty(value = "濂楅鍚嶇О") private String pacName; + + + @ApiModelProperty(value = "鎷奸煶鐮�") + private String pym; + + /** * 鍥剧墖锛圔ase64缂栫爜锛� */ diff --git a/ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml b/ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml index 2e78844..4f039c6 100644 --- a/ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml +++ b/ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml @@ -32,6 +32,7 @@ <result property="ageUnit" column="age_unit"/> <result property="career" column="career"/> <result property="dwPhone" column="dw_phone"/> + <result property="pym" column="pym"/> </resultMap> <sql id="selectTjCustomerVo"> @@ -61,7 +62,8 @@ id_type, age_unit, career, - dw_phone + dw_phone, + pym from tj_customer </sql> @@ -83,6 +85,7 @@ <if test="cusIntroduce != null and cusIntroduce != ''">and cus_introduce = #{cusIntroduce}</if> <if test="cusNumber != null ">and cus_number = #{cusNumber}</if> <if test="cusIsvip != null and cusIsvip != ''">and cus_isvip = #{cusIsvip}</if> + <if test="pym != null and pym != ''">and pym = #{pym}</if> </where> </select> @@ -120,6 +123,7 @@ <if test="ageUnit != null">age_unit,</if> <if test="career != null">career,</if> <if test="dwPhone != null">dw_phone,</if> + <if test="pym != null">pym,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="cusName != null and cusName != ''">#{cusName},</if> @@ -148,6 +152,7 @@ <if test="ageUnit != null">#{ageUnit},</if> <if test="career != null">#{career},</if> <if test="dw_phone != null">#{dwPhone},</if> + <if test="pym != null">#{pym},</if> </trim> </insert> @@ -180,6 +185,7 @@ <if test="ageUnit != null">age_unit = #{ageUnit},</if> <if test="career != null">career = #{career},</if> <if test="dwPhone != null">dw_phone = #{dwPhone},</if> + <if test="pym != null">pym = #{pym},</if> </trim> where cus_id = #{cusId} </update> diff --git a/ltkj-hosp/src/main/resources/mapper/TjPackageMapper.xml b/ltkj-hosp/src/main/resources/mapper/TjPackageMapper.xml index aa7b35a..f5e7ec7 100644 --- a/ltkj-hosp/src/main/resources/mapper/TjPackageMapper.xml +++ b/ltkj-hosp/src/main/resources/mapper/TjPackageMapper.xml @@ -26,6 +26,7 @@ <result property="saleNum" column="sale_num"/> <result property="categoryId" column="category_id"/> <result property="hisPacBm" column="his_pac_bm"/> + <result property="pym" column="pym"/> </resultMap> <sql id="selectTjPackageVo"> @@ -49,7 +50,8 @@ counter_price, sale_num, category_id, - his_pac_bm + his_pac_bm, + pym from tj_package </sql> @@ -88,6 +90,7 @@ <if test="retailPrice != null">retail_price,</if> <if test="counterPrice != null">counter_price,</if> <if test="saleNum != null">sale_num,</if> + <if test="pym != null">pym,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> @@ -108,6 +111,7 @@ <if test="retailPrice != null">#{retail_price},</if> <if test="counterPrice != null">#{counter_price},</if> <if test="saleNum != null">#{sale_num},</if> + <if test="pym != null">#{pym},</if> </trim> </insert> @@ -131,6 +135,7 @@ <if test="retailPrice != null">retail_price=#{retailPrice},</if> <if test="counterPrice != null">counter_price=#{counterPrice},</if> <if test="saleNum != null">sale_num=#{saleNum},</if> + <if test="pym != null">pym=#{pym},</if> </trim> where pac_id = #{pacId} </update> -- Gitblit v1.8.0