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

dev
wj 2 years ago
commit d3802d7606

@ -3,6 +3,7 @@ package com.glxp.api.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
@ -10,22 +11,24 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthCompany;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.inout.FilterCodeRequest;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.req.inout.FilterOrderRequest;
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
import com.glxp.api.req.inout.*;
import com.glxp.api.res.inout.CptTraceOrderResponse;
import com.glxp.api.res.inout.CptTraceResultResponse;
import com.glxp.api.res.inout.IoCodeResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.service.auth.AuthCompanyService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.JasperUtils;
import net.sf.jasperreports.engine.JRException;
import org.springframework.beans.factory.annotation.Value;
@ -40,10 +43,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
*
@ -64,6 +64,8 @@ public class IoOrderDetailResultController extends BaseController {
private SystemPDFModuleService systemPDFModuleService;
@Value("${file_path}")
private String filePath;
@Resource
AuthCompanyService authCompanyService;
/**
*
@ -183,7 +185,6 @@ public class IoOrderDetailResultController extends BaseController {
return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId());
}
/**
*
*
@ -256,4 +257,50 @@ public class IoOrderDetailResultController extends BaseController {
return ResultVOUtils.success();
}
/**
* UDI
*/
@PostMapping("/udiCpt/inout/trace/search")
public BaseResponse cptTraceOrder(@RequestBody CptTraceRequest cptTraceRequest) {
if (StrUtil.isEmpty(cptTraceRequest.getBatchNo()) || CollUtil.isEmpty(cptTraceRequest.getDiList())) {
return ResultVOUtils.error(500, "参数有误!");
}
AuthCompany authCompany = authCompanyService.getOne(new QueryWrapper<>());
List<CptTraceOrderResponse> cptTraceOrderResponses = orderDetailResultService.cptTrace(cptTraceRequest);
List<CptTraceResultResponse> cptTraceResultResponses = new ArrayList<>();
if (CollUtil.isNotEmpty(cptTraceOrderResponses)) {
for (CptTraceOrderResponse cptTraceOrderResponse : cptTraceOrderResponses) {
CptTraceResultResponse cptTraceResultResponse = new CptTraceResultResponse();
cptTraceResultResponse.setBillNo(cptTraceOrderResponse.getBillNo());
cptTraceResultResponse.setBillDate(DateUtil.formatDate(cptTraceOrderResponse.getCreateTime()));
cptTraceResultResponse.setBillType(cptTraceOrderResponse.getBillType());
if (cptTraceOrderResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
if (StrUtil.isNotEmpty(cptTraceOrderResponse.getFromInvCode()))
continue;
cptTraceResultResponse.setInOutType(2);
cptTraceResultResponse.setFromCorp(authCompany.getName());
cptTraceResultResponse.setFromCorpCreditNum(authCompany.getCreditCode());
} else {
cptTraceResultResponse.setInOutType(1);
cptTraceResultResponse.setFromCorp(cptTraceOrderResponse.getFromCorpName());
cptTraceResultResponse.setFromCorpCreditNum(cptTraceOrderResponse.getCreditNo());
cptTraceResultResponse.setToCorp(authCompany.getName());
cptTraceResultResponse.setToCorpCreditNum(authCompany.getCreditCode());
}
if (StrUtil.isEmpty(cptTraceOrderResponse.getFromCorpName()) && cptTraceOrderResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
cptTraceResultResponse.setBillType("使用出库");
cptTraceResultResponse.setToUserInfo("患者使用出库");
}
cptTraceResultResponses.add(cptTraceResultResponse);
}
}
return ResultVOUtils.success(cptTraceResultResponses);
}
}

@ -0,0 +1,47 @@
package com.glxp.api.controller.sync;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.idc.utils.IDCUtils;
import lombok.extern.slf4j.Slf4j;
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 java.io.File;
import java.util.List;
@Slf4j
@RestController
public class TestController {
@PostMapping("/test/file/uplaod")
@Log(title = "测试上传数据", businessType = BusinessType.INSERT)
public BaseResponse uploadProducts(@RequestParam("file") List<MultipartFile> files, @RequestParam("key") String key) {
if (StrUtil.isEmpty(key) || !key.equals("glxp6666")) {
return ResultVOUtils.error(500, "key不能为空");
}
String filePath = "D:\\udiwms\\testFile\\";
File createFile = new File(filePath);
if (!createFile.exists()) {
createFile.mkdirs();
}
for (int i = 0; i < files.size(); i++) {
MultipartFile file = files.get(i);
if (file.isEmpty()) {
return ResultVOUtils.error(500, "上传第" + (i++) + "个文件失败");
}
String fileName = file.getOriginalFilename();
try {
IDCUtils.writeFile(file.getBytes(), filePath + file.getName(), file.getOriginalFilename());
} catch (Exception e) {
log.error("产品信息导入失败", e);
}
}
return ResultVOUtils.success("上传成功");
}
}

@ -187,7 +187,7 @@ public class ThrProductsController {
udiProductEntity.setMeasname(thrProductsEntity.getMeasname());
if (StrUtil.isNotEmpty(thrProductsEntity.getSpec()))
udiProductEntity.setGgxh(thrProductsEntity.getSpec());
if (StrUtil.isNotEmpty(thrProductsEntity.getStandard()))
else if (StrUtil.isNotEmpty(thrProductsEntity.getStandard()))
udiProductEntity.setGgxh(thrProductsEntity.getStandard());
if (StrUtil.isNotEmpty(thrProductsEntity.getRegisterNo()))
udiProductEntity.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo());
@ -211,8 +211,8 @@ public class ThrProductsController {
udiProductEntity.setYlqxzcrbarmc(thrProductsEntity.getYlqxzcrbarmc());
if (StrUtil.isNotEmpty(thrProductsEntity.getCpms()))
udiProductEntity.setCpms(thrProductsEntity.getCpms());
if (StrUtil.isNotEmpty(thrProductsEntity.getStandard()))
udiProductEntity.setGgxh(thrProductsEntity.getStandard());
// if (StrUtil.isNotEmpty(thrProductsEntity.getStandard()))
// udiProductEntity.setGgxh(thrProductsEntity.getStandard());
udiProductService.updateUdiInfo(udiProductEntity);
}

@ -0,0 +1,9 @@
package com.glxp.api.dao.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.auth.AuthCompany;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AuthCompanyMapper extends BaseMapper<AuthCompany> {
}

@ -2,7 +2,9 @@ package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoOrderDetailResultEntity;
import com.glxp.api.req.inout.CptTraceRequest;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.res.inout.CptTraceOrderResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import java.util.List;
@ -25,5 +27,7 @@ public interface IoOrderDetailResultDao extends BaseMapperPlus<IoOrderDetailResu
*/
List<IoOrderDetailResultResponse> filterOrderList(FilterOrderDetailResultRequest orderDetailResultRequest);
List<CptTraceOrderResponse> cptTrace(CptTraceRequest cptTraceRequest);
}

@ -0,0 +1,38 @@
package com.glxp.api.entity.auth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "auth_company")
public class AuthCompany {
@TableField(value = "`name`")
private String name;
@TableField(value = "category")
private Integer category;
@TableField(value = "creditCode")
private String creditCode;
@TableField(value = "addr")
private String addr;
@TableField(value = "productAddr")
private String productAddr;
/**
* 1.2.3
*/
@TableField(value = "classes")
private Integer classes;
@TableField(value = "appId")
private String appId;
@TableField(value = "appSecret")
private String appSecret;
}

@ -140,7 +140,7 @@ public class IoCodeEntity implements Serializable {
private Date createTime;
@TableField(exist = false)
private Integer status; //条码校验状态
private int status; //条码校验状态
@TableField(exist = false)
private int scanCount;

@ -137,7 +137,7 @@ public class IoCodeTempEntity {
private Date createTime;
@TableField(exist = false)
private Integer status; //条码校验状态
private int status; //条码校验状态
@TableField(exist = false)
private String mySupId; //更新供应商

@ -24,7 +24,7 @@ public class PurOrderDetailEntity {
* ID
*/
@TableField(value = "productId")
private Integer productId;
private Long productId;
/**
*

@ -0,0 +1,89 @@
package com.glxp.api.req.inout;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
public class CptTraceRequest {
/**
* UDI
*/
private String udiCode;
/**
* ID
*/
private Long produdctRecordIdFk;
/**
* 123
*/
private Integer taskType;
/**
* DIDI
* DI
*/
private List<String> diList;
/**
* ID
*/
private Long companyIdFk;
/**
*
*/
private String ylqxzcrbarmc;
/**
*
*/
private String creditNum;
/**
*
*/
private String cpmctymc;
/**
*
*/
private String ggxh;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
}

@ -0,0 +1,19 @@
package com.glxp.api.res.inout;
import lombok.Data;
import java.util.Date;
@Data
public class CptTraceOrderResponse {
private String billNo;
private Date createTime;
private String mainAction;
private String billType;
private String fromCorpName;
private String creditNo;
private String action;
private String fromInvCode;
private Integer count;
}

@ -0,0 +1,146 @@
package com.glxp.api.res.inout;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import java.util.Date;
@Data
public class CptTraceResultResponse {
private Long id;
/**
*
*/
private String billNo;
/**
*
*/
private String billDate;
/**
* 1:2
*/
private Integer inOutType;
/**
*
*/
private String billType;
/**
*
*/
private String fromCorp;
/**
*
*/
private String fromCorpCreditNum;
/**
*
*/
private String toCorp;
/**
*
*/
private String toCorpCreditNum;
private String toUserInfo;
/**
*
*/
private Long createUser;
/**
* ID
*/
private Long companyIdFk;
/**
*
*/
private String companyName;
/**
*
*/
private String companyCertNum;
/**
*
*/
private Integer clientType;
/**
* 退退
*/
private String returnReason;
/**
*
*/
private String destoryReason;
/**
*
*/
private String excuseUser;
/**
*
*/
private String excuseCode;
/**
*
*/
private String superviserUser;
/**
*
*/
private String superviserCode;
/**
* ID
*/
private Long uploadUser;
/**
*
*/
private String remark;
/**
*
*/
private Date updateTime;
//关联信息
private String cpmctymc;
private String nameCode;
private String ggxh;
private String ylqxzcrbarmc;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private String udiCode;
private String zczbhhzbapzbh;
private String recordCode;
private Integer count;
public String getToCorp() {
if (StrUtil.isEmpty(toCorp))
return toUserInfo;
return toCorp;
}
}

@ -0,0 +1,15 @@
package com.glxp.api.service.auth;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.auth.AuthCompany;
import com.glxp.api.dao.auth.AuthCompanyMapper;
@Service
public class AuthCompanyService extends ServiceImpl<AuthCompanyMapper, AuthCompany> {
}

@ -2,7 +2,9 @@ package com.glxp.api.service.inout;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderDetailResultEntity;
import com.glxp.api.req.inout.CptTraceRequest;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.res.inout.CptTraceOrderResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import java.util.List;
@ -24,4 +26,5 @@ public interface IoOrderDetailResultService {
List<IoOrderDetailResultResponse> filterOrderList(FilterOrderDetailResultRequest orderDetailResultRequest);
List<CptTraceOrderResponse> cptTrace(CptTraceRequest cptTraceRequest);
}

@ -6,7 +6,9 @@ import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.inout.IoOrderDetailResultDao;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderDetailResultEntity;
import com.glxp.api.req.inout.CptTraceRequest;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.res.inout.CptTraceOrderResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.service.inout.IoOrderDetailResultService;
import org.springframework.stereotype.Service;
@ -72,4 +74,9 @@ public class IoOrderDetailResultServiceImpl implements IoOrderDetailResultServic
return orderDetailResultDao.filterOrderList(orderDetailResultRequest);
}
@Override
public List<CptTraceOrderResponse> cptTrace(CptTraceRequest cptTraceRequest) {
return orderDetailResultDao.cptTrace(cptTraceRequest);
}
}

@ -22,6 +22,12 @@ public class UdiInfoUtil {
if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhsxrq()) && "否".equals(udiProductEntity.getScbssfbhsxrq())) {
udiProductEntity.setAllowNoExpire(true);
}
if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhxlh()) && "否".equals(udiProductEntity.getScbssfbhxlh())) {
udiProductEntity.setAllowNoExpire(true);
} else if (StrUtil.isEmpty(udiProductEntity.getScbssfbhxlh())) {
udiProductEntity.setAllowNoExpire(true);
}
return udiProductEntity;
}
@ -42,6 +48,11 @@ public class UdiInfoUtil {
if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhsxrq()) && "否".equals(udiProductEntity.getScbssfbhsxrq())) {
udiProductEntity.setAllowNoExpire(true);
}
if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhxlh()) && "否".equals(udiProductEntity.getScbssfbhxlh())) {
udiProductEntity.setAllowNoExpire(true);
} else if (StrUtil.isEmpty(udiProductEntity.getScbssfbhxlh())) {
udiProductEntity.setAllowNoExpire(true);
}
}
}

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.AuthCompanyMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.auth.AuthCompany">
<!--@mbg.generated-->
<!--@Table auth_company-->
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="category" jdbcType="INTEGER" property="category"/>
<result column="creditCode" jdbcType="VARCHAR" property="creditCode"/>
<result column="addr" jdbcType="VARCHAR" property="addr"/>
<result column="productAddr" jdbcType="VARCHAR" property="productAddr"/>
<result column="classes" jdbcType="INTEGER" property="classes"/>
<result column="appId" jdbcType="VARCHAR" property="appId"/>
<result column="appSecret" jdbcType="VARCHAR" property="appSecret"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
`name`, category, creditCode, addr, productAddr, classes, appId, appSecret
</sql>
</mapper>

@ -74,4 +74,33 @@
</if>
</where>
</select>
<select id="cptTrace" parameterType="com.glxp.api.req.inout.CptTraceRequest"
resultType="com.glxp.api.res.inout.CptTraceOrderResponse">
select io.billNo,
io.createTime,
io.mainAction,
bbt.`name` billType,
basic_corp.`name` fromCorpName,
basic_corp.creditNo,
io.action,
io.fromInvCode
from io_order_detail_result iodr
INNER JOIN io_order io on iodr.orderIdFk = io.billNo
left join basic_corp on io.fromCorp = basic_corp.erpId
INNER JOIN basic_bussiness_type bbt on io.action = bbt.action
<where>
and bbt.inStock = true
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="diList != null and diList.size() != 0">
AND iodr.`nameCode` in
<foreach collection="diList" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

@ -412,7 +412,6 @@ INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `cu
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (5, 33, 110, 0, NULL, '内部码报表打印', NULL, NULL, NULL, NULL, 'reportForms');
CALL Pro_Temp_ColumnWork('basic_udirel', 'zdcfsycs', 'int', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_code', 'updateTime', 'datetime', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'updateTime', 'datetime ', 1);

Loading…
Cancel
Save