Merge branch 'master' into dev

pro
wj 2 years ago
commit 49eb0cfe9d

@ -54,7 +54,8 @@ public class AuthorizeAspect {
HttpServletRequest request = attributes.getRequest();
String id = request.getHeader("ADMIN_ID");
if (StrUtil.isBlank(id)) {
String token = request.getHeader("ADMIN_TOKEN");
if (StrUtil.isBlank(id) || StrUtil.isBlank(token)) {
String apiKey = request.getHeader("api_key");
String secretKey = request.getHeader("secret_key");
AuthLicense authLicense = authLicenseDao.get(apiKey);
@ -72,7 +73,7 @@ public class AuthorizeAspect {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
}
String token = request.getHeader("ADMIN_TOKEN");
if (token == null) {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
}

@ -50,6 +50,12 @@ public enum BasicExportTypeEnum {
*
*/
IO_ORDER("io_order", "单据信息"),
/**
*
*/
ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"),
;
@EnumValue
private String key;

@ -1,6 +1,7 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
@ -212,13 +213,13 @@ public class UdiRlSupController extends BaseController {
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse insertFilter(@RequestBody UdiInfoExportRequest udiInfoExportRequest) {
CompanyEntity companyEntity = companyService.findCompany(udiInfoExportRequest.getCustomerId() + "");
if(companyEntity != null){
if("110".equals(companyEntity.getUnitIdFk())) {
udiInfoExportRequest.setUnitFk(null);
} else {
udiInfoExportRequest.setUnitFk(companyEntity.getUnitIdFk());
if (companyEntity != null) {
if ("110".equals(companyEntity.getUnitIdFk())) {
udiInfoExportRequest.setUnitFk(null);
} else {
udiInfoExportRequest.setUnitFk(companyEntity.getUnitIdFk());
}
}
}
//查询本企业有没有选择该产品有选择不能选择
CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();
companyProductRelevanceRequest.setCustomerId(udiInfoExportRequest.getCustomerId() + "");
@ -244,6 +245,7 @@ public class UdiRlSupController extends BaseController {
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
UdiProductEntity udiProductEntity = new UdiProductEntity();
BeanUtils.copyProperties(udiInfoExportRequest.getSupplementRequest(), udiProductEntity);
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
udiProductService.insertUdiInfo(udiProductEntity);
return ResultVOUtils.success("选入成功!");
}

@ -445,4 +445,19 @@ public class IoOrderReviewController extends BaseController {
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/order/getSimpleOrder")
public BaseResponse getSimpleOrder(@RequestBody ReviewSpmsRequest reviewSpmsRequest) {
getUser();
if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
IoOrderEntity orderEntity = orderService.findByBillNo(reviewSpmsRequest.getBillNo());
return ResultVOUtils.success(orderEntity);
}
}

@ -33,7 +33,7 @@ public class SpsSyncDownloadStatusController {
RedisUtil redisUtil;
@GetMapping("sps/sync/connect/test")
@GetMapping("/udispsync/sync/testConnection")
public BaseResponse connectTest(SpsSyncDataRequest spsSyncDataRequest) {
return ResultVOUtils.success("连接成功");
}

@ -264,10 +264,10 @@ public class SpsSyncExportStatusController {
CompletableFuture future = CompletableFuture.runAsync(() -> {
switch (req.getExportType()) {
case IO_ORDER:
spsSyncDownloadService.syncOrderTask();
spsSyncDownloadService.syncOrderTask(req.getSyncTime());
break;
case COUNTRY_DI_DATA:
spsSyncDownloadService.syncDiProductsTask();
spsSyncDownloadService.syncDiProductsTask(req.getSyncTime());
break;
default:
spsSyncDownloadService.syncData(syncDataSetEntity, req.getExportType(), req.getSyncTime());

@ -54,8 +54,7 @@ public class SyncDataSetController {
@AuthRuleAnnotation("system/param/syncData/save")
@PostMapping("/system/param/syncData/save")
public BaseResponse save(@RequestBody @Valid SyncDataSetResponse syncDataSetResponse
) {
public BaseResponse save(@RequestBody @Valid SyncDataSetResponse syncDataSetResponse) {
SyncDataSetEntity syncDataSetEntity = new SyncDataSetEntity();
BeanUtils.copyProperties(syncDataSetResponse, syncDataSetEntity);
syncDataSetEntity.setUpdateTime(new Date());

@ -83,7 +83,7 @@ public class UdiProductEntity {
private Date updateTime;
private Integer relSupId;
private Long relSupId;
public Boolean getAllowNoBatch() {

@ -18,7 +18,7 @@ public class UdiRlSupEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
/**
* ID

@ -5,7 +5,7 @@ import lombok.Data;
@Data
public class CompanyProductRelevanceResponse {
private int id;
private Long id;
private Integer rlId;
private String thirdId;
private String thirdName;

@ -5,7 +5,7 @@ import lombok.Data;
@Data
public class UdiRlSupResponse {
private int id;
private Long id;
private Integer rlId;
private String thirdId;
private String thirdName;

@ -1,6 +1,7 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
@ -39,6 +40,8 @@ public class CompanyProductRelevanceServiceImpl extends ServiceImpl<CompanyProdu
@Override
public boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity) {
if (companyProductRelevanceEntity.getId() == null)
companyProductRelevanceEntity.setId(IdUtil.getSnowflakeNextId());
return companyProductRelevanceDao.insertCompanyProductRelevance(companyProductRelevanceEntity);
}

@ -1,6 +1,7 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.UdiProductDao;
@ -98,6 +99,9 @@ public class UdiProductServiceImpl implements UdiProductService {
@Override
public boolean insertUdiInfo(UdiProductEntity udiProductEntity) {
udiProductEntity.setUpdateTime(new Date());
if (udiProductEntity.getId() == null) {
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
}
return udiProductDao.insertUdiInfo(udiProductEntity);
}

@ -3,6 +3,7 @@ package com.glxp.api.service.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
@ -194,6 +195,7 @@ public class IoCheckInoutService {
IoCodeLostEntity codeLostEntity = codeLostService.findByCode(codeEntity.getCode());
if (codeLostEntity == null) {
codeLostEntity = new IoCodeLostEntity();
codeLostEntity.setId(IdUtil.getSnowflakeNextId());
codeLostEntity.setNameCode(udiEntity.getUdi());
codeLostEntity.setCode(codeEntity.getCode());
}

@ -85,7 +85,7 @@ public class SpsSyncDownloadService {
// 创建单据同步任务
public void syncOrderTask() {
public void syncOrderTask(Date lastUpdateTime) {
log.info("创建单据同步任务");
//自动创建要求被下载已完成单据任务.
@ -98,7 +98,11 @@ public class SpsSyncDownloadService {
//首次任务or上次任务结束
if (basicExportStatusEntity1 == null || BasicExportStatusEnum.COMPLETED.getCode().equals(basicExportStatusEntity1.getStatus())) {
BaseResponse<SpsSyncOrderResponse> baseResponse = findOrder(getRequest(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER));
SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER);
if (lastUpdateTime != null)
spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime));
BaseResponse<SpsSyncOrderResponse> baseResponse = findOrder(spsSyncDataRequest);
SpsSyncOrderResponse syncOrderResponse = baseResponse.getData();
// 2.查看是否有需要更新的数据
if (CollUtil.isNotEmpty(syncOrderResponse.getOrderEntities())) {
@ -117,7 +121,7 @@ public class SpsSyncDownloadService {
}
// 创建国家库同步任务
public void syncDiProductsTask() {
public void syncDiProductsTask(Date lastUpdateTime) {
BasicExportStatusEntity exportStatus = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class)
.eq(BasicExportStatusEntity::getType, NEW_ALL_UDIS)
@ -127,8 +131,10 @@ public class SpsSyncDownloadService {
//首次任务or上次任务结束
if (exportStatus == null || BasicExportStatusEnum.COMPLETED.getCode().equals(exportStatus.getStatus())) {
BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS));
SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DI_PRODUCTS);
if (lastUpdateTime != null)
spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime));
BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(spsSyncDataRequest);
SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData();
if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList())
|| CollUtil.isNotEmpty(spSyncUdiResponse.getUdiCompanyEntities())) {

@ -65,7 +65,7 @@ public class AsyncHeartTask implements SchedulingConfigurer {
redisUtil.set("SPS_SYNC_GEN_DATA", lastTime);
}
if (curTime - lastTime > timeInterval) {
spsSyncDownloadService.syncDiProductsTask();
spsSyncDownloadService.syncDiProductsTask(null);
// todo 生成任务都写在这
Arrays.stream(BasicExportTypeEnum.values()).forEach(i -> {
spsSyncDownloadService.syncData(syncDataSetEntity, i, null);
@ -78,8 +78,8 @@ public class AsyncHeartTask implements SchedulingConfigurer {
//定时同步单据最近更新数据至任务表,等待下载
if (syncDataSetEntity.getOrderSyncTime() != null) {
long timeInterval = syncDataSetEntity.getOrderSyncTime() * 6 * 1000;
if (syncDataSetEntity.getOrderToInSyncTime() != null) {
long timeInterval = syncDataSetEntity.getOrderToInSyncTime() * 6 * 1000;
long curTime = System.currentTimeMillis();
Long lastTime = (Long) redisUtil.get("SPS_ORDER_SYNC_GEN_DATA");
if (lastTime == null) {
@ -87,7 +87,7 @@ public class AsyncHeartTask implements SchedulingConfigurer {
redisUtil.set("SPS_ORDER_SYNC_GEN_DATA", lastTime);
}
if (curTime - lastTime > timeInterval) {
spsSyncDownloadService.syncOrderTask();
spsSyncDownloadService.syncOrderTask(null);
redisUtil.set("SPS_ORDER_SYNC_GEN_DATA", curTime);
}
}

@ -60,7 +60,7 @@ public class DateUtil extends DateUtils {
* yyyy-MM-dd HH:mm:ss
*/
public static String formatDateTime(Date date) {
Date currentTime = new Date();
Date currentTime = date;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
return dateString;

@ -1,6 +1,7 @@
package com.glxp.api.util.udi;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.UdiProductEntity;
@ -27,6 +28,9 @@ public class UdiInfoUtil {
public static List<UdiProductEntity> initUdiInfoEntitys(List<UdiProductEntity> udiProductEntities) {
if (CollUtil.isNotEmpty(udiProductEntities)) {
for (UdiProductEntity udiProductEntity : udiProductEntities) {
if (udiProductEntity.getId() == null) {
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
}
udiProductEntity.setUpdateTime(new Date());
udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI);
if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhph()) && "否".equals(udiProductEntity.getScbssfbhph())) {

@ -2,13 +2,13 @@
<!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.CompanyProductRelevanceDao">
<insert id="insertCompanyProductRelevance"
<insert id="insertCompanyProductRelevance" useGeneratedKeys="true"
parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(customerId, productId, enterpriseId, registrationId,
INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price)
values (#{customerId},
values (#{id}, #{customerId},
#{productId},
#{enterpriseId},
#{registrationId},

@ -165,7 +165,7 @@
<insert id="insertUdiInfo" keyProperty="id" parameterType="com.glxp.api.entity.basic.UdiProductEntity">
replace
INTO basic_products
(uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl,
(id, uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl,
zxxsbzbhsydysl, bhxjcpbm, bzcj, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm,
ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, sydycpbs, sjcpbm, versionNumber, diType, ybbm, sptm,
manufactory, measname, productType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, cpms,
@ -173,7 +173,7 @@
allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2,
basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7,
basicPrductRemak8, updateTime)
values (#{uuid},
values (#{id}, #{uuid},
#{originUuid},
#{nameCode},
#{deviceRecordKey},

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inout.IoOrderDetailBizDao">
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderDetailBizResponse">
select io_order_detail_biz.*,
select io_order_detail_biz.*
from io_order_detail_biz
left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
@ -25,10 +25,12 @@
<select id="getfilterList" resultType="com.glxp.api.res.inout.IoOrderDetailBizResponse">
select io_order_detail_biz.*,
(select count(*) FROM io_order_invoice where io_order_invoice.orderIdFk=io_order_detail_biz.orderIdFk) as sucCount
(select count(*)
FROM io_order_invoice
where io_order_invoice.orderIdFk = io_order_detail_biz.orderIdFk) as sucCount
from io_order_detail_biz
left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
@ -47,7 +49,6 @@
</select>
<select id="filterListInv" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
SELECT ic.*,
(select cpmctymc from basic_products where basic_products.uuid = bu.uuid) cpmctymc,
@ -73,7 +74,8 @@
</select>
<select id="selectOrderDetailBiz" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity">
select * from io_order_detail_biz
select *
from io_order_detail_biz
<where>
<if test="orderId != null and orderId != ''">
AND orderIdFk = #{orderId}

@ -22,7 +22,7 @@
, unCheckCert, checkedCert, companyCert, manufacturerCert, productCert, basicDept
, systemConfig
, printConfig, scanChangeConfig, supCert, dbDiCompany, busChangeConfig
, udiCodeLost, udiCodeRel, orderInvoice)
, udiCodeLost, udiCodeRel, orderInvoice, orderToInSyncTime, orderSyncDlTime)
values (#{id},
#{typeBus},
#{typeScan},
@ -51,6 +51,6 @@
#{unCheckCert},
#{checkedCert}, #{companyCert}, #{manufacturerCert}, #{productCert}, #{basicDept},
#{systemConfig}, #{printConfig}, #{scanChangeConfig}, #{supCert}, #{dbDiCompany}, #{busChangeConfig},
#{udiCodeLost}, #{udiCodeRel}, #{orderInvoice})
#{udiCodeLost}, #{udiCodeRel}, #{orderInvoice}, #{orderToInSyncTime}, #{orderSyncDlTime})
</insert>
</mapper>

@ -10,7 +10,7 @@
<insert id="inserts" parameterType="com.glxp.api.entity.sync.SyncDataBustypeEntity">
insert INTO sync_data_bustypes
replace INTO sync_data_bustypes
(id, `action`, `name`, outChange, orderStatus, direct)
values

Loading…
Cancel
Save