产品信息代码提交

master
郑明梁 2 years ago
parent 4df9ca7662
commit 0f1f64439b

@ -0,0 +1,29 @@
package com.glxp.api.controller.thrsys;
import com.github.pagehelper.PageInfo;
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.ThrInvProductsEntity;
import com.glxp.api.res.PageSimpleResponse;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
*
* </p>
*
* @author zml
* @since 2023-01-10
*/
@RestController
public class ThrInvProductsController {
}

@ -0,0 +1,180 @@
package com.glxp.api.controller.thrsys;
import cn.hutool.core.util.StrUtil;
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;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.entity.basic.BasicThirdSysEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.http.ErpBasicClient;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.req.thrsys.ThrProductsRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.thrsys.ThrProductsResponse;
import com.glxp.api.service.basic.BasicThirdSysDetailService;
import com.glxp.api.service.thrsys.ThrProductsService;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
@RestController
public class ThrProductsController {
@Resource
ThrProductsService thrProductsService;
@Resource
BasicThirdSysDetailService basicThirdSysDetailService;
@Resource
private ErpBasicClient erpBasicClient;
//获取ERP产品信息
@AuthRuleAnnotation("")
@GetMapping("udiwms/udiinfo/erp/products")
public BaseResponse getErpProducts(FilterThrProductsRequest filterThrProductsRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("piQueryUrl", filterThrProductsRequest.getThirdSys());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
return ResultVOUtils.error(500, "ERP产品信息接口地址未定义");
}
if (basicThirdSysDetailEntity.getEnabled()) {
if (basicThirdSysDetailEntity.getFromType() == 0 || (filterThrProductsRequest.getIsDownThrSys() != null && filterThrProductsRequest.getIsDownThrSys())) {
BaseResponse<PageSimpleResponse<ThrProductsResponse>> udiDlDeviceResponse = erpBasicClient.getErpProducts(filterThrProductsRequest);
if (udiDlDeviceResponse.getCode() == 20000) {
List<ThrProductsResponse> invmandocResponses = udiDlDeviceResponse.getData().getList();
//todo 耗材字典未确认数据库
// if (invmandocResponses != null) {
// for (ThrProductsResponse invmandocResponse : invmandocResponses) {
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(invmandocResponse.getCode(), filterErpGoodsRequest.getThirdSys());
// invmandocResponse.setThirdSys(thrProductsRequest.getThirdSys());
// if (udiRelevanceEntity != null) {
// invmandocResponse.setChecked(true);
// } else {
// invmandocResponse.setChecked(false);
// }
// }
// }
}
return udiDlDeviceResponse;
} else {
List<ThrProductsResponse> thrCorpEntities = thrProductsService.filterThrProductsRequest(filterThrProductsRequest);
//todo 耗材字典未确认数据库
// for (ThrProductsEntity thrProductsEntity : thrCorpEntities) {
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(thrProductsEntity.getCode(), thrProductsEntity.getThirdSysFk());
// if (udiRelevanceEntity != null) {
// thrProductsEntity.setChecked(true);
// } else {
// thrProductsEntity.setChecked(false);
// }
// }
PageInfo<ThrProductsResponse> pageInfo;
pageInfo = new PageInfo<>(thrCorpEntities);
PageSimpleResponse<ThrProductsResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(thrCorpEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
} else {
return ResultVOUtils.error(500, "第三方系统产品信息接口服务未启用");
}
}
@PostMapping("/udiwms/thrsys/delThrProducts")
public BaseResponse delThrProducts(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (deleteRequest.getIds() != null && deleteRequest.getIds().size() > 0) {
for (String id : deleteRequest.getIds()) {
selectDetale(id);
}
} else {
String id = deleteRequest.getId();
String msg = selectDetale(id);
if (msg != null) {
return ResultVOUtils.error(500, msg);
}
}
return ResultVOUtils.success("删除成功");
}
//删除产品信息
public String selectDetale(String id) {
ThrProductsEntity thrProductsEntity = thrProductsService.selectById(id);
//todo 耗材字典未设计好
// if (thrProductsEntity != null) {
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// if ("thirdId".equals(thrProductsEntity.getThirdSysFk())) {
// filterUdiInfoRequest.setThirdId(thrProductsEntity.getCode());
// } else if ("thirdId1".equals(thrProductsEntity.getThirdSysFk())) {
// filterUdiInfoRequest.setThirdId(thrProductsEntity.getCode());
// } else if ("thirdId2".equals(thrProductsEntity.getThirdSysFk())) {
// filterUdiInfoRequest.setThirdId(thrProductsEntity.getCode());
// } else if ("thirdId3".equals(thrProductsEntity.getThirdSysFk())) {
// filterUdiInfoRequest.setThirdId(thrProductsEntity.getCode());
// } else if ("thirdId4".equals(thrProductsEntity.getThirdSysFk())) {
// filterUdiInfoRequest.setThirdId(thrProductsEntity.getCode());
// }
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0) {
// return "改产品已被选入耗材字典请先移除!";
// }
// }
boolean b = thrProductsService.deleteById(id);
if (b)
return null;
else return "删除失败!";
}
/**
*
*
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/udiwms/udiinfo/erp/products/saveProduct")
public BaseResponse saveProduct(@RequestBody ThrProductsEntity thrProductsEntity) {
if (null == thrProductsEntity)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
thrProductsEntity.setUpdateTime(new Date());
thrProductsService.insertThrProducts(thrProductsEntity);
// //新增主系统产品信息直接加到耗材字典里
// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys();
// if (basicThirdSysEntity.getThirdId().equals(thrProductsEntity.getThirdSysFk()))
// if (!udiContrastService.isExit(null, thrProductsEntity.getCode(), null)) {
// udiContrastService.createOnlyMainId(thrProductsEntity.getCode());
// }
return ResultVOUtils.success();
}
}

@ -0,0 +1,52 @@
package com.glxp.api.dao.basic;
import com.glxp.api.entity.basic.BasicThirdSysEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicThirdSysDao {
// boolean updateBasicThiSys(BasicThirdSysEntity basicThirdSysEntity);
//
BasicThirdSysEntity selectByThirdId(@Param("thirdId") String thirdId);
//
// List<BasicThirdSysEntity> filterBasicThiSys(FilterBasicThirdSysRequest filterBasicThirdSysRequest);
//
// /**
// * 查询启用的第三方系统的ID
// *
// * @return
// */
// List<String> selectEnabledThirdId();
//
// /**
// * 查询第三方系统名称数量
// *
// * @param thirdName
// * @return
// */
// int selectCountByThirdName(@Param("thirdName") String thirdName);
//
// /**
// * 根据系统ID和名称查询第三方系统配置信息
// *
// * @param thirdId
// * @param thirdName
// * @return
// */
// BasicThirdSysEntity selectByThirdIdAndThirdName(@Param("thirdId") String thirdId, @Param("thirdName") String thirdName);
//
/**
* ID
*
* @param thirdId
* @return
*/
String selectThirdNameByThirdId(@Param("thirdId") String thirdId);
//
// int countThirdSys(FilterBasicThirdSysRequest filterBasicThirdSysRequest);
}

@ -0,0 +1,17 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicThirdSysDetailDao extends BaseMapper<BasicThirdSysDetailEntity> {
BasicThirdSysDetailEntity selectByKey(@Param("key") String key,@Param("thirdSys") String thirdSys);
}

@ -0,0 +1,17 @@
package com.glxp.api.dao.thrsys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.thrsys.ThrInvProductsEntity;
/**
* <p>
* Mapper
* </p>
*
* @author zml
* @since 2023-01-10
*/
public interface ThrInvProductsDao extends BaseMapper<ThrInvProductsEntity> {
}

@ -0,0 +1,32 @@
package com.glxp.api.dao.thrsys;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.res.thrsys.ThrProductsResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
public interface ThrProductsDao{
List<ThrProductsResponse> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest);
ThrProductsEntity selectById(@Param("id") String id);
boolean deleteById(@Param("id") String id);
boolean insertThrProducts(ThrProductsEntity thrProductsEntity);
}

@ -0,0 +1,30 @@
package com.glxp.api.entity.basic;
import lombok.Data;
@Data
public class BasicThirdSysDetailEntity {
private Integer id;
private String key;
private String value;
private Boolean enabled;
private Boolean itrCache;
private String guideUrl;
private String thridUrl;
private String remark;
private String thirdSysFk;
private String name;
private Integer fromType;
private String localAction;
private String thirdAction;
public String getValue() {
if (value == null)
return null;
else if (thridUrl != null)
return thridUrl + value;
else
return value;
}
}

@ -0,0 +1,32 @@
package com.glxp.api.entity.basic;
import lombok.Data;
@Data
public class BasicThirdSysEntity {
private String id;
private String thirdId;
private String thirdName;
private Boolean enabled;
private String remark;
private String guideUrl;
private String thridUrl;
private Boolean mainSys;
//第三方系统IP地址
private String thirdSysUrl;
//第三方系统授权码
private String apikey;
//第三方系统接口秘钥
private String secretkey;
//业务字段
//本系统授权码
private String licenseApikey;
//本系统秘钥
private String licenseSecretkey;
}

@ -0,0 +1,161 @@
package com.glxp.api.entity.thrsys;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author zml
* @since 2023-01-10
*/
@Data
@TableName("thr_inv_products")
public class ThrInvProductsEntity {
private static final long serialVersionUID = 1L;
@TableId(value = "id")
private Integer id;
@TableField("inventoryCode")
private String inventoryCode;
@TableField("inventoryName")
private String inventoryName;
private String spec;
private String count;
@TableField("batchNo")
private String batchNo;
/**
*
*/
@TableField("warehouseName")
private String warehouseName;
/**
*
*/
@TableField("warehouseCode")
private String warehouseCode;
@TableField("registerCertNo")
private String registerCertNo;
/**
*
*/
@TableField("spaceCode")
private String spaceCode;
/**
*
*/
@TableField("spaceName")
private String spaceName;
@TableField("manufacturingDate")
private String manufacturingDate;
@TableField("expirationDate")
private String expirationDate;
@TableField("thirdSysFk")
private String thirdSysFk;
/**
*
*/
private String manufactory;
/**
*
*/
@TableField("productDate")
private String productDate;
/**
*
*/
@TableField("expireDate")
private String expireDate;
/**
*
*/
@TableField("productName")
private String productName;
/**
* ID
*/
@TableField("productId")
private String productId;
/**
*
*/
private String standard;
/**
* /
*/
@TableField("registerNo")
private String registerNo;
/**
* ID
*/
@TableField("supId")
private String supId;
/**
*
*/
@TableField("supName")
private String supName;
/**
*
*/
@TableField("createUser")
private String createUser;
/**
*
*/
@TableField("createTime")
private Date createTime;
/**
*
*/
@TableField("updateUser")
private String updateUser;
/**
*
*/
@TableField("updateTime")
private Date updateTime;
/**
*
*/
private String remark;
}

@ -0,0 +1,169 @@
package com.glxp.api.entity.thrsys;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
@Data
@TableName("thr_products")
public class ThrProductsEntity{
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
*
*/
private String measname;
private String spec;
/**
*
*/
@TableField("registerNo")
private String registerNo;
/**
*
*/
private String manufactory;
@TableField("thirdSysFk")
private String thirdSysFk;
/**
*
*/
private String cplb;
/**
*
*/
private String flbm;
/**
*
*/
private String qxlb;
/**
*
*/
private String ybbm;
/**
*
*/
private String sptm;
/**
*
*/
private String tyshxydm;
/**
*
*/
private String zczbhhzbapzbh;
/**
* /
*/
private String ylqxzcrbarmc;
/**
* /
*/
private String ylqxzcrbarywmc;
/**
*
*/
private String cpms;
/**
*
*/
@TableField("updateTime")
private Date updateTime;
/**
*
*/
@TableField("supName")
private String supName;
/**
*
*/
private String model;
/**
*
*/
private String standard;
/**
*
*/
private String qtbm;
/**
*
*/
private String zczyxqz;
/**
*
*/
private String remark;
/**
* 1
*/
private String remark1;
/**
* 2
*/
private String remark2;
/**
* 3
*/
private String remark3;
/**
*
*/
private String price;
}

@ -4,7 +4,13 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.basic.BasicThirdSysEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.req.thrsys.ThrProductsRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.thrsys.ThrProductsResponse;
import com.glxp.api.service.thrsys.ThrSystemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -44,24 +50,24 @@ public class ErpBasicClient {
// }
// }
//
// //获取产品信息
// public BaseResponse<PageSimpleResponse<ErpProductsResponse>> getErpProducts(FilterErpGoodsRequest filterErpGoodsRequest) {
//
// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(filterErpGoodsRequest.getThirdSys());
// String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getProducts";
//
// try {
// String response = httpOkClient.uCloudPost(url, filterErpGoodsRequest, basicThirdSysEntity);
// BaseResponse<PageSimpleResponse<ErpProductsResponse>> udiDlDeviceResponse =
// JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ErpProductsResponse>>>() {
// });
// return udiDlDeviceResponse;
// } catch (Exception e) {
// log.error("获取产品信息异常", e);
// return ResultVOUtils.error(500, "连接第三方系统接口服务出错!");
// }
// }
//
//获取产品信息
public BaseResponse<PageSimpleResponse<ThrProductsResponse>> getErpProducts(FilterThrProductsRequest filterThrProductsRequest) {
ThrSystemEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(filterThrProductsRequest.getThirdSys());
String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getProducts";
try {
String response = httpOkClient.uCloudPost(url, filterThrProductsRequest, basicThirdSysEntity);
BaseResponse<PageSimpleResponse<ThrProductsResponse>> udiDlDeviceResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ThrProductsResponse>>>() {
});
return udiDlDeviceResponse;
} catch (Exception e) {
log.error("获取产品信息异常", e);
return ResultVOUtils.error(500, "连接第三方系统接口服务出错!");
}
}
// //获取单据类型
// public BaseResponse<PageSimpleResponse<BasicThirdSysBusApiEntity>> getBusTypes(FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest) {
// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(filterBasicThirdSysDetailRequest.getThirdSysFk());

@ -0,0 +1,38 @@
package com.glxp.api.req.thrsys;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.req.ListPageRequest;
import lombok.Data;
import java.util.List;
@Data
public class FilterThrProductsRequest extends ListPageRequest {
private List<ThrProductsEntity> thrProductsEntities;
private String code;
private String name;
private String spec; //规格型号
private String registerNo; //注册证号
private String manufactory; //生产厂家
private String thirdSys;
private String thirdSysFk;
private String unionCode;
private String sptm;
private String ybbm;
private String supName;
private String lastUpdateTime;
private Boolean isDownThrSys;
private List<String> codes;
private Integer checkStatus;
private String customerId;
private String supId;
private Long id;
private String uuid;
private Integer diType;
}

@ -0,0 +1,29 @@
package com.glxp.api.req.thrsys;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
@Data
public class ThrProductsRequest {
private String name;
private String code;
private String unionCode;
private String spec; //规格型号
private String registerNo; //注册证号
private String manufactory; //生产厂家
private String thirdSys;
private String supName;
private Boolean isDownThrSys;
}

@ -0,0 +1,52 @@
package com.glxp.api.res.thrsys;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.util.Date;
@Data
public class ThrProductsResponse {
private Integer id;
private String code; //产品编码
private String name;
private String measname; //计量单位
private String spec; //规格型号
private String registerNo; //注册证号
private String thirdSysFk;
private String manufactory; //生产厂家
private String cplb;
private String flbm;
private String qxlb;
private String ybbm;
private String sptm;
private String tyshxydm;
private String zczbhhzbapzbh;
private String ylqxzcrbarmc;
private String ylqxzcrbarywmc;
private String cpms;
private String supName; //配送企业
private String thirdSysName;
//辅助字段
private boolean isChecked;
private String thirdSys;
//添加字段
private String model; //型号
private String standard; //规格型号,二合一字段
private String qtbm; //其他编码
private String zczyxqz; //注册有效期截止时间
private String price;
private String remark1; //备注1
private String remark2; //备注2
private String remark3; //备注3
private String createUser;
private Date createTime;
private String updateUser;
private Date updateTime;
private String remark;
}

@ -0,0 +1,23 @@
package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.entity.basic.BasicThirdSysEntity;
import com.glxp.api.entity.thrsys.ThrInvProductsEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import java.util.List;
public interface BasicThirdSysDetailService{
BasicThirdSysDetailEntity selectByKey(String key, String thirdSys);
/**
*
*
* @param thrSystemEntity
*/
BaseResponse testThirdService(ThrSystemEntity thrSystemEntity);
}

@ -0,0 +1,34 @@
package com.glxp.api.service.basic.impl;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.dao.basic.BasicThirdSysDetailDao;
import com.glxp.api.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.http.ErpBasicClient;
import com.glxp.api.service.basic.BasicThirdSysDetailService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class BasicThirdSysDetailServiceImpl implements BasicThirdSysDetailService {
@Resource
private ErpBasicClient erpBasicClient;
@Resource
BasicThirdSysDetailDao basicThirdSysDetailDao;
@Override
public BasicThirdSysDetailEntity selectByKey(String key, String thirdSys) {
return basicThirdSysDetailDao.selectByKey(key,thirdSys);
}
@Override
public BaseResponse testThirdService(ThrSystemEntity thrSystemEntity) {
return erpBasicClient.testThridConnect(thrSystemEntity);
}
}

@ -0,0 +1,17 @@
package com.glxp.api.service.thrsys;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.thrsys.ThrInvProductsEntity;
/**
* <p>
*
* </p>
*
* @author zml
* @since 2023-01-10
*/
public interface ThrInvProductsService extends IService<ThrInvProductsEntity> {
}

@ -0,0 +1,31 @@
package com.glxp.api.service.thrsys;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.res.thrsys.ThrProductsResponse;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
public interface ThrProductsService {
List<ThrProductsResponse> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest);
ThrProductsEntity selectById(String id);
boolean deleteById(String id);
boolean insertThrProducts(ThrProductsEntity thrProductsEntity);
}

@ -0,0 +1,21 @@
package com.glxp.api.service.thrsys.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.thrsys.ThrInvProductsDao;
import com.glxp.api.entity.thrsys.ThrInvProductsEntity;
import com.glxp.api.service.thrsys.ThrInvProductsService;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author zml
* @since 2023-01-10
*/
@Service
public class ThrInvProductsServiceImpl extends ServiceImpl<ThrInvProductsDao, ThrInvProductsEntity> implements ThrInvProductsService {
}

@ -0,0 +1,76 @@
package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicThirdSysDao;
import com.glxp.api.dao.basic.BasicThirdSysDetailDao;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.dao.thrsys.ThrProductsDao;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.res.thrsys.ThrProductsResponse;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
@Service
public class ThrProductsServiceImpl implements ThrProductsService {
@Resource
ThrProductsDao thrProductsDao;
@Resource
BasicThirdSysDao basicThirdSysDao;
@Override
public List<ThrProductsResponse> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest) {
if (filterThrProductsRequest == null) {
return Collections.emptyList();
}
if (filterThrProductsRequest.getPage() != null) {
int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit();
PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit());
}
List<ThrProductsResponse> data = thrProductsDao.filterThrProductsRequest(filterThrProductsRequest);
if (CollUtil.isNotEmpty(data)) {
for (ThrProductsResponse thrProductsResponse : data) {
if (StrUtil.isNotBlank(thrProductsResponse.getThirdSysFk())) {
String thirdName = basicThirdSysDao.selectThirdNameByThirdId(thrProductsResponse.getThirdSysFk());
thrProductsResponse.setThirdSysName(thirdName);
}
}
}
return data;
}
@Override
public ThrProductsEntity selectById(String id) {
return thrProductsDao.selectById(id);
}
@Override
public boolean deleteById(String id) {
return thrProductsDao.deleteById(id);
}
@Override
public boolean insertThrProducts(ThrProductsEntity thrProductsEntity) {
return thrProductsDao.insertThrProducts(thrProductsEntity);
}
}

@ -0,0 +1,68 @@
<?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.basic.BasicThirdSysDao">
<!-- <update id="updateBasicThiSys" parameterType="com.glxp.api.admin.entity.basic.BasicThirdSysEntity">-->
<!-- UPDATE basic_third_sys-->
<!-- <trim prefix="set" suffixOverrides=",">-->
<!-- <if test="thirdId != null">thirdId=#{thirdId},</if>-->
<!-- <if test="thirdName != null">thirdName=#{thirdName},</if>-->
<!-- <if test="guideUrl != null">guideUrl=#{guideUrl},</if>-->
<!-- <if test="remark != null">remark=#{remark},</if>-->
<!-- <if test="thridUrl != null">thridUrl=#{thridUrl},</if>-->
<!-- <if test="enabled != null">enabled=#{enabled},</if>-->
<!-- <if test="mainSys != null">mainSys=#{mainSys},</if>-->
<!-- <if test="thirdSysUrl != null">thirdSysUrl=#{thirdSysUrl},</if>-->
<!-- <if test="apikey != null">apikey=#{apikey},</if>-->
<!-- <if test="secretkey != null">secretkey=#{secretkey}</if>-->
<!-- </trim>-->
<!-- WHERE id=#{id}-->
<!-- </update>-->
<!-- <select id="filterBasicThiSys" parameterType="com.glxp.api.req.basic.FilterBasicThirdSysRequest"-->
<!-- resultType="com.glxp.api.entity.basic.BasicThirdSysEntity">-->
<!-- SELECT * FROM basic_third_sys-->
<!-- <where>-->
<!-- <if test="thirdId != '' and thirdId != null">-->
<!-- AND thirdId like concat('%',#{thirdId},'%')-->
<!-- </if>-->
<!-- <if test="thirdName != '' and thirdName != null">-->
<!-- AND thirdName like concat('%',#{thirdName},'%')-->
<!-- </if>-->
<!-- <if test="enabled != null">-->
<!-- AND enabled = #{enabled}-->
<!-- </if>-->
<!-- <if test="mainSys != '' and mainSys != null">-->
<!-- AND mainSys = #{mainSys}-->
<!-- </if>-->
<!-- </where>-->
<!-- </select>-->
<select id="selectByThirdId" parameterType="Map" resultType="com.glxp.api.entity.basic.BasicThirdSysEntity">
select * FROM basic_third_sys WHERE thirdId = #{thirdId}
</select>
<!-- <select id="selectEnabledThirdId" resultType="java.lang.String">-->
<!-- select thirdId-->
<!-- from basic_third_sys-->
<!-- where enabled = true-->
<!-- </select>-->
<!-- <select id="selectCountByThirdName" resultType="java.lang.Integer">-->
<!-- select count(*) from basic_third_sys where thirdName =#{thirdName}-->
<!-- </select>-->
<!-- <select id="selectByThirdIdAndThirdName" resultType="com.glxp.api.admin.entity.basic.BasicThirdSysEntity">-->
<!-- select * from basic_third_sys where thirdId = #{thirdId} and thirdName = #{thirdName}-->
<!-- </select>-->
<select id="selectThirdNameByThirdId" resultType="java.lang.String">
select thirdName from basic_third_sys where thirdId = #{thirdId}
</select>
<!-- <select id="countThirdSys" resultType="java.lang.Integer">-->
<!-- select count(*) from basic_third_sys-->
<!-- <where>-->
<!-- <if test="enabled != null">-->
<!-- AND enabled = #{enabled}-->
<!-- </if>-->
<!-- </where>-->
<!-- </select>-->
</mapper>

@ -0,0 +1,17 @@
<?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.basic.BasicThirdSysDetailDao">
<select id="selectByKey" parameterType="Map"
resultType="com.glxp.api.entity.basic.BasicThirdSysDetailEntity">
select basic_third_sys_detail.*, basic_third_sys.thridUrl
FROM basic_third_sys_detail
inner join basic_third_sys on basic_third_sys_detail.thirdSysFk = basic_third_sys.thirdId
WHERE basic_third_sys_detail.key = #{key}
and basic_third_sys_detail.thirdSysFk = #{thirdSys}
and basic_third_sys.enabled = 1
</select>
</mapper>

@ -0,0 +1,42 @@
<?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.ThrInvProductsDao">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrInvProductsEntity">
<id column="id" property="id" />
<result column="inventoryCode" property="inventoryCode" />
<result column="inventoryName" property="inventoryName" />
<result column="spec" property="spec" />
<result column="count" property="count" />
<result column="batchNo" property="batchNo" />
<result column="warehouseName" property="warehouseName" />
<result column="warehouseCode" property="warehouseCode" />
<result column="registerCertNo" property="registerCertNo" />
<result column="spaceCode" property="spaceCode" />
<result column="spaceName" property="spaceName" />
<result column="manufacturingDate" property="manufacturingDate" />
<result column="expirationDate" property="expirationDate" />
<result column="thirdSysFk" property="thirdSysFk" />
<result column="manufactory" property="manufactory" />
<result column="productDate" property="productDate" />
<result column="expireDate" property="expireDate" />
<result column="productName" property="productName" />
<result column="productId" property="productId" />
<result column="standard" property="standard" />
<result column="registerNo" property="registerNo" />
<result column="supId" property="supId" />
<result column="supName" property="supName" />
<result column="createUser" property="createUser" />
<result column="createTime" property="createTime" />
<result column="updateUser" property="updateUser" />
<result column="updateTime" property="updateTime" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, inventoryCode, inventoryName, spec, count, batchNo, warehouseName, warehouseCode, registerCertNo, spaceCode, spaceName, manufacturingDate, expirationDate, thirdSysFk, manufactory, productDate, expireDate, productName, productId, standard, registerNo, supId, supName, createUser, createTime, updateUser, updateTime, remark
</sql>
</mapper>

@ -0,0 +1,142 @@
<?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.ThrProductsDao">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrProductsEntity">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="measname" property="measname" />
<result column="spec" property="spec" />
<result column="registerNo" property="registerNo" />
<result column="manufactory" property="manufactory" />
<result column="thirdSysFk" property="thirdSysFk" />
<result column="cplb" property="cplb" />
<result column="flbm" property="flbm" />
<result column="qxlb" property="qxlb" />
<result column="ybbm" property="ybbm" />
<result column="sptm" property="sptm" />
<result column="tyshxydm" property="tyshxydm" />
<result column="zczbhhzbapzbh" property="zczbhhzbapzbh" />
<result column="ylqxzcrbarmc" property="ylqxzcrbarmc" />
<result column="ylqxzcrbarywmc" property="ylqxzcrbarywmc" />
<result column="cpms" property="cpms" />
<result column="updateTime" property="updateTime" />
<result column="supName" property="supName" />
<result column="model" property="model" />
<result column="standard" property="standard" />
<result column="qtbm" property="qtbm" />
<result column="zczyxqz" property="zczyxqz" />
<result column="remark" property="remark" />
<result column="remark1" property="remark1" />
<result column="remark2" property="remark2" />
<result column="remark3" property="remark3" />
<result column="price" property="price" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, code, name, measname, spec, registerNo, manufactory, thirdSysFk, cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3, price
</sql>
<select id="filterThrProductsRequest" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.res.thrsys.ThrProductsResponse">
SELECT * FROM thr_products
<where>
<if test="name != '' and name != null">
AND name LIKE concat('%',#{name},'%')
</if>
<if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%')
</if>
<if test="sptm != '' and sptm != null">
AND sptm LIKE concat('%',#{sptm},'%')
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat('%',#{ybbm},'%')
</if>
<if test="registerNo != '' and registerNo != null">
AND registerNo LIKE concat('%',#{registerNo},'%')
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%',#{manufactory},'%')
</if>
<if test="spec != '' and spec != null">
AND spec LIKE concat('%',#{spec},'%')
</if>
<if test="unionCode != '' and unionCode != null">
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE
concat('%',#{unionCode},'%')
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
<if test="thirdSys != '' and thirdSys != null">
AND thirdSysFk = #{thirdSys}
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%',#{supName},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
<select id="selectById" parameterType="Map" resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
select *
FROM thr_products
WHERE id = #{id}
</select>
<delete id="deleteById" parameterType="Map">
DELETE
FROM thr_products
WHERE id = #{id}
</delete>
<insert id="insertThrProducts" keyProperty="id"
parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
replace
INTO thr_products
(code, `name`, measname, spec, registerNo, manufactory,
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price)
values (
#{code},
#{name},
#{measname},
#{spec},
#{registerNo},
#{manufactory},
#{cplb},
#{flbm},
#{qxlb},
#{ybbm},
#{sptm},
#{tyshxydm},
#{zczbhhzbapzbh},
#{ylqxzcrbarmc},
#{ylqxzcrbarywmc},
#{cpms},
#{thirdSysFk},
#{updateTime},
#{supName},
#{model},
#{standard},
#{qtbm},
#{zczyxqz},
#{remark},
#{remark1},
#{remark2},
#{remark3},
#{price}
)
</insert>
</mapper>
Loading…
Cancel
Save