供应商画面 后台生成拼音码和五笔 uo by dh

This commit is contained in:
duhe
2025-03-13 18:06:54 +08:00
parent 79742f4deb
commit a8a73bfdc9
3 changed files with 19 additions and 50 deletions

View File

@@ -12,6 +12,7 @@ import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.core.common.utils.ChineseConvertUtils;
import com.openhis.administration.domain.Supplier; import com.openhis.administration.domain.Supplier;
import com.openhis.administration.mapper.SupplierMapper; import com.openhis.administration.mapper.SupplierMapper;
import com.openhis.administration.service.ISupplierService; import com.openhis.administration.service.ISupplierService;
@@ -107,6 +108,10 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS
Supplier supplierInfo = new Supplier(); Supplier supplierInfo = new Supplier();
BeanUtils.copyProperties(supplierUpDto, supplierInfo); BeanUtils.copyProperties(supplierUpDto, supplierInfo);
// 设置拼音首拼
supplierInfo.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(supplierInfo.getName()));
// 设置五笔首拼
supplierInfo.setWbStr(ChineseConvertUtils.toWBFirstLetter(supplierInfo.getName()));
return supplierService.addSupplier(supplierInfo) return supplierService.addSupplier(supplierInfo)
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"厂商/供应商信息"})) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"厂商/供应商信息"}))
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
@@ -122,7 +127,10 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS
Supplier supplier = new Supplier(); Supplier supplier = new Supplier();
BeanUtils.copyProperties(supplierUpDto, supplier); BeanUtils.copyProperties(supplierUpDto, supplier);
// 设置拼音首拼
supplier.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(supplier.getName()));
// 设置五笔首拼
supplier.setWbStr(ChineseConvertUtils.toWBFirstLetter(supplier.getName()));
// 更新供应商信息信息 // 更新供应商信息信息
return supplierService.updateById(supplier) return supplierService.updateById(supplier)
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"厂商/供应商信息"})) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"厂商/供应商信息"}))

View File

@@ -3,30 +3,10 @@
*/ */
package com.openhis.web.datadictionary.controller; package com.openhis.web.datadictionary.controller;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R; import com.core.common.core.domain.R;
import com.core.common.utils.MessageUtils;
import com.core.common.utils.bean.BeanUtils;
import com.openhis.administration.domain.Supplier;
import com.openhis.administration.mapper.SupplierMapper;
import com.openhis.administration.service.ISupplierService;
import com.openhis.common.constant.PromptMsgConstant;
import com.openhis.common.enums.AccountStatus;
import com.openhis.common.enums.SupplierType;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisPageUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.datadictionary.appservice.ISupplierManagementAppService; import com.openhis.web.datadictionary.appservice.ISupplierManagementAppService;
import com.openhis.web.datadictionary.dto.*; import com.openhis.web.datadictionary.dto.*;
import com.openhis.web.inventorymanage.appservice.IPurchaseInventoryAppService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -58,13 +38,7 @@ public class SupplierManagementController {
*/ */
@GetMapping("/information-init") @GetMapping("/information-init")
public R<?> getSupplierInit() { public R<?> getSupplierInit() {
// SupplierInitDto supplierInitDto = new SupplierInitDto(); return supplierManagementAppService.getSupplierInit();
// // 获取厂商/产地种类
// List<SupplierInitDto.supplierTypeOption> supplierTypeOption = Stream.of(SupplierType.values())
// .map(status -> new SupplierInitDto.supplierTypeOption(status.getValue(), status.getInfo()))
// .collect(Collectors.toList());
// supplierInitDto.setSupplierTypeOptions(supplierTypeOption);
return R.ok(supplierManagementAppService.getSupplierInit());
} }
/** /**
@@ -82,21 +56,8 @@ public class SupplierManagementController {
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
// // 构建查询条件 // 返回分页
// QueryWrapper<Supplier> queryWrapper = HisQueryUtils.buildQueryWrapper(supplierSearchParam, return supplierManagementAppService.getSupplierList(supplierSearchParam, searchKey, pageNo, pageSize, request);
// searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
// // 设置排序
// queryWrapper.orderByAsc("bus_no");
// // 分页查询
// Page<SupplierDto> supplierPage =
// HisPageUtils.selectPage(supplierMapper, queryWrapper, pageNo, pageSize, SupplierDto.class);
// // 枚举类回显赋值
// supplierPage.getRecords().forEach(e ->
// e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()))
// );
// 返回【病种目录列表DTO】分页
return R.ok(
supplierManagementAppService.getSupplierList(supplierSearchParam, searchKey, pageNo, pageSize, request));
} }
/** /**
@@ -106,7 +67,7 @@ public class SupplierManagementController {
*/ */
@PostMapping("/add-supplier") @PostMapping("/add-supplier")
public R<?> addSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) { public R<?> addSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) {
return R.ok(supplierManagementAppService.addSupplyRequest(supplierUpDto)); return supplierManagementAppService.addSupplyRequest(supplierUpDto);
} }
/** /**
@@ -118,7 +79,7 @@ public class SupplierManagementController {
public R<?> editSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) { public R<?> editSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) {
// 更新供应商信息信息 // 更新供应商信息信息
return R.ok(supplierManagementAppService.addSupplyRequest(supplierUpDto)); return supplierManagementAppService.addSupplyRequest(supplierUpDto);
} }
/** /**
@@ -129,7 +90,7 @@ public class SupplierManagementController {
*/ */
@GetMapping(value = "/get-supplier-detail/{id}") @GetMapping(value = "/get-supplier-detail/{id}")
public R<?> getSupplierDetail(@PathVariable("id") Long id) { public R<?> getSupplierDetail(@PathVariable("id") Long id) {
return R.ok(supplierManagementAppService.getSupplierDetail(id)); return supplierManagementAppService.getSupplierDetail(id);
} }
/** /**
@@ -141,7 +102,7 @@ public class SupplierManagementController {
@PutMapping("/information-stop") @PutMapping("/information-stop")
public R<?> editSupplierStop(@RequestBody List<Long> ids) { public R<?> editSupplierStop(@RequestBody List<Long> ids) {
// 更新厂商/产地信息 // 更新厂商/产地信息
return R.ok(supplierManagementAppService.editSupplierStop(ids)); return supplierManagementAppService.editSupplierStop(ids);
} }
/** /**
@@ -153,6 +114,6 @@ public class SupplierManagementController {
@PutMapping("/information-start") @PutMapping("/information-start")
public R<?> editSupplierStart(@RequestBody List<Long> ids) { public R<?> editSupplierStart(@RequestBody List<Long> ids) {
// 更新厂商/产地信息 // 更新厂商/产地信息
return R.ok(supplierManagementAppService.editSupplierStart(ids)); return supplierManagementAppService.editSupplierStart(ids);
} }
} }

View File

@@ -47,11 +47,11 @@ public class SupplierUpDto {
private String address; private String address;
/** 拼音码 */ /** 拼音码 */
@NotBlank(message = "拼音码不能为空") // @NotBlank(message = "拼音码不能为空")
private String pyStr; private String pyStr;
/** 五笔码 */ /** 五笔码 */
@NotBlank(message = "五笔码不能为空") // @NotBlank(message = "五笔码不能为空")
private String wbStr; private String wbStr;
/** 联系人电话 */ /** 联系人电话 */