中继服务同步,注册码,代码备份,

master
anthonyywj2 3 years ago
parent 2afe0d9c23
commit 0b38bfd616

@ -28,6 +28,7 @@ public class BasicProcessStatus {
public static final int NEW_ALL_DATA = 7;
public static final int NEW_ALL_BUS = 8;
public static final int NEW_ALL_ORDER = 9;
public static final int NEW_ALL_DI = 10;
public static final int SCHEDULE_NORMAL = 1; //常规任务

@ -0,0 +1,69 @@
package com.glxp.sale.admin.controller.auth;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.entity.auth.AuthCheckEntity;
import com.glxp.sale.admin.req.auth.AuthCheckRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.service.auth.AuthCheckService;
import com.glxp.sale.admin.util.RsaUtils;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
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.validation.Valid;
import java.util.List;
@RestController
public class AuthCheckController {
@Resource
private AuthCheckService authCheckService;
@GetMapping("/udiwms/auth/device/filter")
public BaseResponse index(AuthCheckRequest authCheckRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<AuthCheckEntity> authCheckEntityList = authCheckService.filterDevices(authCheckRequest);
PageInfo<AuthCheckEntity> authCheckEntityPageInfo = new PageInfo<>(authCheckEntityList);
PageSimpleResponse<AuthCheckEntity> authAdminResponseList = new PageSimpleResponse<>();
authAdminResponseList.setTotal(authCheckEntityPageInfo.getTotal());
authAdminResponseList.setList(authCheckEntityList);
return ResultVOUtils.success(authAdminResponseList);
}
@PostMapping("/udiwms/auth/device/save")
public BaseResponse save(@RequestBody @Valid AuthCheckEntity authCheckEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String key = null;
try {
key = RsaUtils.publicKeyDecrypt(authCheckEntity.getRegisterCode(), RsaUtils.publicKey);
if (key != null && key.equals(authCheckEntity.getMachineInfo())) {
authCheckService.updateDevices(authCheckEntity);
return ResultVOUtils.success("注册成功!");
} else {
return ResultVOUtils.error(500, "注册失败,注册码不匹配!");
}
} catch (Exception e) {
e.printStackTrace();
}
return ResultVOUtils.error(500, "注册失败!");
}
}

@ -11,6 +11,7 @@ import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.info.DeviceKeyEntity;
import com.glxp.sale.admin.exception.JsonException;
import com.glxp.sale.admin.req.auth.LoginRequest;
import com.glxp.sale.admin.req.auth.PCLoginRequest;
import com.glxp.sale.admin.req.auth.UpdatePasswordRequest;
import com.glxp.sale.admin.res.auth.LoginUserInfoResponse;
import com.glxp.sale.admin.service.auth.AuthAdminService;
@ -18,10 +19,7 @@ import com.glxp.sale.admin.service.auth.AuthLoginService;
import com.glxp.sale.admin.service.auth.CustomerInfoService;
import com.glxp.sale.admin.service.auth.DeviceKeyService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.util.AppUtils;
import com.glxp.sale.admin.util.IpUtils;
import com.glxp.sale.admin.util.JwtUtils;
import com.glxp.sale.admin.util.PasswordUtils;
import com.glxp.sale.admin.util.*;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
@ -132,7 +130,6 @@ public class LoginController {
// 登录成功后获取权限,这里面会设置到缓存
authLoginService.listRuleByAdminId(authAdmin.getId());
Map<String, Object> claims = new HashMap<>();
claims.put("admin_id", authAdmin.getId());
String token = JwtUtils.createToken(claims, 86400L); // 一天后过期86400L
@ -144,6 +141,75 @@ public class LoginController {
return ResultVOUtils.success(map);
}
/**
*
*
* @return
*/
@PostMapping(value = "/pc/login")
public BaseResponse pcLogin(@RequestBody @Valid PCLoginRequest loginRequest,
BindingResult bindingResult,
HttpServletRequest request) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
AuthAdmin authAdmin;
authAdmin = authAdminService.findByUserName(loginRequest.getUsername());
if (authAdmin == null) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
if (authAdmin.getCustomerId() != 110) {
if (authAdmin.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!");
}
if (authAdmin.getUserFlag() == 2) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户未验证!");
}
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(authAdmin.getCustomerId());
if (customerInfoEntity.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该企业账户已被禁用!");
}
} else {
if (authAdmin.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!");
}
if (authAdmin.getUserFlag() == 2) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户未验证!");
}
}
if (authAdmin == null) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(authAdmin.getPassWord())) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
// 更新登录状态
AuthAdmin authAdminUp = new AuthAdmin();
authAdminUp.setId(authAdmin.getId());
authAdminUp.setLastLoginTime(new Date());
authAdminUp.setLastLoginIp(IpUtils.getIpAddr(request));
authAdminService.updateAuthAdmin(authAdminUp);
// 登录成功后获取权限,这里面会设置到缓存
authLoginService.listRuleByAdminId(authAdmin.getId());
Map<String, Object> claims = new HashMap<>();
claims.put("admin_id", authAdmin.getId());
String token = JwtUtils.createToken(claims, 86400L); // 一天后过期
Map<String, Object> map = new HashMap<>();
map.put("id", authAdmin.getId());
map.put("token", token);
map.put("time", DateUtil.getDateTime());
return ResultVOUtils.success(map);
}
/**
*
*

@ -7,6 +7,7 @@ import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.sale.admin.req.basic.FilterBasicThirdSysDetailRequest;
import com.glxp.sale.admin.req.basic.FilterBasicThirdSysRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.BasicThirdSysResponse;
import com.glxp.sale.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.sale.admin.service.basic.BasicThirdSysService;
import com.glxp.sale.admin.service.basic.BasicUnitMaintainService;
@ -15,6 +16,7 @@ import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class BasicThirdSysController {
@ -171,4 +174,25 @@ public class BasicThirdSysController {
}
return ResultVOUtils.success("更新成功");
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/basic/thirdsys/get")
public BaseResponse get(FilterBasicThirdSysRequest filterBasicThirdSysRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicThirdSysEntity> basicThirdSysEntities;
basicThirdSysEntities = basicThirdSysService.filterBasicThiSys(filterBasicThirdSysRequest);
List<BasicThirdSysResponse> basicThirdSysResponses = basicThirdSysEntities.stream().map(item ->
{
BasicThirdSysResponse basicThirdSysResponse = new BasicThirdSysResponse();
BeanUtils.copyProperties(item, basicThirdSysResponse);
return basicThirdSysResponse;
}).collect(Collectors.toList());
basicThirdSysResponses.add(new BasicThirdSysResponse("ybbm", "医保编码"));
basicThirdSysResponses.add(new BasicThirdSysResponse("sptm", "商品条码"));
basicThirdSysResponses.add(new BasicThirdSysResponse("udiCode", "UDI最小销售标识"));
return ResultVOUtils.success(basicThirdSysResponses);
}
}

@ -143,7 +143,7 @@ public class BasicUnitMaintainController {
return ResultVOUtils.success("修改成功");
}
@AuthRuleAnnotation("")
// @AuthRuleAnnotation("")
@GetMapping("/udiwms/unit/download")
public BaseResponse downloadBasicUnit(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
BindingResult bindingResult) {
@ -170,6 +170,33 @@ public class BasicUnitMaintainController {
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/basic/unit/download")
public BaseResponse scdownloadBasicUnit(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
basicUnitMaintainFilterRequest.setOutType(ConstantStatus.CORP_SICK_SICK);
List<BasicUnitMaintainEntity> basicUnitMaintainEntities;
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
List<BasicUnitMaintainResponse> basicUnitMaintainResponses = basicUnitMaintainEntities.stream().map(item ->
{
BasicUnitMaintainResponse basicUnitMaintainResponse = new BasicUnitMaintainResponse();
BeanUtils.copyProperties(item, basicUnitMaintainResponse);
basicUnitMaintainResponse.setUnitId(item.getErpId());
return basicUnitMaintainResponse;
}).collect(Collectors.toList());
PageInfo<BasicUnitMaintainResponse> pageInfo;
pageInfo = new PageInfo<>(basicUnitMaintainResponses);
PageSimpleResponse<BasicUnitMaintainResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(basicUnitMaintainResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/combine")
public BaseResponse combine(@RequestBody CombineUnitRequest combineRequest, BindingResult bindingResult) {

@ -27,6 +27,7 @@ import com.glxp.sale.admin.util.FileUtils;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
@ -38,6 +39,7 @@ import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -115,6 +117,33 @@ public class BussinessTypeController {
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/bussinessType/download")
public BaseResponse downloadJoinBussinessType(BussinessTypeFilterRequest bussinessTypeFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String customerId = getCustomerId();
if (!customerId.equals(Constant.SYSTEM_CUSTOMER_ID)) {
bussinessTypeFilterRequest.setSpUse(true);
} else {
bussinessTypeFilterRequest.setUserId(customerService.getUserId());
}
List<BussinessTypeEntity> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterAllByUser(bussinessTypeFilterRequest);
PageInfo<BussinessTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/bussinessType/filterAllByUser")
public BaseResponse filterAllByUser(BussinessTypeFilterRequest bussinessTypeFilterRequest,

@ -10,6 +10,7 @@ import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
import com.glxp.sale.admin.entity.thrsys.*;
import com.glxp.sale.admin.req.basic.*;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
@ -17,6 +18,7 @@ import com.glxp.sale.admin.req.inout.OrderFilterRequest;
import com.glxp.sale.admin.req.inventory.FilterInvWarehouseRequest;
import com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest;
import com.glxp.sale.admin.req.thrsys.*;
import com.glxp.sale.admin.res.basic.SpSyncUdiResponse;
import com.glxp.sale.admin.res.basic.SpsSyncBusResponse;
import com.glxp.sale.admin.res.basic.SpsSyncDataResponse;
import com.glxp.sale.admin.res.basic.SpsSyncOrderResponse;
@ -28,6 +30,7 @@ import com.glxp.sale.admin.service.inout.CodesService;
import com.glxp.sale.admin.service.inout.OrderDetailService;
import com.glxp.sale.admin.service.inout.OrderService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.receipt.ProductInfoService;
import com.glxp.sale.admin.service.thrsys.*;
import com.glxp.sale.admin.util.BeanUtils;
import com.glxp.sale.common.res.BaseResponse;
@ -155,13 +158,13 @@ public class SpsSyncDownloadController {
@GetMapping("sps/sync/busType")
public BaseResponse findBusType(SpsSyncDataRequest spsSyncDataRequest) {
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest,bussinessTypeFilterRequest);
BeanUtils.copyProperties(spsSyncDataRequest, bussinessTypeFilterRequest);
List<BussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest);
BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest,bussinessLocalTypeFilterRequest);
BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest);
List<BussinessLocalTypeEntity> bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest);
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest,bussinessOriginTypeFilterRequest);
BeanUtils.copyProperties(spsSyncDataRequest, bussinessOriginTypeFilterRequest);
List<BussinessOriginTypeEntity> bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest);
SpsSyncBusResponse spsSyncBusResponse = new SpsSyncBusResponse();
spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities);
@ -208,5 +211,27 @@ public class SpsSyncDownloadController {
syncOrderResponse.setWarehouseEntityList(warehouseEntityList);
return ResultVOUtils.success(syncOrderResponse);
}
@Resource
ProductInfoService productInfoService;
@Resource
UdiCompanyService udiCompanyService;
//udi同步数据
@GetMapping("sps/sync/syncUdis")
public BaseResponse syncUdi(SpsSyncDataRequest spsSyncDataRequest) {
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<ProductInfoEntity> productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest);
UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
SpSyncUdiResponse spSyncUdiResponse = new SpSyncUdiResponse();
spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities);
spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList);
return ResultVOUtils.success(spSyncUdiResponse);
}
}

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.dao.basic.*;
import com.glxp.sale.admin.dao.info.CompanyProductRelevanceDao;
import com.glxp.sale.admin.dao.inout.CodesDao;
@ -32,6 +33,7 @@ import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.inout.OrderService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.thrsys.*;
import com.glxp.sale.admin.thread.BasicBackUpdateProductService;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.apache.ibatis.session.ExecutorType;
@ -56,6 +58,8 @@ public class SpsSyncUploadController {
InvWarehouseService invWarehouseService;
@Resource
OrderService orderService;
@Resource
BasicBackUpdateProductService backUpdateProductService;
@PostMapping("sps/sync/basic/upload")
public BaseResponse findProductInfo(@RequestBody SpsSyncDataResponse syncDataResponse) {
@ -87,6 +91,12 @@ public class SpsSyncUploadController {
public BaseResponse dealSchedule(@RequestBody BasicExportStatusEntity basicExportStatusEntity) {
//todo
//处理下游上传过来的任务
if (basicExportStatusEntity.getScheduleType() == BasicProcessStatus.SCHEDULE_TRANSFER) {
if (basicExportStatusEntity.getId().equals("AsyncUpdateAllData")) {
backUpdateProductService.syncUpdatetTime();
}
}
return ResultVOUtils.success("上传成功!");
}

@ -1,6 +1,7 @@
package com.glxp.sale.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
import com.glxp.sale.admin.req.basic.UdiCompanyRequest;
@ -29,6 +30,16 @@ public class UdiCompanyController {
@Resource
ProductInfoService productInfoService;
//出入库同步下载
@GetMapping("udidl/udiwms/syncCompany")
public BaseResponse syncCompany(UdiCompanyRequest udiCompanyRequest) {
List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
return ResultVOUtils.success(udiCompanyEntities);
}
@GetMapping("udi/company/filter")
public BaseResponse filterCompany(@Valid UdiCompanyRequest udiCompanyRequest, BindingResult bindingResult) {

@ -11,6 +11,7 @@ import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.sale.admin.entity.basic.FilterSysEntity;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
@ -28,6 +29,7 @@ import com.glxp.sale.admin.service.basic.BasicThirdSysService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.CodesService;
import com.glxp.sale.admin.service.inventory.InvPreProductService;
import com.glxp.sale.admin.service.inventory.InvProductService;
@ -50,6 +52,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -80,7 +83,8 @@ public class UdiRelevanceController {
InvProductService invProductService;
@Resource
InvPreProductService invPreProductService;
@Resource
CompanyService companyService;
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
@Resource
@ -118,7 +122,7 @@ public class UdiRelevanceController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<UdiRelevanceResponse> udiRelevanceResponses = null;
udiRelevanceResponses = udiRelevanceService.selectAllByNameCode(filterUdiInfoRequest.getNameCode(),filterUdiInfoRequest.getUnitFk());
udiRelevanceResponses = udiRelevanceService.selectAllByNameCode(filterUdiInfoRequest.getNameCode(), filterUdiInfoRequest.getUnitFk());
PageInfo<UdiRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(udiRelevanceResponses);
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
@ -293,7 +297,7 @@ public class UdiRelevanceController {
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/revleance")
public BaseResponse revleanceUdi(@RequestBody CombineRequest combineRequest) {
combineRequest.setCustomerId(customerService.getCustomerId());
List<String> keys = combineRequest.getKeys();
if (keys != null && keys.size() > 0) {
for (String key : keys) {
@ -305,18 +309,38 @@ public class UdiRelevanceController {
if (udiInfoEntities == null || udiInfoEntities.isEmpty()) {
udiInfoEntities = udiDlHttpClient.getUdiByUuid(key);
if (udiInfoEntities != null && !udiInfoEntities.isEmpty()) {
// for (UdiInfoEntity infoEntity : udiInfoEntities) {
// infoEntity.setManufactory(udiInfoEntity.getManufactory());
// }
udiInfoService.insertUdiInfos(udiInfoEntities);
if (combineRequest.getManufactory() != null) {
udiRelevanceEntity.setManufactory(combineRequest.getManufactory());
} else
udiRelevanceEntity.setManufactory(udiInfoEntities.get(0).getYlqxzcrbarmc());
} else {
return ResultVOUtils.error(500, "连接UDI数据下载服务出错");
}
}
if (combineRequest.getManufactory() != null) {
udiRelevanceEntity.setManufactory(combineRequest.getManufactory());
} else
udiRelevanceEntity.setManufactory(udiInfoEntities.get(0).getYlqxzcrbarmc());
if (combineRequest.isIdSpliUdi()) {
udiRelevanceEntity.setThirdId(combineRequest.getThirdId());
udiRelevanceEntity.setThirdName(combineRequest.getErpName());
udiRelevanceEntity.setMainId(combineRequest.getThirdId());
udiRelevanceEntity.setMainName(combineRequest.getErpName());
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());
udiRelevanceEntity.setUuid(key);
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity);
udiRelevanceEntity = udiRelevanceService.selectUpteaByAll(udiRelevanceEntity.getUuid(), udiRelevanceEntity.getThirdId());
CompanyEntity companyEntity = companyService.findCompany(combineRequest.getCustomerId());
CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
companyProductRelevanceEntity.setCreate_time(new Date());
companyProductRelevanceEntity.setUpdate_time(new Date());
companyProductRelevanceEntity.setAuditStatus("3");
companyProductRelevanceEntity.setUnitFk(companyEntity.getUnitIdFk());
companyProductRelevanceEntity.setUdiRlIdFk(Integer.parseInt(udiRelevanceEntity.getId()));
companyProductRelevanceEntity.setCustomerId(companyEntity.getCustomerId());
boolean b = companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
return ResultVOUtils.success("拆分成功!");
}
if (combineRequest.getRelId() != null && !combineRequest.getRelId().equals("")) {
//修改
//判断DI是否被使用若使用则新增一条
@ -375,10 +399,10 @@ public class UdiRelevanceController {
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());
udiRelevanceEntity.setUuid(key);
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity);
} else {
return ResultVOUtils.error(500, "重复关联!");
}
}

@ -231,6 +231,9 @@ public class OrderController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
Integer userId = customerService.getUserId();
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderFilterRequest.getAction());
StockOrderEntity stockOrderEntity = stockOrderService.findByBillNo(orderFilterRequest.getOrderId());
if (stockOrderEntity == null || stockOrderEntity.getOrderIdFk() == null) {

@ -569,7 +569,7 @@ public class StockOrderDetailController {
*/
@AuthRuleAnnotation("")
@PostMapping("/udiwms/stock/order/detail/update")
public BaseResponse updateStockOrderDetail(StockOrderDetailEntity stockOrderDetailEntity) {
public BaseResponse updateStockOrderDetail(@RequestBody StockOrderDetailEntity stockOrderDetailEntity) {
if (null != stockOrderDetailEntity)
stockOrderDetailService.updateById(stockOrderDetailEntity);
return ResultVOUtils.success("更新成功");

@ -15,6 +15,7 @@ import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.inout.WarehouseUserEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.exception.JsonException;
@ -660,15 +661,11 @@ public class WareHouseController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
try {
AuthAdmin authAdmin = customerService.getUserBeanByKey();
String customerId = customerService.getUserBeanByKey();
postOrderRequest.setCustomerId(authAdmin.getCustomerId() + "");
postOrderRequest.setUserId(authAdmin.getId().intValue());
ioTransInoutService.createOrderUdims(postOrderRequest);
} catch (Exception e) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
postOrderRequest.setCustomerId(customerId);
// postOrderRequest.setUserId(authAdmin.getId().intValue());
ioTransInoutService.createOrderUdims(postOrderRequest);
return ResultVOUtils.success("导入成功");
}
@ -776,10 +773,10 @@ public class WareHouseController {
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/updateDirector")
public BaseResponse updateDirector(Integer id) {
if (null == id)
public BaseResponse updateDirector(WarehouseUserEntity warehouseUserEntity) {
if (warehouseUserEntity == null)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
warehouseUserService.updateDirector(id);
warehouseUserService.updateDirector(warehouseUserEntity);
return ResultVOUtils.success();
}

@ -293,17 +293,25 @@ public class InvProductsController {
return ResultVOUtils.success();
}
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterCodeTraceRequest.getCode());
if (udiEntity == null) {
return ResultVOUtils.error(500, "无效条码");
}
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if (udiInfoBean == null) {
return ResultVOUtils.error(500, "耗材字典不存在此产品!");
}
List<UdiInfoEntity> udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid());
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// String code = null;
// if (udiInfoEntities != null && udiInfoEntities.size() > 1) {
// code = FilterUdiUtils.transGlxpNoSerStr(udiEntity);
// } else {
// code = filterCodeTraceRequest.getCode();
// }
if (udiInfoEntities != null && udiInfoEntities.size() > 1) {
filterInvProductDetailRequest.setProductIdFk(udiInfoBean.getId() + "");
filterInvProductDetailRequest.setBatchNo(udiEntity.getBatchNo());
} else {
filterInvProductDetailRequest.setOriginCode(filterCodeTraceRequest.getCode());
}
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(filterCodeTraceRequest.getCode());
filterInvProductDetailRequest.setSupId(filterCodeTraceRequest.getSupId());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
if (invProductDetailEntities.size() > 0) {

@ -0,0 +1,21 @@
package com.glxp.sale.admin.dao.auth;
import com.glxp.sale.admin.entity.auth.AuthCheckEntity;
import com.glxp.sale.admin.req.auth.AuthCheckRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AuthCheckDao {
List<AuthCheckEntity> filterDevices(AuthCheckRequest authCheckRequest);
AuthCheckEntity findByMachine(String machineInfo);
boolean insertDevices(AuthCheckEntity authCheckEntity);
boolean updateDevices(AuthCheckEntity authCheckEntity);
}

@ -25,6 +25,8 @@ public interface AuthLicenseDao {
*/
AuthLicense selectLicenseByName(@Param("name") String name);
AuthLicense selectLicenseBykey(@Param("apikey") String apikey);
/**
*
*

@ -27,5 +27,6 @@ public interface UdiCompanyDao {
boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity);
List<UdiCompanyEntity> syncDlCompany(UdiCompanyRequest udiCompanyRequest);
}

@ -0,0 +1,14 @@
package com.glxp.sale.admin.entity.auth;
import lombok.Data;
import java.util.Date;
@Data
public class AuthCheckEntity {
private Integer id;
private String machineInfo;
private String remark;
private String registerCode;
private Date createDate;
}

@ -0,0 +1,13 @@
package com.glxp.sale.admin.req.auth;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class AuthCheckRequest extends ListPageRequest {
private Integer id;
private String machineInfo;
private String registerCode;
}

@ -0,0 +1,19 @@
package com.glxp.sale.admin.req.auth;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
@Data
public class PCLoginRequest {
@NotEmpty(message = "用户名不能为空")
private String username;
@NotEmpty(message = "密码不能为空")
private String password;
// @NotEmpty(message = "机器码不能为空")
private String machineInfo;
}

@ -14,4 +14,5 @@ public class BussinessOriginTypeFilterRequest extends ListPageRequest {
private String mainAction;
private String localAction;
private String lastUpdateTime;
private Integer corpType;
}

@ -21,4 +21,5 @@ public class CombineRequest {
private Long customerId;
private Boolean supEnable;
private String manufactory;
private boolean idSpliUdi;
}

@ -11,5 +11,5 @@ public class UdiCompanyRequest extends ListPageRequest {
private String provinceCode;
private String cityCode;
private String areaCode;
private String updateTime;
}

@ -0,0 +1,14 @@
package com.glxp.sale.admin.res.basic;
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
import lombok.Data;
import java.util.List;
@Data
public class SpSyncUdiResponse {
List<ProductInfoEntity> productInfoEntityList;
List<UdiCompanyEntity> udiCompanyEntities;
}

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

@ -18,7 +18,6 @@ public interface AuthAdminService {
AuthAdmin findById(Long id);
AuthAdmin findPwdById(Long id);
boolean insertAuthAdmin(AuthAdmin authAdmin);

@ -0,0 +1,18 @@
package com.glxp.sale.admin.service.auth;
import com.glxp.sale.admin.entity.auth.AuthCheckEntity;
import com.glxp.sale.admin.req.auth.AuthCheckRequest;
import java.util.List;
public interface AuthCheckService {
AuthCheckEntity findByMachine(String machineInfo);
List<AuthCheckEntity> filterDevices(AuthCheckRequest authCheckRequest);
boolean insertDevices(AuthCheckEntity authCheckEntity);
boolean updateDevices(AuthCheckEntity authCheckEntity);
}

@ -43,25 +43,20 @@ public class CustomerService {
}
public long getCustomerIdByKey() {
AuthAdmin authAdmin = getUserBeanByKey();
return authAdmin.getCustomerId();
}
public Integer getUserIdByKey() {
public String getUserIdByKey() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String userId = request.getHeader("api_key");
return Integer.parseInt(userId);
return userId;
}
public AuthAdmin getUserBeanByKey() {
Integer userId = getUserIdByKey();
AuthAdmin authAdmin = authAdminService.findById(userId.longValue());
return authAdmin;
public String getUserBeanByKey() {
String userId = getUserIdByKey();
AuthLicense authAdmin = authLicenseDao.selectLicenseBykey(userId);
return authAdmin.getCustomerId();
}
}

@ -0,0 +1,45 @@
package com.glxp.sale.admin.service.auth.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.auth.AuthCheckDao;
import com.glxp.sale.admin.entity.auth.AuthCheckEntity;
import com.glxp.sale.admin.req.auth.AuthCheckRequest;
import com.glxp.sale.admin.service.auth.AuthCheckService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class AuthCheckServiceImpl implements AuthCheckService {
@Resource
private AuthCheckDao authCheckDao;
@Override
public AuthCheckEntity findByMachine(String machineInfo) {
return authCheckDao.findByMachine(machineInfo);
}
@Override
public List<AuthCheckEntity> filterDevices(AuthCheckRequest authCheckRequest) {
if (authCheckRequest == null) {
return Collections.emptyList();
}
if (authCheckRequest.getPage() != null) {
int offset = (authCheckRequest.getPage() - 1) * authCheckRequest.getLimit();
PageHelper.offsetPage(offset, authCheckRequest.getLimit());
}
return authCheckDao.filterDevices(authCheckRequest);
}
@Override
public boolean insertDevices(AuthCheckEntity authCheckEntity) {
return authCheckDao.insertDevices(authCheckEntity);
}
@Override
public boolean updateDevices(AuthCheckEntity authCheckEntity) {
return authCheckDao.updateDevices(authCheckEntity);
}
}

@ -11,6 +11,8 @@ public interface UdiCompanyService {
List<UdiCompanyEntity> selectAllTyshxyh();
List<UdiCompanyEntity> syncDlCompany(UdiCompanyRequest udiCompanyRequest);
List<Contactlist> selectContactBykey(String deviceRecordKey);
List<UdiCompanyEntity> filterUdiCompany(UdiCompanyRequest udiCompanyRequest);

@ -22,6 +22,13 @@ public class UdiCompanyServiceImpl implements UdiCompanyService {
return udiCompanyDao.selectAllTyshxyh();
}
@Override
public List<UdiCompanyEntity> syncDlCompany(UdiCompanyRequest udiCompanyRequest) {
int offset = (udiCompanyRequest.getPage() - 1) * udiCompanyRequest.getLimit() + 1;
udiCompanyRequest.setPage(offset);
return udiCompanyDao.syncDlCompany(udiCompanyRequest);
}
@Override
public List<Contactlist> selectContactBykey(String deviceRecordKey) {
return udiCompanyDao.selectContactBykey(deviceRecordKey);

@ -36,6 +36,8 @@ public interface WarehouseUserService {
*/
void updateDirector(Integer id);
void updateDirector(WarehouseUserEntity warehouseUserEntity);
/**
*
*

@ -71,6 +71,15 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
}
}
@Override
public void updateDirector(WarehouseUserEntity warehouseUserEntity) {
int value = 0;
if (warehouseUserEntity.isDirector()) {
value = 1;
}
warehouseUserDao.updateDirectorById(warehouseUserEntity.getId(), value);
}
@Override
public void deleteWarehouseUser(Integer id) {
if (null != id) {

@ -35,6 +35,8 @@ public class AsyncHeartTask implements SchedulingConfigurer {
RedisUtil redisUtil;
@Resource
BasicExportService basicExportService;
@Resource
BasicBackUpdateProductService backUpdateProductService;
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
@ -70,51 +72,7 @@ public class AsyncHeartTask implements SchedulingConfigurer {
}
if (curTime - lastTime > timeInterval) {
//自动创建要求被下载已完成单据任务
BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0);
if (basicExportStatusEntity1 == null) {
BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity();
orderStatusEntity.setId(CustomUtil.getId());
orderStatusEntity.setIdDatas("AutoDownloadOrder");
orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(0);
orderStatusEntity.setStartTime(new Date());
orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(orderStatusEntity);
}
//自动创建要求被下载单据类型任务
BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0);
if (basicExportStatusEntity2 == null) {
BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity();
busTypetatusEntity.setId(CustomUtil.getId());
busTypetatusEntity.setIdDatas("AutoDownloadBusType");
busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS);
busTypetatusEntity.setUpdateTime(new Date());
busTypetatusEntity.setStatus(0);
busTypetatusEntity.setStartTime(new Date());
busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(busTypetatusEntity);
}
//自动创建要求被下载基础信息任务
BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0);
if (basicExportStatusEntity3 == null) {
BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity();
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setIdDatas("AutoDownloadAllData");
basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA);
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setStatus(0);
basicExportStatusEntity.setStartTime(new Date());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
}
backUpdateProductService.syncUpdatetTime();
redisUtil.set("SPS_SYNC_GEN_DATA", curTime);
}

@ -1,6 +1,8 @@
package com.glxp.sale.admin.thread;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity;
@ -11,6 +13,7 @@ import com.glxp.sale.admin.req.basic.FilterErpGoodsRequest;
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.ErpProductsResponse;
import com.glxp.sale.admin.service.basic.BasicExportService;
import com.glxp.sale.admin.service.basic.BasicThirdSysService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
@ -25,10 +28,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class BasicBackUpdateProductService {
@ -44,7 +44,8 @@ public class BasicBackUpdateProductService {
BasicThirdSysService basicThirdSysService;
@Resource
private ErpBasicClient erpBasicClient;
@Resource
BasicExportService basicExportService;
@Resource
RedisUtil redisUtil;
@ -246,7 +247,67 @@ public class BasicBackUpdateProductService {
}
}
redisUtil.set("load_thrid_basic", "finish", 15 * 60);
}
public void syncUpdatetTime() {
//自动创建要求被下载已完成单据任务
BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0);
if (basicExportStatusEntity1 == null) {
BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity();
orderStatusEntity.setId(CustomUtil.getId());
orderStatusEntity.setIdDatas("AutoDownloadOrder");
orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(0);
orderStatusEntity.setStartTime(new Date());
orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(orderStatusEntity);
}
//自动创建要求被下载单据类型任务
BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0);
if (basicExportStatusEntity2 == null) {
BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity();
busTypetatusEntity.setId(CustomUtil.getId());
busTypetatusEntity.setIdDatas("AutoDownloadBusType");
busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS);
busTypetatusEntity.setUpdateTime(new Date());
busTypetatusEntity.setStatus(0);
busTypetatusEntity.setStartTime(new Date());
busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(busTypetatusEntity);
}
//自动创建要求被下载基础信息任务
BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0);
if (basicExportStatusEntity3 == null) {
BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity();
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setIdDatas("AutoDownloadAllData");
basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA);
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setStatus(0);
basicExportStatusEntity.setStartTime(new Date());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
}
//自动创建要求被下载同步库DI信息
BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData("AutoDownloadDiProducts", 0);
if (basicExportStatusEntity4 == null) {
BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity();
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setIdDatas("AutoDownloadDiProducts");
basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI);
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setStatus(0);
basicExportStatusEntity.setStartTime(new Date());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
}
}

@ -232,68 +232,75 @@ public class InvProductsTrService {
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> inList = new ArrayList<>();
List<WarehouseEntity> preiInList = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntities) {
/**
*
* if1=1
* {}
* else>1
* {}
*/
InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode());
if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入
//获取当前条码实际数量
int actCount = getActCount(warehouseEntity);
int count = 0;
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
count = actCount * warehouseEntity.getCount();
//缺量补单时是否全量补单
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all");
if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) {
for (WarehouseEntity warehouseEntity : warehouseEntities) {
inList.add(warehouseEntity);
}
} else {
for (WarehouseEntity warehouseEntity : warehouseEntities) {
/**
*
* 1=
*
* if1=1
* {}
* else>1
* {}
*/
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(advChangeTypeEntity.getScAction());
InvWarehouseEntity invWarehouseEntity;
if (!StrUtil.isEmpty(bussinessTypeEntity.getStorageCode())) {
invWarehouseEntity = invWarehouseService.selectByCode(bussinessTypeEntity.getStorageCode());
if (!invWarehouseEntity.getAdvanceType() || invWarehouseEntity.getLevel() > 1) {
//todo 补单失败,当前仓库设置错误
orderEntity.setRemark("该补录单,单据类型" + bussinessTypeEntity.getName() + "当前仓库设置错误,无法补单");
orderEntity.setError(true);
}
} else
invWarehouseEntity = invWarehouseService.findDefault(true, true);
InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode());
if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入
int invCount = getCountByOrder(null, warehouseEntity);
warehouseEntity.setFromCorpId(invWarehouseEntity.getCode());
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
if (invCount > 0) {//仓库已存在该产品
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
preiInList.add(warehouseEntity);
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
int lea = count - invCount;
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
preiInList.add(warehouseEntity);
//获取当前条码实际数量
int actCount = getActCount(warehouseEntity);
int count = 0;
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
count = actCount * warehouseEntity.getCount();
/**
*
* 1=
*/
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(advChangeTypeEntity.getScAction());
InvWarehouseEntity invWarehouseEntity;
if (!StrUtil.isEmpty(bussinessTypeEntity.getStorageCode())) {
invWarehouseEntity = invWarehouseService.selectByCode(bussinessTypeEntity.getStorageCode());
if (!invWarehouseEntity.getAdvanceType() || invWarehouseEntity.getLevel() > 1) {
//todo 补单失败,当前仓库设置错误
orderEntity.setRemark("该补录单,单据类型" + bussinessTypeEntity.getName() + "当前仓库设置错误,无法补单");
orderEntity.setError(true);
}
}
} else { //结余数量《=0直接补
} else
invWarehouseEntity = invWarehouseService.findDefault(true, true);
int invCount = getCountByOrder(null, warehouseEntity);
warehouseEntity.setFromCorpId(invWarehouseEntity.getCode());
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
if (invCount > 0) {//仓库已存在该产品
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
preiInList.add(warehouseEntity);
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
int lea = count - invCount;
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
preiInList.add(warehouseEntity);
}
}
} else { //结余数量《=0直接补
// warehouseEntity.setCount(count);
preiInList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(false, invProductDetailEntity);
warehouseEntity.setCode(code);
preiInList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(false, invProductDetailEntity);
warehouseEntity.setCode(code);
} else {
int actCount = getActCount(warehouseEntity);
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
int count = actCount * warehouseEntity.getCount();
} else {
int actCount = getActCount(warehouseEntity);
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
int count = actCount * warehouseEntity.getCount();
// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
// warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
@ -303,53 +310,53 @@ public class InvProductsTrService {
// count = warehouseEntity.getCount();
// }
int invCount = 0;
if (locWarehouseEntity.getLevel() > 1) {//补调拨入库
/**
*
*/
InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode());
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode());
int invCount = 0;
if (locWarehouseEntity.getLevel() > 1) {//补调拨入库
/**
*
*/
InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode());
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode());
invCount = getCountByOrder(null, warehouseEntity);
invCount = getCountByOrder(null, warehouseEntity);
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
// if (invCount <= 0) {
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
// }
norChangeTypeEntity = innorChangeTypeEntity;
} else { //补供应商入库
/**
*
*/
//供应商
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName());
invCount = getCountByOrder(null, warehouseEntity);
norChangeTypeEntity = innorChangeTypeEntity;
} else { //补供应商入库
/**
*
*/
//供应商
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName());
invCount = getCountByOrder(null, warehouseEntity);
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), null);
// if (invCount <= 0) {
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), null);
// }
norChangeTypeEntity = outChangeTypeEntity;
}
norChangeTypeEntity = outChangeTypeEntity;
}
if (invCount > 0) {//仓库已存在该产品
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
inList.add(warehouseEntity);
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
int lea = count - invCount;
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
inList.add(warehouseEntity);
if (invCount > 0) {//仓库已存在该产品
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
inList.add(warehouseEntity);
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
int lea = count - invCount;
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
inList.add(warehouseEntity);
}
}
}
} else { //结余数量《=0直接补
} else { //结余数量《=0直接补
// warehouseEntity.setCount(count);
inList.add(warehouseEntity);
}
inList.add(warehouseEntity);
}
// if (invCount > 0) {
// if (count > invCount) {
// int lea = count - invCount;
@ -360,13 +367,15 @@ public class InvProductsTrService {
// warehouseEntity.setCount(count);
// inList.add(warehouseEntity);
// }
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(false, invProductDetailEntity);
warehouseEntity.setCode(code);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(false, invProductDetailEntity);
warehouseEntity.setCode(code);
}
}
}
if (inList.size() > 0) {
List<WarehouseEntity> temps = filterMapCodes(inList);
buildInOrder(norChangeTypeEntity, temps, orderEntity); //3.生成采购入库流转单据
@ -379,45 +388,6 @@ public class InvProductsTrService {
}
// public List<WarehouseEntity> addOutOrder(OrderEntity
// orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
// List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
// List<WarehouseEntity> inList = new ArrayList<>();
// for (WarehouseEntity warehouseEntity : warehouseEntities) {
// //获取普通出入库结余数量
// int actCount = getActCount(warehouseEntity);
// int count = 0;
// UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
// String code = warehouseEntity.getCode();
// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
// warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
// code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
// count = actCount * warehouseEntity.getCount();
// } else {
// count = warehouseEntity.getCount();
// }
// int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
// if (invCount <= 0) {
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId());
// }
// if (invCount > 0) {
// if (count > invCount) {
// int lea = count - invCount;
// warehouseEntity.setCount(lea / actCount);
// inList.add(warehouseEntity);
// }
// } else {
// warehouseEntity.setCount(count);
// inList.add(warehouseEntity);
// }
// InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
// insetInvSingle(false, invProductDetailEntity);
// warehouseEntity.setCode(code);
// }
// return inList;
// }
//普通入库补单
public List<WarehouseEntity> addPutOrder(OrderEntity
orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
@ -440,11 +410,18 @@ public class InvProductsTrService {
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> prePutList = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntities) {
int actCount = getActCount(warehouseEntity);
int count = actCount * warehouseEntity.getCount();
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all");
if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) {
for (WarehouseEntity warehouseEntity : warehouseEntities) {
prePutList.add(warehouseEntity);
}
} else {
for (WarehouseEntity warehouseEntity : warehouseEntities) {
int actCount = getActCount(warehouseEntity);
int count = actCount * warehouseEntity.getCount();
// String code = warehouseEntity.getCode();
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
// warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
@ -453,26 +430,29 @@ public class InvProductsTrService {
// } else {
// count = warehouseEntity.getCount();
// }
//获取寄售出入库结余数量
int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
if (invCount > 0) {//仓库已存在该产品
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
prePutList.add(warehouseEntity);
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
int lea = count - invCount;
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
prePutList.add(warehouseEntity);
//获取寄售出入库结余数量
int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
if (invCount > 0) {//仓库已存在该产品
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
prePutList.add(warehouseEntity);
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
int lea = count - invCount;
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
prePutList.add(warehouseEntity);
}
}
}
} else { //结余数量《=0直接补
} else { //结余数量《=0直接补
// warehouseEntity.setCount(count);
prePutList.add(warehouseEntity);
prePutList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(true, invProductDetailEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(true, invProductDetailEntity);
}
return prePutList;
}
@ -516,7 +496,7 @@ public class InvProductsTrService {
outOrder.setErpFk(null);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setId("SM" + CustomUtil.getId());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
@ -586,7 +566,7 @@ public class InvProductsTrService {
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
outOrder.setFromCorpId(corpName);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderEntity.setUpdateTime(new Date());
@ -691,7 +671,7 @@ public class InvProductsTrService {
outOrder.setId("SM" + CustomUtil.getId());
outOrder.setFromCorpId(corpName);
outOrder.setFromCorp(temps.get(0).getFromCorp());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
@ -764,7 +744,7 @@ public class InvProductsTrService {
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setFromCorp(temps.get(0).getFromCorp());
outOrder.setFromCorpId(temps.get(0).getFromCorpId());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setErpFk(null);
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
@ -803,7 +783,6 @@ public class InvProductsTrService {
}
//生成库存
private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity
orderEntity, WarehouseEntity warehouseEntity) {

@ -263,6 +263,11 @@ public class IoTransInoutService {
orderEntity.setExportStatus(ConstantStatus.ORDER_EXPORT_UN);
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderEntity.setSignStatus(ConstantStatus.ORDER_SIGN_UN);
orderEntity.setCustomerId(postUdimsOrderRequest.getCustomerId());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
orderEntity.setLocStorageCode(invWarehouseEntity.getCode());
orderEntity.setInvStorageCode(invWarehouseEntity.getCode());
orderEntity.setUpdateTime(new Date());
orderService.insertOrder(orderEntity);
List<PostUdimsOrderRequest.OrderBean.CodeBean> codeBeans = orderBean.getCodes();
List<WarehouseEntity> warehouseEntities = new ArrayList<>();
@ -273,8 +278,10 @@ public class IoTransInoutService {
warehouseEntity.setFromCorpId(companyEntity.getUnitIdFk());
warehouseEntity.setMainAction(orderEntity.getMainAction());
warehouseEntity.setAction(orderEntity.getAction());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
warehouseEntity.setLocStorageCode(invWarehouseEntity.getCode());
warehouseEntity.setInvStorageCode(invWarehouseEntity.getCode());
warehouseEntity.setSupId(orderEntity.getFromCorpId());
warehouseEntity.setRelId(null);
warehouseEntity.setOrderId(orderId);
warehouseEntities.add(warehouseEntity);
}
@ -321,6 +328,7 @@ public class IoTransInoutService {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setCorpOrderId(orderEntity.getCorpOrderId());
orderFilterRequest.setCustomerId(orderEntity.getCustomerId());
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
List<OrderEntity> orderEntities = orderService.findAllOrders(orderFilterRequest);
if (orderEntities.size() > 1) {
orderEntity.setRemark("单据重复上传");
@ -409,6 +417,16 @@ public class IoTransInoutService {
if (datas.size() <= 0) {
orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL);
orderService.updateRemark(orderEntity.getId(), "udi码" + warehouseEntity.getCode() + "当前供应商不存在此配送产品");
return;
} else {
if (datas.size() == 1) {
warehouseEntity.setRelId(datas.get(0).getRlId() + "");
} else {
orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL);
orderService.updateRemark(orderEntity.getId(), "di码" + warehouseEntity.getNameCode() + "DI绑定多个产品ID,请指定对应产品!");
return;
}
}
}

@ -16,6 +16,14 @@ import java.security.spec.X509EncodedKeySpec;
public class RsaUtils {
public static String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtaHLiDtscnwyee4lG9jC" +
"8GUEZYIuBoz49W3GSy2LEOVpKRyiQNCjRmybvQS5qKdsb3pV720HQJnv/nQLnsg/" +
"vWbFc9L09fEeJdDZxQOf8D7CHeVgLd8+fh/GezQCVLijGlbAVORXOrFo5McdyOds" +
"LJey1x4HxIR13a79JHB7sdve14A2aS6bQ7NPWu8hM9LpJd1hylsXgdBpR+iX3DPF" +
"eep8Sx8jPnWfUfGF2pDNE3h1uz9RylGBYUz4tDPzz0IXO7vZkyUFXeslzKFDFcmh" +
"hbn1tobX+al4XvfRpjoCjST2mRfqCt4aNuBDM1LHMzyMBVJpfui91ikLGMgP4Gdf" +
"swIDAQAB";
public static String privateKeyEncrypt(String str, String privateKey) throws Exception {
System.out.println("{}|RSA私钥加密前的数据|str:{}|publicKey:{}" + str + "\n" + privateKey);
//base64编码的公钥

@ -1,10 +1,10 @@
# \u751F\u4EA7\u73AF\u5883
server.port=9996
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://139.159.187.130:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=root
#spring.datasource.password=123456
#spring.datasource.password=root
spring.datasource.password=123456
#server.servlet.context-path=
#logging.level.com.glxp.sale.admin.dao=debug
# \u8DE8\u57DF\u8BBE\u7F6E

@ -0,0 +1,55 @@
<?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.sale.admin.dao.auth.AuthCheckDao">
<select id="filterDevices" parameterType="com.glxp.sale.admin.req.auth.AuthCheckRequest"
resultType="com.glxp.sale.admin.entity.auth.AuthCheckEntity">
SELECT *
FROM auth_device_check
<where>
<if test="machineInfo != null">
AND machineInfo = #{machineInfo}
</if>
<if test="registerCode != null">
AND registerCode = #{registerCode}
</if>
<if test="id != null">
AND id = #{id}
</if>
</where>
ORDER BY id
DESC
</select>
<select id="findByMachine" parameterType="hashmap" resultType="com.glxp.sale.admin.entity.auth.AuthCheckEntity">
SELECT *
FROM auth_device_check
<where>
machineInfo = #{machineInfo}
</where>
LIMIT 1
</select>
<insert id="insertDevices" keyProperty="id" parameterType="com.glxp.sale.admin.entity.auth.AuthCheckEntity">
INSERT INTO auth_device_check
(machineInfo, remark, registerCode, createDate)
values (#{machineInfo},
#{remark},
#{registerCode}, #{createDate})
</insert>
<update id="updateDevices" parameterType="com.glxp.sale.admin.entity.auth.AuthCheckEntity">
UPDATE auth_device_check
<trim prefix="set" suffixOverrides=",">
<if test="remark != null">remark=#{remark},</if>
<if test="registerCode != null">registerCode=#{registerCode},</if>
<if test="createDate != null">createDate=#{createDate},</if>
</trim>
WHERE machineInfo=#{machineInfo}
</update>
</mapper>

@ -39,10 +39,19 @@
where customerId = #{customerId}
</delete>
<select id="selectLicenseByName" resultType="com.glxp.sale.admin.entity.auth.AuthLicense">
select apikey, secretkey from auth_license where name = #{name}
<select id="selectLicenseByName" parameterType="Map" resultType="com.glxp.sale.admin.entity.auth.AuthLicense">
select apikey, secretkey
from auth_license
where name = #{name}
</select>
<select id="selectLicenseBykey" parameterType="Map" resultType="com.glxp.sale.admin.entity.auth.AuthLicense">
select *
from auth_license
where apikey = #{apikey}
</select>
<update id="updateLicenseByName">
update auth_license
<set>

@ -38,7 +38,7 @@
AND originAction =#{originAction}
</if>
<if test="spUse != ''and spUse != null">
AND spUse =#{spUse}
AND basic_bustype_local.spUse =#{spUse}
</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') ]]>
@ -69,7 +69,7 @@
AND basic_bussiness_type.enable =#{enabled}
</if>
<if test="spUse != ''and spUse != null">
AND spUse =#{spUse}
AND basic_bustype_local.spUse =#{spUse}
</if>
</where>
group by basic_bussiness_type.action

@ -45,6 +45,10 @@
<if test="action != ''and action != null">
AND basic_bustype_origin.action = #{thirdAction}
</if>
<if test="corpType != ''and corpType != null">
AND basic_bussiness_type.action = #{corpType}
</if>
</where>
GROUP BY basic_bustype_origin.action;
</select>

@ -325,7 +325,7 @@
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime,cplx,hchzsb
)
values
(
@ -366,7 +366,10 @@
#{cpms},
#{cpbsbmtxmc},
#{isNewest},
#{updateTime}
#{updateTime},
#{hchzsb},
#{cplx},
#{hchzsb}
)
</insert>
@ -379,7 +382,7 @@
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime,cplx,hchzsb
) values
<foreach collection="datas" item="item" index="index"
@ -424,7 +427,7 @@
#{item.cpms},
#{item.cpbsbmtxmc},
#{item.isNewest},
#{item.updateTime}
#{item.updateTime},#{item.cplx},#{item.hchzsb}
)
</foreach>
</insert>
@ -472,7 +475,8 @@
<if test="diType != null">diType=#{diType},</if>
<if test="isNewest != null">isNewest=#{isNewest},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="cplx != null">cplx=#{cplx},</if>
<if test="hchzsb != null">hchzsb=#{hchzsb},</if>
</set>
WHERE id = #{id}
</update>
@ -491,6 +495,8 @@
<if test="cpbsbmtxmc != null">cpbsbmtxmc=#{cpbsbmtxmc},</if>
<if test="isNewest != null">isNewest=#{isNewest},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="cplx != null">cplx=#{cplx},</if>
<if test="hchzsb != null">hchzsb=#{hchzsb},</if>
</set>
WHERE uuid = #{uuid}
</update>

@ -106,4 +106,16 @@
</set>
WHERE id = #{id}
</update>
<select id="syncDlCompany" parameterType="com.glxp.sale.admin.req.basic.UdiCompanyRequest"
resultType="com.glxp.sale.admin.entity.basic.UdiCompanyEntity">
SELECT * FROM udicompany
<where>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
limit #{page},#{limit}
</select>
</mapper>

@ -207,16 +207,15 @@
<if test="action==null or action == ''">
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null">
and (status = #{status}
<if test="statusOrOne != '' and statusOrOne!=null">
or status = #{statusOrOne}
</if>)
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
</if>
<if test="status != '' and status!=null and status!=10">
and status = #{status}
</if>
<if test="status ==10">
and ( status = 1 or status=-1)
</if>
<if test="unionCtrStatus != '' and unionCtrStatus!=null">
and (contrastStatus = 0 or contrastStatus = 2)
</if>

Loading…
Cancel
Save