厂商/供应商后台 疾病目录前台 up by dh
This commit is contained in:
@@ -0,0 +1,129 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.service.ISupplierService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.web.datadictionary.dto.SupplierDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.SupplierSearchParam;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import com.openhis.clinical.domain.ConditionDefinition;
|
||||||
|
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO:厂商/产地
|
||||||
|
*
|
||||||
|
* @author dh
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/data-dictionary-supplier")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SupplierManagementController {
|
||||||
|
private final ISupplierService supplierService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厂商/产地查询
|
||||||
|
*
|
||||||
|
* @param supplierSearchParam 查询条件
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @return 厂商/产地查询结果
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/get-supplier-list")
|
||||||
|
public R<?> getSupplierList(SupplierSearchParam supplierSearchParam,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
|
// 查询条件初始化
|
||||||
|
Supplier supplier = new Supplier();
|
||||||
|
BeanUtils.copyProperties(supplierSearchParam, supplier);
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
Page<Supplier> supplierPage = supplierService.getPage(supplier,pageNo,pageSize);
|
||||||
|
// 定义【入库单据分页列表DTO】的分页,传入【页码】、【行数】、及上面分页的【总数】
|
||||||
|
Page<SupplierDto> returnPage =
|
||||||
|
new Page<>(supplierPage.getCurrent(), supplierPage.getSize(), supplierPage.getTotal());
|
||||||
|
// supplierPage
|
||||||
|
// supplierPage.map(item -> {
|
||||||
|
// SupplierDto supplierDto = new SupplierDto();
|
||||||
|
// BeanUtils.copyProperties(item, supplierDto); // 使用 BeanUtils 复制属性
|
||||||
|
// // 如果有特殊字段需要手动转换,可以在这里处理
|
||||||
|
// return supplierDto;
|
||||||
|
// });
|
||||||
|
|
||||||
|
return R.ok(returnPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加供应商信息
|
||||||
|
*
|
||||||
|
* @param supplierDto 供应商信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/add-supplier")
|
||||||
|
public R<?> addSupplyRequest(@Validated @RequestBody SupplierDto supplierDto) {
|
||||||
|
// 初始化参数
|
||||||
|
Supplier supplier = new Supplier();
|
||||||
|
BeanUtils.copyProperties(supplierDto, supplier);
|
||||||
|
// 如果业务上不需要其它处理 直接调用service的保存方法
|
||||||
|
boolean saveSupplierSuccess = supplierService.save(supplier);
|
||||||
|
|
||||||
|
if (!saveSupplierSuccess) {
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
return saveSupplierSuccess
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"厂商/供应商信息"}))
|
||||||
|
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑供应商信息
|
||||||
|
*
|
||||||
|
* @param supplierDto 供应商信息
|
||||||
|
*/
|
||||||
|
@PutMapping("/edit-supplier")
|
||||||
|
public R<?> editSupplyRequest(@Validated @RequestBody SupplierDto supplierDto) {
|
||||||
|
// 初始化参数
|
||||||
|
Supplier supplier = new Supplier();
|
||||||
|
BeanUtils.copyProperties(supplierDto, supplier);
|
||||||
|
|
||||||
|
return supplierService.updateById(supplier) ?
|
||||||
|
R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"厂商/供应商信息"}))
|
||||||
|
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厂商/产地详细查询
|
||||||
|
*
|
||||||
|
* @param supplierId 查询条件
|
||||||
|
* @return 厂商/产地查询结果
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/get-supplier-detail")
|
||||||
|
public R<?> getSupplierDetail(@RequestParam(name = "id", required = true) String supplierId) {
|
||||||
|
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
Supplier supplierDetail = supplierService.getById(supplierId);
|
||||||
|
return R.ok(supplierDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商保存dto
|
||||||
|
*
|
||||||
|
* @author dh
|
||||||
|
* @date 2025-02-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SupplierDto {
|
||||||
|
|
||||||
|
/** ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 编号 */
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 类型 */
|
||||||
|
private Integer typeEnum;
|
||||||
|
|
||||||
|
/** 地址 */
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 拼音码 */
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/** 五笔码 */
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/** 联系人电话 */
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/** 联系人邮箱 */
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/** 活动标识 */
|
||||||
|
private Integer activeFlag;
|
||||||
|
|
||||||
|
/** 机构编号 */
|
||||||
|
private Long orgId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厂商/产地分页查询条件
|
||||||
|
*
|
||||||
|
* @author dh
|
||||||
|
* @date 2025-02-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SupplierSearchParam implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
@Schema(description = "编号")
|
||||||
|
private String busNo;
|
||||||
|
/**
|
||||||
|
* 名称*
|
||||||
|
*/
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称*
|
||||||
|
*/
|
||||||
|
@Schema(description = "供应商类型")
|
||||||
|
private String typeEnum;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,14 +1,31 @@
|
|||||||
package com.openhis.administration.service;
|
package com.openhis.administration.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
import com.openhis.administration.domain.Supplier;
|
import com.openhis.administration.domain.Supplier;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商管理Service接口
|
* 供应商管理Service接口
|
||||||
*
|
*
|
||||||
* @author system
|
* @author dh
|
||||||
* @date 2025-02-20
|
* @date 2025-02-20
|
||||||
*/
|
*/
|
||||||
public interface ISupplierService extends IService<Supplier> {
|
public interface ISupplierService extends IService<Supplier> {
|
||||||
|
/**
|
||||||
|
* 查询厂商/供应商分页列表
|
||||||
|
*
|
||||||
|
* @param supplier 查询条件
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @return 供应申请列表
|
||||||
|
*/
|
||||||
|
Page<Supplier> getPage(Supplier supplier, Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
package com.openhis.administration.service.impl;
|
package com.openhis.administration.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.utils.StringUtils;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
|
import com.openhis.common.enums.DelFlag;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -13,7 +21,47 @@ import com.openhis.administration.service.ISupplierService;
|
|||||||
* @author system
|
* @author system
|
||||||
* @date 2025-02-20
|
* @date 2025-02-20
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService {
|
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService {
|
||||||
|
|
||||||
|
private final SupplierMapper supplierMapper;
|
||||||
|
/**
|
||||||
|
* 查询厂商/产地列表
|
||||||
|
*
|
||||||
|
* @param supplier 查询条件
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @return 厂商/产地列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<Supplier> getPage(Supplier supplier, Integer pageNo, Integer pageSize) {
|
||||||
|
Page<Supplier> supplierList = new Page<>();
|
||||||
|
// // 判断入库数量
|
||||||
|
// if (supplyRequest.getItemQuantity() != 0) {
|
||||||
|
// // 查询供应申请信息列表
|
||||||
|
// supplyRequestList = supplyRequestMapper.selectPage(new Page<>(pageNo, pageSize),
|
||||||
|
// new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getValue()));
|
||||||
|
// } else {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 设置查询条件
|
||||||
|
LambdaQueryWrapper<Supplier> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(supplier.getBusNo())) {
|
||||||
|
lambdaQueryWrapper.eq(Supplier::getBusNo, supplier.getBusNo());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(supplier.getName())) {
|
||||||
|
lambdaQueryWrapper.eq(Supplier::getName, supplier.getName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotNull(supplier.getTypeEnum())) {
|
||||||
|
lambdaQueryWrapper.eq(Supplier::getTypeEnum, supplier.getTypeEnum());
|
||||||
|
}
|
||||||
|
lambdaQueryWrapper.eq(Supplier::getDeleteFlag, DelFlag.NO.getValue());
|
||||||
|
|
||||||
|
supplierList = supplierMapper.selectPage(new Page<>(pageNo, pageSize), lambdaQueryWrapper);
|
||||||
|
// 返回入库信息列表
|
||||||
|
return supplierList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -13,9 +13,8 @@ export function getDiseaseList(query) {
|
|||||||
// 查询病种目录详细
|
// 查询病种目录详细
|
||||||
export function getDiseaseOne(id) {
|
export function getDiseaseOne(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datadictionary/disease/information-one',
|
url: '/datadictionary/disease/information-one' + parseStrEmpty(id),
|
||||||
method: 'get',
|
method: 'get'
|
||||||
params: id
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,20 +51,3 @@ export function getDiseaseCategory() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户个人信息
|
|
||||||
export function updateUserProfile(data) {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/profile',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询部门下拉树结构
|
|
||||||
export function deptTreeSelect() {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/deptTree',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -303,8 +303,6 @@ const single = ref(true);
|
|||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
const dateRange = ref([]);
|
|
||||||
const deptName = ref("");
|
|
||||||
const conditionDefinitionOptions = ref(undefined);
|
const conditionDefinitionOptions = ref(undefined);
|
||||||
// const initPassword = ref(undefined);
|
// const initPassword = ref(undefined);
|
||||||
// const postOptions = ref([]);
|
// const postOptions = ref([]);
|
||||||
@@ -319,46 +317,12 @@ const data = reactive({
|
|||||||
status: undefined, // 状态(包括 1:预置,2:启用,3:停用)
|
status: undefined, // 状态(包括 1:预置,2:启用,3:停用)
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
userName: [
|
name: [
|
||||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
{ required: true, message: "名称不能为空", trigger: "blur" },
|
||||||
{
|
|
||||||
min: 2,
|
|
||||||
max: 20,
|
|
||||||
message: "用户名称长度必须介于 2 和 20 之间",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
nickName: [
|
|
||||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
|
|
||||||
],
|
|
||||||
password: [
|
|
||||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
|
||||||
{
|
|
||||||
min: 5,
|
|
||||||
max: 20,
|
|
||||||
message: "用户密码长度必须介于 5 和 20 之间",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: /^[^<>"'|\\]+$/,
|
|
||||||
message: "不能包含非法字符:< > \" ' \\ |",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
email: [
|
|
||||||
{
|
|
||||||
type: "email",
|
|
||||||
message: "请输入正确的邮箱地址",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
phonenumber: [
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
|
conditionCode: [
|
||||||
|
{ required: true, message: "编码不能为空", trigger: "blur" },
|
||||||
|
]
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user