Compare commits

...

9 Commits

@ -368,6 +368,13 @@
<artifactId>redisson</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.69</version>
</dependency>
</dependencies>
<build>

@ -0,0 +1,66 @@
package com.glxp.api.aspect;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* request
*/
public class BodyRequestWrapper extends HttpServletRequestWrapper {
/**
* JSON
*/
private String body;
public BodyRequestWrapper(HttpServletRequest request, String context) {
super(request);
body = context;
}
@Override
public ServletInputStream getInputStream() throws IOException {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes("UTF-8"));
return new ServletInputStream() {
@Override
public int read() throws IOException {
return byteArrayInputStream.read();
}
@Override
public boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener listener) {
}
};
}
@Override
public BufferedReader getReader() throws IOException {
return new BufferedReader(new InputStreamReader(this.getInputStream()));
}
}

@ -0,0 +1,53 @@
package com.glxp.api.aspect;
import com.alibaba.fastjson.JSON;
import com.glxp.api.util.Sm2Util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
*
*/
@Slf4j
@Component
public class RequestHandler implements Filter {
/**
*
*/
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// form-data不校验
if ("application/x-www-form-urlencoded".equals(request.getContentType())) {
chain.doFilter(request, response);
return;
}
// 拿到加密串
String data = new RequestWrapper((HttpServletRequest) request).getBody();
if (StringUtils.isEmpty(data)) {
chain.doFilter(request, response);
return;
}
// 解析
String body = Sm2Util.decrypt("00e36cfc8d61175584333e6160c645700f2a4659f5908c1bed5824423eab1a1626", JSON.parseObject(data).getString("data"));
log.info(body);
request = new BodyRequestWrapper((HttpServletRequest) request, body);
chain.doFilter(request, response);
}
}

@ -0,0 +1,95 @@
package com.glxp.api.aspect;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*;
/**
* body
*/
public class RequestWrapper extends HttpServletRequestWrapper {
private final String body;
public RequestWrapper(HttpServletRequest request) {
super(request);
StringBuilder stringBuilder = new StringBuilder();
BufferedReader bufferedReader = null;
InputStream inputStream = null;
try {
inputStream = request.getInputStream();
if (inputStream != null) {
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
char[] charBuffer = new char[128];
int bytesRead = -1;
while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
stringBuilder.append(charBuffer, 0, bytesRead);
}
} else {
stringBuilder.append("");
}
} catch (IOException ex) {
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
body = stringBuilder.toString();
}
@Override
public ServletInputStream getInputStream() throws IOException {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes());
ServletInputStream servletInputStream = new ServletInputStream() {
@Override
public boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {
}
@Override
public int read() throws IOException {
return byteArrayInputStream.read();
}
};
return servletInputStream;
}
@Override
public BufferedReader getReader() throws IOException {
return new BufferedReader(new InputStreamReader(this.getInputStream()));
}
public String getBody() {
return this.body;
}
}

@ -238,6 +238,9 @@ public class Constant {
public static final String ORDER_STATUS_INCODE = "supInCode";
public static final String ORDER_STATUS_RETURN = "supReturned";
/**前端页面查询相关单据类型标识*/

@ -126,7 +126,7 @@ public class LoginController extends BaseController {
Map<String, Object> claims = new HashMap<>();
claims.put("admin_id", authAdmin.getId());
String token = JwtUtils.createToken(claims, 86400L); // 一天后过期
String token = JwtUtils.createToken(claims, 1800L); // 一天后过期
Map<String, Object> map = new HashMap<>();
map.put("id", authAdmin.getId());

@ -132,7 +132,7 @@ public class RegisterController {
JSONObject json = new JSONObject();
json.put("memPhone", checkCodeRequest.getPhoneNum());
json.put("code", mobile_code);
json.put("createTime", System.currentTimeMillis());
json.put("createTime", System.currentTimeMillis() + "");
//验证码存入redis中
redisUtil.set(Constant.CAPTCHAS + checkCodeRequest.getPhoneNum(), json, 300L);
return ResultVOUtils.success("发送成功" + " " + mobile_code);

@ -193,8 +193,9 @@ public class UdiContrastController {
productInfoService.insertProductInfos(productInfoEntityList);
newUuid = productInfoEntityList.get(0).getUuid();
}
} else {
return ResultVOUtils.error(500, "实时获取国家库数据失败!");
}
udiInfoEntities = udiDlHttpClient.getUdiByUuid(newUuid);
udiProductService.deleteByUuid(udiCombineRequest.getUuid());
for (UdiProductEntity udiProductEntity : udiInfoEntities) {

@ -437,7 +437,7 @@ public class SupCertController {
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark());
supData.put("filePath", filePath + "register/image2/" + url);
supData.put("filePath", filePath + "register/file/image2/" + url);
list.add(supData);
i++;
}
@ -553,7 +553,7 @@ public class SupCertController {
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark());
supData.put("filePath", filePath + "register/image2/" + url);
supData.put("filePath", filePath + "register/file/image2/" + url);
list.add(supData);
i++;
}
@ -619,7 +619,7 @@ public class SupCertController {
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark());
supData.put("filePath", filePath + "register/image2/" + url);
supData.put("filePath", filePath + "register/file/image2/" + url);
list.add(supData);
i++;
}

@ -144,15 +144,16 @@ public class SupProductController {
int i = supProductService.findProduct(supProductEntity);
System.out.println(i);
if (i == 0) {
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = supProductService.insertRegistration(supProductEntity);
if (b) {
return ResultVOUtils.success("添加成功");
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = supProductService.insertRegistration(supProductEntity);
if (b) {
return ResultVOUtils.success("添加成功");
} else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
} else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}} else {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
}
}
@ -176,6 +177,7 @@ public class SupProductController {
supProductEntity.setProductType(udiRelevanceResponse.getQxlb());
supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm());
supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc());
supProductEntity.setManufactory(selectProductBindRequest.getCompanyName());
supProductEntity.setSpecification(udiRelevanceResponse.getGgxh());
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());

@ -0,0 +1,68 @@
package com.glxp.api.controller.sync;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.annotation.AuthRuleAnnotation;
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.dao.basic.BasicProductsDao;
import com.glxp.api.dao.basic.CompanyProductRelevanceDao;
import com.glxp.api.dao.basic.UdiRelevanceDao;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.req.sync.SpsSyncBasicRlRequest;
import com.glxp.api.req.system.DeleteRequest;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@Api(tags = "内网基础信息同步修改")
@RequiredArgsConstructor
@Slf4j
public class SpsSyncBasicController {
private final UdiRelevanceDao udiRelevanceDao;
private final BasicProductsDao basicProductsDao;
private final CompanyProductRelevanceDao relevanceDao;
@AuthRuleAnnotation("")
@PostMapping("/spssync/basic/udirl/update")
@Log(title = "内网同步修改基础数据", businessType = BusinessType.UPDATE)
public BaseResponse udiRlUpdate(@RequestBody UdiRelevanceEntity udiRelevanceEntity) {
if (udiRelevanceEntity.getId() == null) {
return ResultVOUtils.error(500, "缺少唯一标识");
}
int b = udiRelevanceDao.updateById(udiRelevanceEntity);
if (b > 0)
return ResultVOUtils.success("更新成功!");
else
return ResultVOUtils.error(500, "更新失败!");
}
@AuthRuleAnnotation("")
@PostMapping("/spssync/basic/udirl/batchInsert")
@Log(title = "内网同步修改基础数据", businessType = BusinessType.UPDATE)
public BaseResponse udiRlUpdate(@RequestBody SpsSyncBasicRlRequest spsSyncBasicRlRequest) {
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getUdiRelevanceEntities())) {
udiRelevanceDao.replaceBatchs(spsSyncBasicRlRequest.getUdiRelevanceEntities());
}
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getBasicProductsEntities())) {
basicProductsDao.replaceBatchs(spsSyncBasicRlRequest.getBasicProductsEntities());
}
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getCompanyProductRelevanceEntities())) {
relevanceDao.replaceBatchs(spsSyncBasicRlRequest.getCompanyProductRelevanceEntities());
}
return ResultVOUtils.success("同步成功!");
}
}

@ -1332,5 +1332,6 @@ public class SpsSyncDownloadController {
}
}
}

@ -11,12 +11,10 @@ import com.glxp.api.constant.SocketMsgType;
import com.glxp.api.entity.sync.SocketMsgEntity;
import com.glxp.api.idc.utils.IDCUtils;
import com.glxp.api.res.inout.IoCodeResponse;
import com.glxp.api.util.Sm2Util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
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.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@ -67,4 +65,11 @@ public class TestController {
return ResultVOUtils.success(socketMsgEntity);
}
@PostMapping("/sm2")
public BaseResponse sm2(@RequestParam String data) {
return ResultVOUtils.success(Sm2Util.decrypt("00e36cfc8d61175584333e6160c645700f2a4659f5908c1bed5824423eab1a1626", data));
}
}

@ -0,0 +1,44 @@
package com.glxp.api.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
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.entity.thrsys.ThrProductTypeEntity;
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.thrsys.ThrProductTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@RestController
public class ThrProductTypeCotroller {
@Resource
ThrProductTypeService thrProductTypeService;
@AuthRuleAnnotation("")
@GetMapping("/udiwms/thrsys/getThrProductType")
public BaseResponse getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<ThrProductTypeEntity> thrProductTypeEntityList
= thrProductTypeService.getProductTypes(filterThrProductTypeRequest);
PageInfo<ThrProductTypeEntity> pageInfo;
pageInfo = new PageInfo<ThrProductTypeEntity>(thrProductTypeEntityList);
PageSimpleResponse<ThrProductTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(thrProductTypeEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -30,4 +30,7 @@ public interface IoOrderDetailResultDao extends BaseMapperPlus<IoOrderDetailResu
List<CptTraceOrderResponse> cptTrace(CptTraceRequest cptTraceRequest);
List<CptTraceOrderResponse> cptCodeTrace(CptTraceRequest cptTraceRequest);
}

@ -0,0 +1,15 @@
package com.glxp.api.dao.thrsys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ThrProductTypeMapper extends BaseMapper<ThrProductTypeEntity> {
List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest);
}

@ -99,7 +99,7 @@ public class BasicCorpEntity {
private String thirdName4;
/**
* 1.23,4.
* 1.23,4.
*/
@TableField(value = "corpType")
private Integer corpType;

@ -348,6 +348,9 @@ public class BasicProductsEntity {
@TableField(value = "remark")
private String remark;
@TableField(value = "cphhhbh")
private String cphhhbh;
public static final String COL_ID = "id";
public static final String COL_UUID = "uuid";

@ -0,0 +1,56 @@
package com.glxp.api.entity.thrsys;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@ApiModel(value = "com-glxp-api-entity-thrsys-ThrProductType")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "thr_product_type")
public class ThrProductTypeEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value = "")
private Integer id;
/**
*
*/
@TableField(value = "code")
@ApiModelProperty(value = "类别编码")
private String code;
/**
*
*/
@TableField(value = "`name`")
@ApiModelProperty(value = "类别名称")
private String name;
/**
*
*/
@TableField(value = "thirdSys")
@ApiModelProperty(value = "第三系统标识")
private String thirdSys;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value = "备注")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -2,6 +2,7 @@ package com.glxp.api.http;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
@ -33,7 +34,8 @@ public class NmpaUdiClient {
productInfoFilterRequest.setPage(1);
productInfoFilterRequest.setLimit(100);
productInfoFilterRequest.setUuid(uuid);
if (StrUtil.isEmpty(uuid))
return null;
List<ProductInfoEntity> productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
List<UdiProductEntity> udiInfoEntities = new ArrayList<>();
String myUuid = UuidUtils.getUUId();

@ -14,6 +14,9 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private String code;
private String name;
private String deptCode;
/**
* 1:23
*/
private Integer advanceType;
private Boolean isDefault;
private Date updateTime;

@ -5,7 +5,6 @@ import lombok.Data;
//选入产品补充信息
@Data
public class SupplementRequest {
//补充信息:
private String basicPrductRemak1;
private String basicPrductRemak2;

@ -0,0 +1,16 @@
package com.glxp.api.req.sync;
import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncBasicRlRequest {
private List<UdiRelevanceEntity> udiRelevanceEntities;
private List<CompanyProductRelevanceEntity> companyProductRelevanceEntities;
private List<BasicProductsEntity> basicProductsEntities;
}

@ -0,0 +1,26 @@
package com.glxp.api.req.thrsys;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@Data
public class FilterThrProductTypeRequest extends ListPageRequest {
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
*
*/
private String thirdSys;
private String key;
}

@ -83,4 +83,6 @@ public class CompanyProductRelevanceResponse {
private String basicPrductRemak6;
private String basicPrductRemak7;
private String basicPrductRemak8;
private String cphhhbh;
}

@ -119,7 +119,7 @@ public class UdiRelevanceResponse {
private String syqsfxyjxmj;
private String mjfs;
private String categoryName;
private String cphhhbh;
public int getBhzxxsbzsl() {
if (bhzxxsbzsl == null || bhzxxsbzsl == 0) {

@ -45,6 +45,7 @@ public class UdiRlDlResponse {
private String sptm;
private Integer productType;
private String mainId;
private String cphhhbh;
public Integer getProductType() {
if (productType == null) return 0

@ -94,6 +94,6 @@ public class UdiRlSupResponse {
private String classifyName;
private boolean groupBuy; //是否集采产品
private String cphhhbh;
private Long uid;
}

@ -6,7 +6,7 @@ import com.glxp.api.dao.BaseMapperPlus;
import java.util.List;
public class CustomServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<BaseMapperPlus<M,T,T>, T> implements CustomService<T>{
public class CustomServiceImpl<M extends BaseMapperPlus<M,T,T>, T> extends ServiceImpl<M, T> implements CustomService<T>{
@Override
public int insertIgnore(T entity) {
return baseMapper.insertIgnore(entity);

@ -257,7 +257,10 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl<BasicBussinessTyp
case Constant.ORDER_ACTION_SUP_PREIN:
bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.gt("spUse", 0).eq("enable", true).eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("actionType", 2));
case Constant.ORDER_STATUS_RETURN:
bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.gt("spUse", 0).eq("enable", true).eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("mainAction", ConstantType.TYPE_OUT));
break;
default:
break;
}

@ -154,6 +154,7 @@ public class IoAddInoutService {
} else {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setErrMsg(result);
orderService.update(orderEntity);
insertList.clear();
return;
@ -682,7 +683,10 @@ public class IoAddInoutService {
int count = 0;
if (filterList != null) {
for (IoCodeTempEntity temp : filterList) {
if (temp.getCode().equals(codeEntity.getCode())) {
if (temp.getCode().equals(codeEntity.getCode())
&& StrUtil.trimToEmpty(temp.getSerialNo()).equals(StrUtil.trimToEmpty(codeEntity.getSerialNo()))
&& StrUtil.trimToEmpty(temp.getInBatchNo()).equals(StrUtil.trimToEmpty(codeEntity.getInBatchNo()))
) {
count = count + 1;
}
}
@ -693,7 +697,6 @@ public class IoAddInoutService {
return null;
}
public String checkOriginCode(IoCodeTempEntity warehouseEntity) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());

@ -76,7 +76,10 @@ public class IoOrderDetailResultServiceImpl implements IoOrderDetailResultServic
@Override
public List<CptTraceOrderResponse> cptTrace(CptTraceRequest cptTraceRequest) {
return orderDetailResultDao.cptTrace(cptTraceRequest);
if (StrUtil.isNotEmpty(cptTraceRequest.getSerialNo())) {
return orderDetailResultDao.cptCodeTrace(cptTraceRequest);
} else
return orderDetailResultDao.cptTrace(cptTraceRequest);
}
}

@ -691,6 +691,11 @@ public class IoOrderServiceImpl implements IoOrderService {
case Constant.ORDER_STATUS_UN_ALLOCATE:
filterOrderRequest.setStatuses(Arrays.asList(ConstantStatus.ORDER_STATUS_ALLOCATE));
filterOrderRequest.setDealStatuses(Arrays.asList(2));
case Constant.ORDER_STATUS_RETURN:
filterOrderRequest.setStatuses(Arrays.asList(10, 7));
filterOrderRequest.setDealStatuses(Arrays.asList(3, 4));
break;
default:
break;
}

@ -147,10 +147,12 @@ public class SupProductServiceImpl extends ServiceImpl<SupProductDao, SupProduct
public boolean insertRegistration(SupProductEntity companyEntity) {
return supProductDao.insert(companyEntity) > 0 ? true : false;
}
@Override
public int findProduct(SupProductEntity supProductEntity) {
return supProductDao.findProduct(supProductEntity);
}
@Override
public boolean deleteById(String id) {
return supProductDao.deleteById(id);

@ -295,7 +295,7 @@ public class SpsSyncDownloadService {
}
exportStatus = BasicExportStatusEntity.builder()
.id(CustomUtil.getId())
.status(syncTime == null ? BasicExportStatusEnum.WAIT_TRIGGERED.getCode() : BasicExportStatusEnum.WAIT_BUILT.getCode())
.status(BasicExportStatusEnum.WAIT_BUILT.getCode())
.idDatas(exportEnum.getKey())
.type(exportEnum.getRemark())
.scheduleType(0)
@ -303,9 +303,9 @@ public class SpsSyncDownloadService {
.startTime(now)
.build();
basicExportService.save(exportStatus);
if (syncTime != null) {
createFileMethod.apply(applicationContext.getBean(this.getClass()));
}
// if (syncTime != null) {
createFileMethod.apply(applicationContext.getBean(this.getClass()));
// }
} else if (exportStatus.getStatus().equals(BasicExportStatusEnum.WAIT_BUILT.getCode())) {//文件待生成
createFileMethod.apply(applicationContext.getBean(this.getClass()));
}

@ -18,14 +18,12 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class)
public class BasicExportTimeServiceImpl extends CustomServiceImpl<BasicExportTimeDao, BasicExportStatusTimeEntity> implements BasicExportTimeService {
@Resource
BasicExportTimeDao basicExportTimeDao;
@Override
public BasicExportStatusTimeEntity findByType(String type) {
BasicExportTimeRequest basicExportTimeRequest = new BasicExportTimeRequest();
basicExportTimeRequest.setKey(type);
List<BasicExportStatusTimeEntity> basicExportStatusTimeEntities = basicExportTimeDao.filterExportStatus(basicExportTimeRequest);
List<BasicExportStatusTimeEntity> basicExportStatusTimeEntities = super.baseMapper.filterExportStatus(basicExportTimeRequest);
if (CollUtil.isNotEmpty(basicExportStatusTimeEntities)) {
return basicExportStatusTimeEntities.get(0);
}
@ -41,23 +39,23 @@ public class BasicExportTimeServiceImpl extends CustomServiceImpl<BasicExportTim
if (basicExportStatusRequest == null) {
return Collections.emptyList();
}
return basicExportTimeDao.filterExportStatus(basicExportStatusRequest);
return super.baseMapper.filterExportStatus(basicExportStatusRequest);
}
@Override
public boolean insertExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity) {
return basicExportTimeDao.insertExportStatus(basicExportStatusTimeEntity);
return super.baseMapper.insertExportStatus(basicExportStatusTimeEntity);
}
@Override
public boolean deleteById(String id) {
return basicExportTimeDao.deleteById(id);
return super.baseMapper.deleteById(id);
}
@Override
public boolean updateExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity) {
return basicExportTimeDao.updateExportStatus(basicExportStatusTimeEntity);
return super.baseMapper.updateExportStatus(basicExportStatusTimeEntity);
}
}

@ -0,0 +1,30 @@
package com.glxp.api.service.thrsys;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.thrsys.ThrProductTypeMapper;
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class ThrProductTypeService extends ServiceImpl<ThrProductTypeMapper, ThrProductTypeEntity> {
@Resource
ThrProductTypeMapper thrProductTypeMapper;
public List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest) {
if (filterThrProductTypeRequest == null) {
return Collections.emptyList();
}
if (filterThrProductTypeRequest.getPage() != null) {
int offset = (filterThrProductTypeRequest.getPage() - 1) * filterThrProductTypeRequest.getLimit();
PageHelper.offsetPage(offset, filterThrProductTypeRequest.getLimit());
}
List<ThrProductTypeEntity> data = thrProductTypeMapper.getProductTypes(filterThrProductTypeRequest);
return data;
}
}

@ -1,10 +1,13 @@
package com.glxp.api.upload;
import cn.hutool.core.exceptions.ExceptionUtil;
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.util.MinioUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -21,6 +24,7 @@ import java.util.UUID;
/**
*
*/
@Slf4j
@RestController
public class uploadController {
@ -41,7 +45,8 @@ public class uploadController {
*/
@PostMapping("/udiwms/upload/pdf/template/jasper")
public BaseResponse uploadPDFTemplate(@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
public BaseResponse uploadPDFTemplate(@RequestParam("file") MultipartFile file) {
log.error("上传jasper文件了");
if (file.isEmpty()) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
}
@ -60,6 +65,8 @@ public class uploadController {
file1.mkdirs();// 创建多层目录
}
file1 = new File(savePath + "/" + newName);
log.error("创建文件了");
try {
file.transferTo(file1);
Map<String, String> rMap = new HashMap<>();
@ -68,6 +75,7 @@ public class uploadController {
return ResultVOUtils.success(rMap);
} catch (IOException e) {
e.printStackTrace();
log.error("异常" + ExceptionUtils.getStackTrace(e));
}
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
}

@ -2,12 +2,14 @@ package com.glxp.api.util;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter;
import net.sf.jasperreports.engine.query.JsonQueryExecuterFactory;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@ -28,6 +30,7 @@ import java.util.Map;
* @date 2021-11-10 22:23
*/
@Component
@Slf4j
public class JasperUtils {
private static Logger logger = LoggerFactory.getLogger(JasperUtils.class);
@ -102,7 +105,7 @@ public class JasperUtils {
os.close();
}
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
e.printStackTrace();
}

@ -0,0 +1,80 @@
package com.glxp.api.util;
import cn.hutool.core.util.HexUtil;
import cn.hutool.crypto.BCUtil;
import cn.hutool.crypto.SmUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.SM2;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
import com.glxp.api.annotation.Log;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.crypto.engines.SM2Engine;
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey;
/**
* @author
*/
@Slf4j
public class Sm2Util {
/**
*
*
* @return
*/
public static Map<String, String> generator() {
SM2 sm2 = SmUtil.sm2();
String publicKey = HexUtil.encodeHexStr(((BCECPublicKey) sm2.getPublicKey()).getQ().getEncoded(false)).toUpperCase();
String privateKey = HexUtil.encodeHexStr(BCUtil.encodeECPrivateKey(sm2.getPrivateKey())).toUpperCase();
return new HashMap<String, String>(2) {{
put("publicKey", publicKey);
put("privateKey", privateKey);
}};
}
/**
*
*
* @param publicKey
* @param data
* @return
*/
public static String encrypt(String publicKey, String data) {
return SmUtil.sm2(null, publicKey)
// 不写默认就是C1C3C2
.setMode(SM2Engine.Mode.C1C3C2)
.encryptHex(data.getBytes(), KeyType.PublicKey)
// 加密后密文前面会有04需要去掉
.substring(2);
}
/**
*
*
* @param privateKey
* @param data
* @return
*/
public static String decrypt(String privateKey, String data) {
// 确定前端不会加04所以后端直接加上面处理方式可能造成报错Invalid point coordinates原因前端加密后密文自带04开头
data = "04" + data;
return SmUtil.sm2(privateKey, null)
// 不写默认就是C1C3C2
.setMode(SM2Engine.Mode.C1C3C2)
.decryptStr(data, KeyType.PrivateKey);
}
public static void main(String[] agrs) {
SM2 sm2 = SmUtil.sm2();
String privateKey = HexUtil.encodeHexStr(BCUtil.encodeECPrivateKey(sm2.getPrivateKey()));
String publicKey = HexUtil.encodeHexStr(((BCECPublicKey) sm2.getPublicKey()).getQ().getEncoded(false));
log.info(privateKey);
log.info(publicKey);
}
}

@ -131,6 +131,15 @@ public class SupplementVailUtil {
if (!systemParamConfigEntity.getParamValue().equals("0")) {
return systemParamConfigEntity.getParamValue() + "不能为空";
}
} else {
if (supplementRequest.getBasicPrductRemak6().equals("1")) {
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak8())) {
SystemParamConfigEntity temp = systemParamConfigEntityMap.get("basicPrductRemak8");
if (!temp.getParamValue().equals("0")) {
return temp.getParamValue() + "不能为空";
}
}
}
}
}
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak7");

@ -3,7 +3,7 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_ct?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:

@ -13,7 +13,7 @@ spring:
redis:
database: 10
host: 127.0.0.1
port: 6404
port: 6379
# password: 123456
timeout: 300
jedis:
@ -43,15 +43,20 @@ logging:
level:
com.glxp.api.dao: debug
file_path: /udi/udiwms/udiwmsfile/
back_file_path: /share/udisps/back/
err_path: /udi/udiwms/err/
file_path: D:/udi/udiwms/udiwmsfile/
file_lpath: /udiwms/image/register/file/getImage
file_url: http://127.0.0.1:9993
minio_path: /udi
minio_url: http://139.9.219.60:9000
err_path: d:/udi/udiwms/err/
back_file_path: d:/share/udisps/back/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs
API_KEY: 1101
API_SECRET: zBITspLNvuoEd4FaamlSoqxRHmNsmQ9L
WEB_TITLE: 漳州市中医院
WEB_TITLE: 大田县总医院
WEBSOCKET_TOKEN: 07rKFDFkQvBkbxgc7aUBlONo4gWNdx8b

@ -7,6 +7,7 @@ spring:
multipart:
max-file-size: 200MB
max-request-size: 200MB
location: D:/tmp
mybatis-plus:
mapper-locations: classpath:mybatis/mapper/*/*.xml
configuration:
@ -31,6 +32,6 @@ server:
tomcat:
max-http-form-post-size: 100MB
max-http-post-size: 100MB
max-http-header-size: 100MB
max-http-header-size: 100MB

@ -91,7 +91,7 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
basic_products.categoryName,basic_products.cphhhbh,
basic_products.hchzsb
FROM (company_product_relevance
inner JOIN basic_udirel

@ -65,7 +65,8 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName
basic_products.categoryName,
basic_products.cphhhbh
FROM basic_udirel
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
@ -325,7 +326,7 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
basic_products.categoryName,basic_products.cphhhbh,
company_product_relevance.unitFk,
basic_corp.name companyName
FROM basic_udirel
@ -463,7 +464,8 @@
basic_products.mjfs,
basic_products.categoryName,
basic_products.groupBuy,
basic_products.basicPrductRemak8
basic_products.basicPrductRemak8,
basic_products.cphhhbh
FROM basic_products
inner JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
@ -645,7 +647,7 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName
basic_products.categoryName,basic_products.cphhhbh
FROM basic_products
inner JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
@ -820,7 +822,7 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName
basic_products.categoryName,basic_products.cphhhbh
from basic_udirel
INNER JOIN basic_products on basic_udirel.uuid = basic_products.uuid
<where>
@ -1254,7 +1256,7 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName
basic_products.categoryName,basic_products.cphhhbh
FROM basic_udirel
INNER JOIN basic_products
on basic_udirel.uuid = basic_products.uuid
@ -1374,7 +1376,7 @@
basic_products.mjfs,
basic_products.categoryName,
company_product_relevance.unitFk,
basic_corp.name companyName
basic_corp.name companyName,basic_products.cphhhbh
FROM basic_udirel
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid

@ -102,6 +102,7 @@
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_products.cphhhbh,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
@ -109,9 +110,8 @@
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
basic_products.categoryName,basic_products.cphhhbh,
basic_udirel.groupBuy,
basic_udirel.id as uid,
basic_corp.name companyName
FROM company_product_relevance
@ -377,14 +377,12 @@
<select id="filterCompanyProduct" parameterType="com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest"
resultType="com.glxp.api.req.inout.ioOrderUploadRequest">
SELECT
basic_udirel.id,
basic_udirel.uuid as udiRlIdFk
FROM
company_product_relevance
INNER JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
LEFT JOIN basic_corp ON basic_corp.erpId = company_product_relevance.customerId
SELECT basic_udirel.id,
basic_udirel.uuid as udiRlIdFk
FROM company_product_relevance
INNER JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
LEFT JOIN basic_corp ON basic_corp.erpId = company_product_relevance.customerId
<where>
<if test="customerId != '' and customerId != null">
and company_product_relevance.customerId = #{customerId}

@ -89,7 +89,8 @@
basic_corp.creditNo,
io.action,
io.fromInvCode,
bbt.corpType,iodr.reCount count
bbt.corpType,
iodr.reCount count
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
@ -107,4 +108,36 @@
</if>
</where>
</select>
<select id="cptCodeTrace" 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,
bbt.corpType,
iodr.reCount count
from io_code iodr
INNER JOIN io_order io on iodr.orderId = 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 iodr.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>
<if test="serialNo != null and serialNo != ''">
AND iodr.serialNo = #{serialNo}
</if>
</where>
</select>
</mapper>

@ -0,0 +1,33 @@
<?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.thrsys.ThrProductTypeMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrProductTypeEntity">
<!--@mbg.generated-->
<!--@Table thr_product_type-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="thirdSys" jdbcType="VARCHAR" property="thirdSys"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, `name`, thirdSys, remark
</sql>
<select id="getProductTypes" parameterType="com.glxp.api.req.thrsys.FilterThrProductTypeRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductTypeEntity">
SELECT *
FROM thr_product_type
<where>
<if test="key != '' and key != null">
AND (code LIKE concat('%', #{key}, '%') or name LIKE concat('%', #{key}, '%')
)
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
</where>
</select>
</mapper>

@ -16,7 +16,7 @@
qxlb, tyshxydm, zczbhhzbapzbh,
ylqxzcrbarmc, ylqxzcrbarywmc, updateTime,
supName, model, `standard`,
qtbm, zczyxqz, relId, type)
qtbm, zczyxqz, relId, type, deviceRecordKey)
values
<foreach collection="list" index="index" item="item" separator=",">
(#{item.uuid},
@ -25,6 +25,8 @@
#{item.auditTime},
#{item.remark},
#{item.auditUser},
#{item.status},
#{item.thirdSysFk},
#{item.code},
@ -41,7 +43,8 @@
, #{item.name}, #{item.spec}, #{item.registerNo}, #{item.cplb}
, #{item.flbm}, #{item.qxlb}, #{item.tyshxydm}, #{item.zczbhhzbapzbh}
, #{item.ylqxzcrbarmc}, #{item.ylqxzcrbarywmc}, #{item.updateTime}, #{item.supName}, #{item.model}
, #{item.standard}, #{item.qtbm}, #{item.standard}, #{item.zczyxqz}, #{item.type})
, #{item.standard}, #{item.qtbm}, #{item.standard}, #{item.zczyxqz}, #{item.type},
#{item.deviceRecordKey})
</foreach>
</insert>

@ -695,3 +695,4 @@ CALL Pro_Temp_ColumnWork('io_order_detail_code', 'sterDate', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_result', 'sterBatchNo', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_result', 'sterDate', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_products', 'cphhhbh', 'varchar(255)', 1);

Loading…
Cancel
Save