供应商画面调整 up by dh
This commit is contained in:
@@ -35,11 +35,12 @@ public interface ISupplierManagementAppService {
|
||||
*
|
||||
* @param supplierSearchParam 查询条件
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param typeEnum 查询条件
|
||||
* @param pageNo 查询条件
|
||||
* @param pageSize 查询条件
|
||||
* @return 厂商/产地查询结果
|
||||
*/
|
||||
R<?> getSupplierList(SupplierSearchParam supplierSearchParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
R<?> getSupplierList(SupplierSearchParam supplierSearchParam, String searchKey,Integer typeEnum, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,12 +12,16 @@ import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.alibaba.druid.sql.visitor.functions.Isnull;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.mapper.SupplierMapper;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.SupplierType;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.datadictionary.appservice.ISupplierManagementAppService;
|
||||
import com.openhis.web.datadictionary.dto.SupplierDto;
|
||||
@@ -73,27 +77,33 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS
|
||||
*
|
||||
* @param supplierSearchParam 查询条件
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param typeEnum 查询条件
|
||||
* @param pageNo 查询条件
|
||||
* @param pageSize 查询条件
|
||||
* @return 厂商/产地查询结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> getSupplierList(SupplierSearchParam supplierSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
public R<?> getSupplierList(SupplierSearchParam supplierSearchParam, String searchKey,
|
||||
Integer typeEnum, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<Supplier> queryWrapper = HisQueryUtils.buildQueryWrapper(supplierSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
if(StringUtils.isNotNull(typeEnum)){
|
||||
queryWrapper.eq("type_enum",typeEnum);
|
||||
}
|
||||
|
||||
// 设置排序
|
||||
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())));
|
||||
supplierPage.getRecords().forEach(e -> {
|
||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
// 厂商类型
|
||||
e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplierType.class, e.getTypeEnum()));
|
||||
});
|
||||
// 返回【病种目录列表DTO】分页
|
||||
return R.ok(supplierPage);
|
||||
}
|
||||
@@ -104,7 +114,7 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS
|
||||
* @param supplierUpDto 供应商信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> addSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) {
|
||||
public R<?> addSupplyRequest(SupplierUpDto supplierUpDto) {
|
||||
|
||||
Supplier supplierInfo = new Supplier();
|
||||
BeanUtils.copyProperties(supplierUpDto, supplierInfo);
|
||||
@@ -123,7 +133,7 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS
|
||||
* @param supplierUpDto 供应商信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> editSupplyRequest(@Validated @RequestBody SupplierUpDto supplierUpDto) {
|
||||
public R<?> editSupplyRequest(SupplierUpDto supplierUpDto) {
|
||||
|
||||
Supplier supplier = new Supplier();
|
||||
BeanUtils.copyProperties(supplierUpDto, supplier);
|
||||
|
||||
@@ -46,6 +46,7 @@ public class SupplierManagementController {
|
||||
*
|
||||
* @param supplierSearchParam 查询条件
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param typeEnum 查询条件
|
||||
* @param pageNo 查询条件
|
||||
* @param pageSize 查询条件
|
||||
* @return 厂商/产地查询结果
|
||||
@@ -53,11 +54,12 @@ public class SupplierManagementController {
|
||||
@GetMapping(value = "/get-supplier-list")
|
||||
public R<?> getSupplierList(SupplierSearchParam supplierSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "typeEnum", defaultValue = "") Integer typeEnum,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 返回分页
|
||||
return supplierManagementAppService.getSupplierList(supplierSearchParam, searchKey, pageNo, pageSize, request);
|
||||
return supplierManagementAppService.getSupplierList(supplierSearchParam, searchKey,typeEnum, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -35,6 +36,7 @@ public class SupplierDto {
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
private String typeEnum_enumText;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
@@ -57,5 +59,7 @@ public class SupplierDto {
|
||||
|
||||
/** 机构编号 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization",dictCode = "id",dictText = "name")
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SupplierType {
|
||||
public enum SupplierType implements HisEnumInterface {
|
||||
DRAFT(1, "1", "生产商"),
|
||||
|
||||
ACTIVE(2, "2", "供应商");
|
||||
|
||||
Reference in New Issue
Block a user