代码更新完善

cert
1178634255 2 years ago
parent b7b48fdeb7
commit 49ea846446

@ -0,0 +1,58 @@
package com.glxp.api.controller.basic;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.entity.basic.BasicProductsExportLogEntity;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.http.HttpOkClient;
import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse;
import com.glxp.api.service.basic.BasicProductsExportLogService;
import com.glxp.api.service.sync.SyncDataSetService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Service
public class BasicGenExcelService {
@Resource
BasicProductsExportLogService basicProductsExportLogService;
@Resource
HttpOkClient httpOkClient;
@Resource
SyncDataSetService syncDataSetService;
@Async
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public void uploadProductsSmpJson(String genKey, UdiRelevanceExportJsonResponse exportData) {
BasicProductsExportLogEntity basicProductsExportLogEntity = basicProductsExportLogService.selectByGenKey(genKey);
// String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/basic/products/upload", exportData);
String response = httpOkClient.uCloudPost(getIpUrl() + "/spssync/basic/udiinfo/upload", exportData);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
basicProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
} else {
basicProductsExportLogEntity.setRemark(baseResponse.getMessage());
basicProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
}
basicProductsExportLogService.updateUdiInfoExportLog(basicProductsExportLogEntity);
}
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
}

@ -0,0 +1,72 @@
package com.glxp.api.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.basic.BasicProductsExportLogEntity;
import com.glxp.api.req.basic.FilterUdiEpLogRequest;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.basic.UdiInfoExportRequest;
import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse;
import com.glxp.api.service.basic.BasicGenJsonService;
import com.glxp.api.service.basic.BasicProductsExportLogService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.util.CustomUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*/
@Slf4j
@RestController
public class BasicProductsExportLogController {
@Resource
BasicProductsExportLogService basicProductsExportLogService;
@Resource
BasicGenJsonService basicGenJsonService;
@Resource
BasicGenExcelService basicGenExcelService;
//产品信息上传SMP并创建生成记录
@PostMapping("/udiwms/products/importLog/uploadSmp")
@Log(title = "医疗器械信息", businessType = BusinessType.INSERT)
public BaseResponse uploadSmp(@RequestBody UdiInfoExportRequest udiInfoExportRequest) {
BasicProductsExportLogEntity basicProductsExportLogEntity = new BasicProductsExportLogEntity();
basicProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
basicProductsExportLogEntity.setGenKey(genKey);
basicProductsExportLogEntity.setUpdateTime(new Date());
basicProductsExportLogEntity.setType(BasicProcessStatus.EXPORT_SMP);
basicProductsExportLogEntity.setDlCount(0);
basicProductsExportLogService.insertUdiInfoExportLog(basicProductsExportLogEntity);
UdiRelevanceExportJsonResponse exportData = basicGenJsonService.paresDataJson(udiInfoExportRequest);
basicGenExcelService.uploadProductsSmpJson(genKey, exportData);
// basicGenExcelService.uploadProductsSmp(genKey, udiInfoExportRequest);
return ResultVOUtils.success("后台正在上传,请稍后刷新查看!");
}
}

@ -0,0 +1,18 @@
package com.glxp.api.dao.basic;
import com.glxp.api.entity.basic.BasicProductsExportLogEntity;
import com.glxp.api.req.basic.FilterUdiEpLogRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicProductsExportLogDao {
List<BasicProductsExportLogEntity> filterUdiInfoExportLog(FilterUdiEpLogRequest filterInCodeLogRequest);
boolean insertUdiInfoExportLog(BasicProductsExportLogEntity udiInfoImportEntity);
boolean updateUdiInfoExportLog(BasicProductsExportLogEntity udiInfoImportEntity);
}

@ -0,0 +1,22 @@
package com.glxp.api.dao.basic;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.basic.UdiInfoRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface UdiProductDao {
/**
* UUID
*/
List<UdiProductEntity> batchSelectByUuid(@Param("uuids") List<String> uuids);
}

@ -17,4 +17,6 @@ public interface UdiRelevanceDao extends BaseMapperPlus<UdiRelevanceDao, UdiRele
List<UdiRelevanceEntity> batchSelectByIds(@Param("ids") List<String> ids);
boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity);
List<UdiRelevanceEntity> batchSelectByUuid(@Param("uuids") List<String> uuids);
}

@ -0,0 +1,26 @@
package com.glxp.api.dao.thrsys;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.thrsys.FilterThrProductsRequest;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
public interface ThrProductsDao extends BaseMapperPlus<ThrProductsDao, ThrProductsEntity, ThrProductsEntity> {
List<ThrProductsEntity> filterThrProducts(FilterThrProductsRequest filterThrProductsRequest);
}

@ -0,0 +1,39 @@
package com.glxp.api.entity.thrsys;
import com.glxp.api.util.page.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 String companyName;
private Boolean isDownThrSys;
private Integer status;
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,185 @@
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 lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author ${author}
* @since 2023-01-10
*/
@Data
@TableName("thr_products")
public class ThrProductsEntity {
@TableId(value = "id", type = IdType.INPUT)
private Long 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;
/**
*
*/
@TableField("createUser")
private String createUser;
/**
*
*/
@TableField("createTime")
private Date createTime;
/**
*
*/
@TableField("updateUser")
private String updateUser;
}

@ -0,0 +1,58 @@
package com.glxp.api.http;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.util.OkHttpCli;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
public class HttpOkClient {
@Resource
OkHttpCli okHttpCli;
public String uCloudPost(String url, Object object) {
String json = JSONUtil.toJsonStr(object);
log.info(url + "\n" + json);
String response = okHttpCli.doPostJson(url, json, "Content-Type", "application/json");
return response;
}
public String uCloudPost(String url, Object object, ThrSystemEntity thrSystemEntity) {
String json = JSONUtil.toJsonStr(object);
log.info(url + "\n" + json);
List<String> header = new ArrayList<>();
header.add("Content-Type");
header.add("application/json");
if (null != thrSystemEntity) {
if (StrUtil.isNotEmpty(thrSystemEntity.getApikey())) {
header.add("api_key");
header.add(thrSystemEntity.getApikey());
}
if (StrUtil.isNotEmpty(thrSystemEntity.getSecretkey())) {
header.add("secret_key");
header.add(thrSystemEntity.getSecretkey());
}
}
String[] strArray = new String[header.size()];
header.toArray(strArray);
return okHttpCli.doPostJson(url, json, strArray);
}
}

@ -0,0 +1,40 @@
package com.glxp.api.req.thrsys;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.util.page.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 String companyName;
private Boolean isDownThrSys;
private Integer status;
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,35 @@
package com.glxp.api.res.basic;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@Data
public class UdiRelevanceExportJsonResponse {
List<UdiProductEntity> udiProductEntities;
List<UdiRelevanceEntity> udiRelevanceEntities;
//第三方产品信息
List<ThrProductsEntity> thrProductsEntities;
public UdiRelevanceExportJsonResponse() {
this.udiProductEntities = new ArrayList<>();
this.udiRelevanceEntities = new ArrayList<>();
this.udiRlSupEntityList = new ArrayList<>();
this.thrProductsEntities = new ArrayList<>();
}
private List<UdiRlSupEntity> udiRlSupEntityList;
}

@ -0,0 +1,112 @@
package com.glxp.api.service.basic;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ReflectUtil;
import com.glxp.api.dao.basic.UdiProductDao;
import com.glxp.api.dao.basic.UdiRelevanceDao;
import com.glxp.api.dao.thrsys.ThrProductsDao;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.thrsys.FilterThrProductsRequest;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.basic.UdiInfoExportRequest;
import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
public class BasicGenJsonService {
@Resource
ThrProductsDao thrProductsDao;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
UdiProductDao udiProductDao;
@Resource
UdiRelevanceDao udiRelevanceDao;
public UdiRelevanceExportJsonResponse paresDataJson(UdiInfoExportRequest udiInfoExportRequest) {
UdiRelevanceExportJsonResponse exportData = new UdiRelevanceExportJsonResponse();
//选中导出
if (CollUtil.isNotEmpty(udiInfoExportRequest.getUuids())) {
List<String> uuids = udiInfoExportRequest.getUuids();
uuids.forEach(uuid -> {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setUuid(uuid);
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiRelRequest);
if (CollUtil.isNotEmpty(udiRelevanceResponses)) {
parseUdiRelevanceResponses(exportData, udiRelevanceResponses);
}
});
} else {
//一键导出
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
BeanUtil.copyProperties(udiInfoExportRequest, filterUdiRelRequest);
filterUdiRelRequest.setPage(null);
List<UdiRelevanceResponse> data = udiRelevanceService.filterUdiRelevance(filterUdiRelRequest);
if (CollUtil.isNotEmpty(data)) {
parseUdiRelevanceResponses(exportData, data);
}
}
return exportData;
}
/**
*
*
* @param exportData
* @param udiRelevanceResponses
*/
private void parseUdiRelevanceResponses(UdiRelevanceExportJsonResponse exportData, List<UdiRelevanceResponse> udiRelevanceResponses) {
List<String> uuids = new ArrayList<>(udiRelevanceResponses.size());
udiRelevanceResponses.forEach(udi -> {
uuids.add(udi.getUuid());
});
List<UdiProductEntity> udiInfoEntities = udiProductDao.batchSelectByUuid(uuids);
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceDao.batchSelectByUuid(uuids);
if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
List<ThrProductsEntity> thrProductsEntities = new ArrayList<>(udiRelevanceEntities.size());
Field[] fields = ReflectUtil.getFields(UdiRelevanceEntity.class);
udiRelevanceEntities.forEach(udiRelevanceEntity -> {
for (Field field : fields) {
if (field.getName().contains("thirdId")) {
Object fieldValue = ReflectUtil.getFieldValue(udiRelevanceEntity, field);
if (null != fieldValue) {
FilterThrProductsRequest filter = new FilterThrProductsRequest();
filter.setCode(String.valueOf(fieldValue));
filter.setThirdSysFk("thirdId");
List<ThrProductsEntity> result = thrProductsDao.filterThrProducts(filter);
if (CollUtil.isNotEmpty(result)) {
thrProductsEntities.addAll(result);
}
}
}
}
});
if (CollUtil.isNotEmpty(thrProductsEntities)) {
exportData.setThrProductsEntities(thrProductsEntities);
}
}
List<UdiProductEntity> udiInfo = exportData.getUdiProductEntities();
List<UdiRelevanceEntity> udiRelevance = exportData.getUdiRelevanceEntities();
udiInfo.addAll(udiInfoEntities);
udiRelevance.addAll(udiRelevanceEntities);
exportData.setUdiProductEntities(udiInfo);
exportData.setUdiRelevanceEntities(udiRelevance);
}
}

@ -0,0 +1,17 @@
package com.glxp.api.service.basic;
import com.glxp.api.entity.basic.BasicProductsExportLogEntity;
import com.glxp.api.req.basic.FilterUdiEpLogRequest;
import java.util.List;
public interface BasicProductsExportLogService {
BasicProductsExportLogEntity selectByGenKey(String genKey);
boolean insertUdiInfoExportLog(BasicProductsExportLogEntity udiInfoImportEntity);
boolean updateUdiInfoExportLog(BasicProductsExportLogEntity udiInfoImportEntity);
}

@ -2,8 +2,11 @@ package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import java.util.List;
public interface UdiRelevanceService extends IService<UdiRelevanceEntity> {
UdiRelevanceResponse selectUdiId(Long id);
@ -11,4 +14,6 @@ public interface UdiRelevanceService extends IService<UdiRelevanceEntity> {
UdiRelevanceEntity selectById(Long id);
boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity);
List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiRelRequest filterUdiRelRequest);
}

@ -0,0 +1,44 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicProductsExportLogDao;
import com.glxp.api.entity.basic.BasicProductsExportLogEntity;
import com.glxp.api.req.basic.FilterUdiEpLogRequest;
import com.glxp.api.service.basic.BasicProductsExportLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class BasicProductsExportLogServiceImpl implements BasicProductsExportLogService {
@Resource
BasicProductsExportLogDao udiInfoExportLogDao;
@Override
public BasicProductsExportLogEntity selectByGenKey(String genKey) {
FilterUdiEpLogRequest filterUdiEpLogRequest = new FilterUdiEpLogRequest();
filterUdiEpLogRequest.setGenKey(genKey);
List<BasicProductsExportLogEntity> data = udiInfoExportLogDao.filterUdiInfoExportLog(filterUdiEpLogRequest);
if (data != null)
return data.get(0);
else
return null;
}
@Override
public boolean updateUdiInfoExportLog(BasicProductsExportLogEntity udiInfoImportEntity) {
return udiInfoExportLogDao.updateUdiInfoExportLog(udiInfoImportEntity);
}
@Override
public boolean insertUdiInfoExportLog(BasicProductsExportLogEntity udiInfoImportEntity) {
return udiInfoExportLogDao.insertUdiInfoExportLog(udiInfoImportEntity);
}
}

@ -1,6 +1,7 @@
package com.glxp.api.service.basic.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.UdiRelevanceDao;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
@ -56,4 +58,17 @@ public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRel
}
return udiRelevanceDao.updateUdiRelevance(udiRelevanceEntity);
}
@Override
public List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiRelRequest filterUdiRelRequest) {
if (filterUdiRelRequest == null) {
return Collections.emptyList();
}
if (filterUdiRelRequest.getPage() != null) {
int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit());
}
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest);
return data;
}
}

@ -0,0 +1,10 @@
package com.glxp.api.service.sync;
import com.glxp.api.entity.system.SyncDataSetEntity;
public interface SyncDataSetService {
SyncDataSetEntity findSet();
}

@ -0,0 +1,27 @@
package com.glxp.api.service.sync.impl;
import com.glxp.api.dao.system.SyncDataSetDao;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.service.sync.SyncDataSetService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class SyncDataSetServiceImpl implements SyncDataSetService {
@Resource
SyncDataSetDao syncDataSetDao;
@Override
public SyncDataSetEntity findSet() {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
return syncDataSetEntity;
}
}

@ -0,0 +1,46 @@
<?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.BasicProductsExportLogDao">
<update id="updateUdiInfoExportLog" parameterType="com.glxp.api.entity.basic.BasicProductsExportLogEntity">
UPDATE basic_products_export_log
<set>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="dlCount != null">dlCount=#{dlCount},</if>
<if test="status != null">status=#{status},</if>
<if test="filePath != null">filePath=#{filePath},</if>
<if test="remark != null">remark=#{remark},</if>
</set>
WHERE genKey = #{genKey}
</update>
<insert id="insertUdiInfoExportLog" keyProperty="id"
parameterType="com.glxp.api.entity.basic.BasicProductsExportLogEntity">
insert INTO basic_products_export_log
(genKey,updateTime,dlCount,status,filePath,remark,`type`)
values
(
#{genKey},
#{updateTime},
#{dlCount},#{status},#{filePath},#{remark},#{type}
)
</insert>
<select id="filterUdiInfoExportLog" parameterType="com.glxp.api.req.basic.FilterUdiEpLogRequest"
resultType="com.glxp.api.entity.basic.BasicProductsExportLogEntity">
SELECT * FROM basic_products_export_log
<where>
<if test="genKey != '' and genKey != null">
AND genKey = #{genKey}
</if>
<if test="status != '' and status != null">
AND status = #{status}
</if>
<if test="type != '' and type != null">
AND `type` = #{type}
</if>
</where>
ORDER BY updateTime DESC
</select>
</mapper>

@ -0,0 +1,15 @@
<?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.UdiProductDao">
<select id="batchSelectByUuid" resultType="com.glxp.api.entity.basic.UdiProductEntity">
select *
from basic_products where uuid in
<foreach collection="uuids" item="item" separator="," index="index" open="(" close=")">
#{item}
</foreach>
</select>
</mapper>

@ -0,0 +1,53 @@
<?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">
<select id="filterThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
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 = #{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>
</mapper>
Loading…
Cancel
Save