Merge remote-tracking branch 'origin/dev_drug' into dev_drug

dev_unify
yewj 5 months ago
commit ab094e6611

@ -1,18 +1,31 @@
package com.glxp.api.controller.thrsys;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.CusRedissonAnnotation;
import com.glxp.api.annotation.RepeatSubmit;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.RedissonCacheKey;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.thrsys.ThirdAliDrug;
import com.glxp.api.req.thrsys.FilterThrCorpRequest;
import com.glxp.api.req.thrsys.ThirdAliDrugRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.collect.RelCodeDetailResponse;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import com.glxp.api.service.thrsys.ThirdAliDrugService;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class ThirdAliDrugController extends BaseController {
@ -35,4 +48,37 @@ public class ThirdAliDrugController extends BaseController {
return ResultVOUtils.successMsg("上传成功!");
}
@GetMapping("/udiwms/aliDrug/getDrugLevelList")
public BaseResponse getDrugLevelList(ThirdAliDrugRequest thirdAliDrug, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<ThirdAliDrug> list = thirdAliDrugService.filterList(thirdAliDrug);
PageInfo<ThirdAliDrug> pageInfo = new PageInfo<>(list);
PageSimpleResponse<ThirdAliDrug> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/aliDrug/getDrugLevelListBycode")
public BaseResponse getDrugLevelListBycode(ThirdAliDrugRequest thirdAliDrug, BindingResult bindingResult) {
String nameCode = thirdAliDrug.getNameCode();
if (StrUtil.isEmpty(nameCode)){
return ResultVOUtils.error("标识参数不能为空");
}
ThirdAliDrug one = thirdAliDrugService.getOne(new LambdaQueryWrapper<ThirdAliDrug>().eq(ThirdAliDrug::getNameCode, nameCode));
if (one == null) {
return ResultVOUtils.error("标识参数错误");
}
List<ThirdAliDrug> list = thirdAliDrugService.list(new LambdaQueryWrapper<ThirdAliDrug>()
.eq(ThirdAliDrug::getForm, one.getForm())
.eq(ThirdAliDrug::getFormSpec, one.getFormSpec())
.eq(ThirdAliDrug::getPackRatio, one.getPackRatio()));
return ResultVOUtils.success(list);
}
}

@ -2,6 +2,8 @@ package com.glxp.api.dao.thrsys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.thrsys.ThirdAliDrug;
import com.glxp.api.req.thrsys.ThirdAliDrugRequest;
import com.glxp.api.res.collect.RelCodeDetailResponse;
import org.apache.ibatis.annotations.*;
import java.util.List;
@ -13,4 +15,5 @@ public interface ThirdAliDrugMapper extends BaseMapper<ThirdAliDrug> {
int saveOrUpdateBatch(@Param("list") List<ThirdAliDrug> list);
List<ThirdAliDrug> filterList(ThirdAliDrugRequest thirdAliDrug);
}

@ -0,0 +1,109 @@
package com.glxp.api.req.thrsys;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.util.page.ListPageRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class ThirdAliDrugRequest extends ListPageRequest {
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(value = "")
private Integer id;
/**
*
*/
@TableField(value = "`type`")
@ApiModelProperty(value = "药品类型")
private String type;
/**
*
*/
@TableField(value = "manufacturer")
@ApiModelProperty(value = "生产企业")
private String manufacturer;
/**
*
*/
@TableField(value = "cpmctymc")
@ApiModelProperty(value = "产品名称通用名称")
private String cpmctymc;
/**
*
*/
@TableField(value = "form")
@ApiModelProperty(value = "剂型")
private String form;
/**
*
*/
@TableField(value = "formSpec")
@ApiModelProperty(value = "剂型规格")
private String formSpec;
/**
*
*/
@TableField(value = "bzgg")
@ApiModelProperty(value = "包装规格")
private String bzgg;
/**
*
*/
@TableField(value = "spmc")
@ApiModelProperty(value = "商品名称")
private String spmc;
/**
*
*/
@TableField(value = "nameCode")
@ApiModelProperty(value = "层级标识")
private String nameCode;
/**
*
*/
@TableField(value = "packRatio")
@ApiModelProperty(value = "包装比例")
private String packRatio;
/**
*
*/
@TableField(value = "packLevel")
@ApiModelProperty(value = "包装级别")
private String packLevel;
/**
*
*/
@TableField(value = "erpId")
@ApiModelProperty(value = "包装级别")
private String erpId;
/**
*
*/
@TableField(value = "createTime")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@TableField(value = "updateTime")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
}

@ -3,7 +3,9 @@ package com.glxp.api.service.thrsys;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.thrsys.ThirdAliDrugRequest;
import com.glxp.api.service.auth.CustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -11,10 +13,7 @@ import org.springframework.stereotype.Service;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.thrsys.ThirdAliDrugMapper;
@ -224,4 +223,14 @@ public class ThirdAliDrugService extends ServiceImpl<ThirdAliDrugMapper, ThirdAl
}
public List<ThirdAliDrug> filterList(ThirdAliDrugRequest thirdAliDrug) {
if (thirdAliDrug == null) {
return Collections.emptyList();
}
if (thirdAliDrug.getPage() != null) {
int offset = (thirdAliDrug.getPage() - 1) * thirdAliDrug.getLimit();
PageHelper.offsetPage(offset, thirdAliDrug.getLimit());
}
return this.baseMapper.filterList(thirdAliDrug);
}
}

@ -52,4 +52,33 @@
</foreach>
</insert>
<select id="filterList" parameterType="com.glxp.api.req.thrsys.ThirdAliDrugRequest" resultType="com.glxp.api.entity.thrsys.ThirdAliDrug">
select
id,
`type`,
manufacturer,
cpmctymc,
form,
formSpec,
bzgg,
spmc,
nameCode,
packRatio,
packLevel,
createTime,
erpId,
updateTime
from third_ali_drug
<where>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat('%', #{nameCode}, '%')
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save