Merge branch 'master' into test

pro
wj 2 years ago
commit b8a9e47004

@ -99,7 +99,7 @@ public enum BasicExportStatusTimeEnum {
/**
*
* */
*/
ENTRUST_ACCEPT("entrust_accept", "委托验收"),
/**
@ -116,6 +116,12 @@ public enum BasicExportStatusTimeEnum {
*
*/
BUS_TYPE_CHANGE("bus_type_change", "自动建业务单设置"),
/**
* UDI
*/
ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"),
;
@EnumValue
private String key;

@ -1,12 +1,14 @@
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;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.AsyncDiDlHelper;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
@ -165,6 +167,42 @@ public class UdiContrastController {
return ResultVOUtils.success("切换成功!");
}
@Resource
AsyncDiDlHelper asyncDiDlHelper;
/**
*
*/
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/syncOnline")
@Log(title = "耗材字典", businessType = BusinessType.UPDATE)
public BaseResponse syncOnline(@RequestBody UdiCombineRequest udiCombineRequest) {
List<UdiProductEntity> udiInfoEntities = udiDlHttpClient.getUdiByUuid(udiCombineRequest.getOriginUuid());
if (CollUtil.isNotEmpty(udiInfoEntities)) {
BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlByDiRes(udiInfoEntities.get(0).getNameCode());
if (listBaseResponse.getCode() == 20000) {
List<ProductInfoEntity> productInfoEntityList = listBaseResponse.getData();
if (CollUtil.isNotEmpty(productInfoEntityList)) {
productInfoService.insertProductInfos(productInfoEntityList);
}
}
udiInfoEntities = udiDlHttpClient.getUdiByUuid(udiCombineRequest.getOriginUuid());
udiProductService.deleteByUuid(udiCombineRequest.getUuid());
for (UdiProductEntity udiProductEntity : udiInfoEntities) {
udiProductEntity.setUuid(udiCombineRequest.getUuid());
udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI);
udiProductEntity.setUpdateTime(new Date());
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
}
udiProductService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities));
return ResultVOUtils.success("更新成功!");
} else {
return ResultVOUtils.error(500, "更新失败!");
}
}
//更改关联第三方产品产品信息
@AuthRuleAnnotation("")

@ -103,6 +103,41 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.page(pageInfo);
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/inout/order/filterList")
public BaseResponse filterOrderList(FilterOrderRequest filterOrderRequest) {
if (StrUtil.isNotBlank(filterOrderRequest.getStatusType())) {
orderService.setFilterStatus(filterOrderRequest);
}
if (StrUtil.isNotBlank(filterOrderRequest.getVueType())) {
orderService.setActions(filterOrderRequest);
}
if (StrUtil.isNotEmpty(filterOrderRequest.getSupInoivceSearch())) {
orderService.setInvoiceFiltes(filterOrderRequest);
}
if (filterOrderRequest.getSourceLocalType() != null) {
if (filterOrderRequest.getSourceLocalType() == 1) {
filterOrderRequest.setSourceTypes(Arrays.asList(1, 2, 3, 4, 5));
} else {
filterOrderRequest.setSourceTypes(Arrays.asList(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17));
}
}
String customerId = getCustomerId();
if (!customerId.equals("110")) {
filterOrderRequest.setFromCorp(customerId);
}
List<IoOrderResponse> list = orderService.getfilterList(filterOrderRequest);
PageInfo<IoOrderResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
@GetMapping("/udiwms/inout/order/filterInvoice")
public BaseResponse filterInvoice(FilterOrderRequest filterOrderRequest) {
filterOrderRequest.setDealStatuses(Arrays.asList(2, 3));

@ -2,6 +2,7 @@ package com.glxp.api.controller.inout;
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;
@ -512,6 +513,15 @@ public class IoOrderDetailBizController extends BaseController {
return ResultVOUtils.page(pageInfo);
}
@GetMapping("/udiwms/inout/bizDetail/filterListInv")
public BaseResponse filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) {
List<IoOrderDetailBizResponse> list = orderDetailBizService.getfilterList(orderDetailBizRequest);
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk());
ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities);
PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
@GetMapping("/udiwms/inout/bizDetail/filterListInvoice")
public BaseResponse filterListInvoice(FilterOrderDetailBizRequest orderDetailBizRequest) {
List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(orderDetailBizRequest);
@ -542,14 +552,33 @@ public class IoOrderDetailBizController extends BaseController {
/**
*
*
* @param id
* @param
* @return
*/
@GetMapping("/udiwms/inout/biz/deleteById")
@PostMapping("/udiwms/inout/biz/deleteById")
@Log(title = "发票管理", businessType = BusinessType.DELETE)
public BaseResponse deleteById(Integer id) {
public BaseResponse deleteById(@RequestBody IoOrderInvoiceEntity ioOrderInvoiceEntity) {
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId().intValue());
//更改 登记状态
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
FilterOrderDetailBizRequest filterOrderDetailBizRequest = new FilterOrderDetailBizRequest();
filterOrderDetailBizRequest.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk());
ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk());
ioOrderDetailBizEntity.setId(ioOrderInvoiceEntity.getRegId());
List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest);
if(list == null && list.size()==0){
ioOrderDetailBizEntity.setRegStatus(false);
}
orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity);
return ResultVOUtils.success();
return ResultVOUtils.success(ioOrderInvoiceService.deleteByInvId(id));
}
@ -582,12 +611,24 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizEntity.getId());
ioOrderInvoiceEntity.setCreateTime(new Date());
ioOrderInvoiceEntity.setUpdateTime(new Date());
ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
return ResultVOUtils.success("成功");
}
@PostMapping("/udiwms/inout/biz/updateorderBiz")
public BaseResponse updateorderBiz(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) {
ioOrderDetailBizEntity.setRegStatus(true);
orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity);
return ResultVOUtils.success("成功");
}
/**
*
*
@ -599,7 +640,7 @@ public class IoOrderDetailBizController extends BaseController {
List<IoOrderDetailBizResponse> list = orderDetailBizService.filterList(orderDetailBizRequest);
for (IoOrderDetailBizResponse ioOrderDetailBizResponse : list) {
String msg = "";
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
IoOrderInvoiceRequest ioOrderInvoiceEntity = new IoOrderInvoiceRequest();
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizResponse.getOrderIdFk());
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceEntity);
for (IoOrderInvoiceEntity obj : ioOrderInvoiceEntityList) {

@ -0,0 +1,40 @@
package com.glxp.api.controller.inout;
import cn.hutool.core.collection.CollUtil;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
import com.glxp.api.req.inout.RefreshInoiceRequest;
import com.glxp.api.service.inout.IoOrderInvoiceService;
import org.springframework.beans.BeanUtils;
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 java.util.List;
@RestController
public class IoOrderInvoiceController {
@Resource
IoOrderInvoiceService ioOrderInvoiceService;
RefreshInoiceRequest refreshInoiceRequest;
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/refrshInvoice")
@Log(title = "发票", businessType = BusinessType.INSERT)
public BaseResponse addBizProduct(@RequestBody RefreshInoiceRequest refreshInoiceRequest) {
IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest();
BeanUtils.copyProperties(refreshInoiceRequest, orderInvoiceRequest);
List<IoOrderInvoiceEntity> orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest);
if (CollUtil.isEmpty(orderInvoiceEntities))
return ResultVOUtils.error(500, "查无发票信息!");
return ResultVOUtils.success(orderInvoiceEntities);
}
}

@ -684,7 +684,7 @@ public class SpsSyncDownloadController {
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
orderInvoiceEntity.setId(null);
orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
orderInvoiceMapper.insert(orderInvoiceEntity);
}
}

@ -20,6 +20,8 @@ public interface IoOrderDao extends BaseMapperPlus<IoOrderDao, IoOrderEntity, Io
*/
List<IoOrderResponse> filterList(FilterOrderRequest filterOrderRequest);
List<IoOrderResponse> getfilterList(FilterOrderRequest filterOrderRequest);
/**
*
*

@ -19,6 +19,8 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus<IoOrderDetailBizDao,
*/
List<IoOrderDetailBizResponse> filterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderDetailBizResponse> getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest);
/**

@ -3,6 +3,7 @@ package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -12,6 +13,6 @@ public interface IoOrderInvoiceMapper extends BaseMapperPlus<IoOrderInvoiceMappe
boolean insertInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity);
List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity);
List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceEntity);
}

@ -197,4 +197,8 @@ public class IoOrderDetailBizEntity {
@TableField(exist = false)
private String errMsg;
@TableField(value = "regStatus")
private boolean regStatus;
}

@ -13,7 +13,7 @@ import lombok.Data;
@TableName(value = "io_order_invoice")
public class IoOrderInvoiceEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
/**
*
@ -106,6 +106,10 @@ public class IoOrderInvoiceEntity {
@TableField(value = "bizIdFk")
private Integer bizIdFk;
@TableField(exist = false)
private Integer regId;
public static final String COL_ID = "id";
public static final String COL_ORDERIDFK = "orderIdFk";

@ -13,7 +13,7 @@ import lombok.Data;
@TableName(value = "sync_data_bustypes")
public class SyncDataBustypeEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
@TableField(value = "`action`")
private String action;
@TableField(value = "`name`")

@ -68,5 +68,7 @@ public class SyncDataSetEntity {
private int manufacturerCert;
private int productCert;
private int orderInvoice; //发票信息
}

@ -27,6 +27,7 @@ public class UdiCombineRequest {
private String price;
private boolean idSpliUdi;
private String uuid;
private String originUuid;
private String ybbm;

@ -13,7 +13,6 @@ public class FilterOrderDetailBizRequest extends ListPageRequest {
* ID
*/
private Long relId;
/**
*
*/

@ -19,7 +19,7 @@ import java.util.List;
@Data
public class IoOrderInvoiceRequest {
private Integer id;
private Long id;
private String orderIdFk;

@ -0,0 +1,11 @@
package com.glxp.api.req.inout;
import lombok.Data;
@Data
public class RefreshInoiceRequest {
private Long id;
private String orderIdFk;
private Long bizIdFk;
}

@ -163,6 +163,10 @@ public class IoOrderDetailBizResponse {
private String invoiceCodes;
private Integer sucCount;
private boolean regStatus;
}

@ -11,7 +11,7 @@ import java.util.Date;
@Data
@TableName(value = "io_order_invoice")
public class IoOrderInvoiceResponse {
private Integer id;
private Long id;
/**
*

@ -232,6 +232,11 @@ public class IoOrderResponse {
private Integer processStatus;
private int inCodeStatus;
private Integer allCout;
private Integer partCount;
/**
*

@ -62,4 +62,6 @@ public class SyncDataSetResponse {
private int companyCert;
private int manufacturerCert;
private int productCert;
private int orderInvoice; //发票信息
}

@ -238,11 +238,11 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl<BasicBussinessTyp
break;
case Constant.ORDER_ACTION_SUP_INVOICE:
bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT)
.eq("mainAction", ConstantType.TYPE_PUT)
.gt("spUse", 0).eq("actionType", 1).eq("enable", true));
break;
//.eq("corpType", ConstantStatus.CORP_TYPE_OUT)
case Constant.ORDER_ACTION_SUP_DELAUDIT: //供应商审核送货单
bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT)

@ -2,6 +2,7 @@ package com.glxp.api.service.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
@ -260,7 +261,7 @@ public class IoChangeInoutService {
if (CollUtil.isNotEmpty(invoiceEntities)) {
for (IoOrderInvoiceEntity orderInvoiceEntity : invoiceEntities) {
orderInvoiceEntity.setOrderIdFk(outOrder.getBillNo());
orderInvoiceEntity.setId(null);
orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
orderInvoiceEntity.setBizIdFk(null);
orderInvoiceEntity.setUpdateTime(new Date());
ioOrderInvoiceService.insertInvoice(orderInvoiceEntity);

@ -729,6 +729,10 @@ public class IoCheckInoutService {
if (!bussinessTypeEntity.isThrCheckCopy()) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
}
} else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDISP) {
if (!bussinessTypeEntity.isThrCheckSp()) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
}
}
} else {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
@ -782,6 +786,10 @@ public class IoCheckInoutService {
if (!bussinessTypeEntity.isSecCheckCopy()) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED);
}
} else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDISP) {
if (!bussinessTypeEntity.isSecCheckSp()) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED);
}
}
} else {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED);

@ -101,6 +101,7 @@ public class IoGenInvService {
BeanUtils.copyProperties(codeEntity, invProductDetailEntity);
invProductDetailEntity.setRelId(codeEntity.getRelId());
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setId(null);
invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON);
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductDetailEntity.setInCount(invProductDetailEntity.getReCount());
@ -171,6 +172,7 @@ public class IoGenInvService {
BeanUtils.copyProperties(codeEntity, invProductDetailEntity);
invProductDetailEntity.setRelId(codeEntity.getRelId());
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setId(null);
invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON);
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductDetailEntity.setInCount(invProductDetailEntity.getReCount());
@ -253,6 +255,7 @@ public class IoGenInvService {
invProductDetailEntity.setRelId(codeEntity.getRelId());
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON);
invProductDetailEntity.setId(null);
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductDetailEntity.setInCount(invProductDetailEntity.getReCount());
} else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {

@ -34,6 +34,8 @@ public interface IoOrderDetailBizService {
List<IoOrderDetailBizResponse> filterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderDetailBizResponse> getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest);
IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk);
List<IoOrderDetailBizEntity> checkOrderList(String orderId);

@ -1,11 +1,13 @@
package com.glxp.api.service.inout;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.inout.IoCodeRelEntity;
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
import java.util.List;
public interface IoOrderInvoiceService {
public interface IoOrderInvoiceService extends IService<IoOrderInvoiceEntity> {
List<IoOrderInvoiceEntity> findByBillNo(String billNo);
@ -16,7 +18,7 @@ public interface IoOrderInvoiceService {
boolean insertInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity);
List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity);
List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest);
}

@ -54,6 +54,8 @@ public interface IoOrderService {
*/
List<IoOrderResponse> filterList(FilterOrderRequest filterOrderRequest);
List<IoOrderResponse> getfilterList(FilterOrderRequest filterOrderRequest);
/**
*
*

@ -117,6 +117,17 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
return ioOrderDetailBizDao.filterList(orderDetailBizRequest);
}
@Override
public List<IoOrderDetailBizResponse> getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest) {
if (null == orderDetailBizRequest) {
return Collections.emptyList();
}
if (null != orderDetailBizRequest.getPage() && null != orderDetailBizRequest.getLimit()) {
PageHelper.offsetPage((orderDetailBizRequest.getPage() - 1) * orderDetailBizRequest.getLimit(), orderDetailBizRequest.getLimit());
}
return ioOrderDetailBizDao.getfilterList(orderDetailBizRequest);
}
@Override
public IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk) {
QueryWrapper<IoOrderDetailBizEntity> ew = new QueryWrapper<>();

@ -1,7 +1,10 @@
package com.glxp.api.service.inout.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.inout.IoCodeRelMapper;
import com.glxp.api.dao.inout.IoOrderInvoiceMapper;
import com.glxp.api.entity.inout.IoCodeRelEntity;
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
import org.springframework.beans.BeanUtils;
@ -16,7 +19,7 @@ import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class IoOrderInvoiceServiceImpl implements IoOrderInvoiceService {
public class IoOrderInvoiceServiceImpl extends ServiceImpl<IoOrderInvoiceMapper, IoOrderInvoiceEntity> implements IoOrderInvoiceService {
@Resource
IoOrderInvoiceMapper ioOrderInvoiceMapper;
@ -45,7 +48,7 @@ public class IoOrderInvoiceServiceImpl implements IoOrderInvoiceService {
}
@Override
public List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity) {
return ioOrderInvoiceMapper.selectOrderInvoice(ioOrderInvoiceEntity);
public List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest) {
return ioOrderInvoiceMapper.selectOrderInvoice(ioOrderInvoiceRequest);
}
}

@ -531,6 +531,17 @@ public class IoOrderServiceImpl implements IoOrderService {
return orderDao.filterList(filterOrderRequest);
}
@Override
public List<IoOrderResponse> getfilterList(FilterOrderRequest filterOrderRequest) {
if (null == filterOrderRequest) {
return Collections.emptyList();
}
if (null != filterOrderRequest.getPage() && null != filterOrderRequest.getLimit()) {
PageHelper.offsetPage((filterOrderRequest.getPage() - 1) * filterOrderRequest.getLimit(), filterOrderRequest.getLimit());
}
return orderDao.getfilterList(filterOrderRequest);
}
@Override
public List<IoOrderEntity> filterOrderList(FilterOrderRequest filterOrderRequest) {
if (null == filterOrderRequest) {
@ -657,9 +668,10 @@ public class IoOrderServiceImpl implements IoOrderService {
@Override
public void setInvoiceFiltes(FilterOrderRequest filterOrderRequest) {
// .eq("corpType", ConstantStatus.CORP_TYPE_OUT)
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT)
.eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("inStock", false)
.eq("mainAction", ConstantType.TYPE_PUT)
.eq("inStock", false)
.gt("spUse", 1).eq("actionType", 1).eq("enable", true));
List<String> actions1 = null;
actions1 = bussinessTypeEntities.stream().map(BasicBussinessTypeEntity::getAction).collect(Collectors.toList());
@ -667,7 +679,7 @@ public class IoOrderServiceImpl implements IoOrderService {
filterOrderRequest.setInvoiceActions1(actions1);
List<BasicBussinessTypeEntity> bussinessTypeEntities2 = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT)
.eq("mainAction", ConstantType.TYPE_PUT)
.eq("inStock", true)
.gt("spUse", 0).eq("actionType", 1).eq("enable", true));
List<String> actions2 = null;

@ -136,6 +136,7 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic
response.setActionName(busType.getName());
//设置单据日期
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("createTime").eq("billNo", response.getOrderId()));
if (order != null)
response.setOrderTime(DateUtil.toDateStr(order.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
}

@ -467,6 +467,7 @@ public class SpsSyncDownloadService {
StringBuffer remark = new StringBuffer();
BasicExportTypeEnum exportType = BasicExportTypeEnum.OTHER_DATA;
//文件数据
List<String> syncFiles = new ArrayList<>();
Map<String, Object> jsonMap = new WeakHashMap<>(4);
Map<BasicExportStatusTimeEnum, Map<String, Object>> totalTimeMap = new WeakHashMap<>(10);
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
@ -489,7 +490,7 @@ public class SpsSyncDownloadService {
);
if (CollectionUtil.isNotEmpty(ioCodeLostList)) {
remark.append("UDI缺失码").append(ioCodeLostList.size()).append("条\n");
jsonMap.put(BasicExportStatusTimeEntity.class.getSimpleName(), ioCodeLostList);
jsonMap.put(IoCodeLostEntity.class.getSimpleName(), ioCodeLostList);
}
}
//确认有开启udi关联关系同步
@ -513,6 +514,28 @@ public class SpsSyncDownloadService {
}
}
if (info.getOrderInvoice() == 2) {
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.ORDER_INVOICE, createFile);
totalTimeMap.put(BasicExportStatusTimeEnum.ORDER_INVOICE, map);
List<IoOrderInvoiceEntity> orderInvoiceEntities = orderInvoiceService.list(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class)
.le((boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime
, map.get("oldDate"), now)
);
if (CollectionUtil.isNotEmpty(orderInvoiceEntities)) {
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
if (StrUtil.isNotEmpty(orderInvoiceEntity.getLicenseUrl())) {
syncFiles.add(orderInvoiceEntity.getLicenseUrl());
}
}
if (CollUtil.isNotEmpty(syncFiles)) {
jsonMap.put("syncFiles", syncFiles);
}
remark.append("扫码单据发票信息:").append(orderInvoiceEntities.size()).append("条\n");
jsonMap.put(IoOrderInvoiceEntity.class.getSimpleName(), orderInvoiceEntities);
}
}
if (jsonMap.size() > 0) {
jsonMap.put(SYNC_REMARK, remark.toString());
@ -563,6 +586,7 @@ public class SpsSyncDownloadService {
*/
protected boolean generateDocumentTypeDataFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) {
StringBuffer remark = new StringBuffer();
List<String> syncFiles = new ArrayList<>();
BasicExportTypeEnum exportType = BasicExportTypeEnum.DOCUMENT_TYPE_DATA;
//文件数据
Map<String, Object> jsonMap = new WeakHashMap<>(4);
@ -805,8 +829,8 @@ public class SpsSyncDownloadService {
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
if (CollUtil.isNotEmpty(syncDataSetEntity.getToInBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getToInBusTypes()) {
List<IoOrderEntity> temps = orderService.findByStatus(syncDataBustypeEntity.getAction(), syncDataBustypeEntity.getOrderStatus(), DateUtil.parseDate(spsSyncDataRequest.getLastUpdateTime()));
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);

@ -79,7 +79,7 @@ public class AsyncHeartTask implements SchedulingConfigurer {
//定时同步单据最近更新数据至任务表,等待下载
if (syncDataSetEntity.getOrderSyncTime() != null) {
long timeInterval = syncDataSetEntity.getOrderSyncTime() * 60 * 1000;
long timeInterval = syncDataSetEntity.getOrderSyncTime() * 6 * 1000;
long curTime = System.currentTimeMillis();
Long lastTime = (Long) redisUtil.get("SPS_ORDER_SYNC_GEN_DATA");
if (lastTime == null) {

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

@ -226,7 +226,7 @@
#{basicPrductRemak8}, #{updateTime})
</insert>
<insert id="insertUdiInfos" keyProperty="id" parameterType="java.util.List">
<insert id="insertUdiInfos" parameterType="java.util.List">
replace INTO basic_products
(id, uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl,
zxxsbzbhsydysl, bhxjcpbm, bzcj, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm,

@ -136,6 +136,150 @@
order by createTime desc
</select>
<select id="getfilterList" resultType="com.glxp.api.res.inout.IoOrderResponse">
select io.*,
(select name from basic_bussiness_type bus where bus.action = io.action) billTypeName,
(select name from auth_dept ad where ad.code = io.deptCode) deptName,
(select name from auth_warehouse aw where aw.code = io.invCode) invName,
(select employeeName from auth_user au where au.id = io.createUser) createUserName,
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName,
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName,
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName,
(select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName,
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName,
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
(select name from basic_corp bc where bc.erpId = io.customerId) customerName,
(SELECT count(*) FROM io_order_detail_biz WHERE io_order_detail_biz.orderIdFk = io.billNo
and io_order_detail_biz.regStatus = 1
) AS allCout,
(SELECT count(*) FROM io_order_detail_biz WHERE io_order_detail_biz.orderIdFk = io.billNo
and io_order_detail_biz.regStatus = 0
) As partCount
from io_order as io
<where>
<if test="id != null and id != ''">
AND id = #{id}
</if>
<if test="corpName != null and corpName != ''">
AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like
concat('%', #{corpName}, '%')
</if>
<if test="action != null and action != ''">
AND action = #{action}
</if>
<if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction}
</if>
<if test="billNo != null and billNo != ''">
AND billNo like concat('%', #{billNo}, '%')
</if>
<if test="corpOrderId != null and corpOrderId != ''">
AND corpOrderId = #{corpOrderId}
</if>
<if test="fromCorp != null and fromCorp != ''">
AND fromCorp = #{fromCorp}
</if>
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
</if>
<if test="busType != null">
AND busType = #{busType}
</if>
<if test="inCodeStatus != null">
AND inCodeStatus = #{inCodeStatus}
</if>
<if test="relKey != null">
AND relKey = #{relKey}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
</if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d')
</if>
<if test="actions != null and actions.size() != 0">
AND `action` in
<foreach collection="actions" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="sourceTypes != null and sourceTypes.size() != 0">
AND fromType in
<foreach collection="sourceTypes" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="statuses != null and statuses.size() != 0">
AND status in
<foreach collection="statuses" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="dealStatuses != null and dealStatuses.size() != 0">
AND dealStatus in
<foreach collection="dealStatuses" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="orderIds != null and orderIds.size() != 0">
AND io.billNo in
<foreach collection="orderIds" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="orderType != null">
AND orderType = #{orderType}
</if>
<if test="supInoivceSearch != null">
<if test="invoiceActions1 != null and invoiceActions2 == null">
AND (`action` in
<foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and status = 10)
</if>
<if test="invoiceActions1 == null and invoiceActions2 != null">
and (
`action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and status = 7
)
</if>
<if test="invoiceActions1 != null and invoiceActions2 != null">
AND ((`action` in
<foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and status = 10)
or (
`action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and status = 7)
)
</if>
</if>
</where>
order by createTime desc
</select>
<select id="filterOrderList" resultType="com.glxp.api.entity.inout.IoOrderEntity">
select *
from io_order

@ -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
@ -23,6 +23,31 @@
group by io_order_detail_biz.id
</select>
<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
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
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
<if test="relId != null">
AND bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
group by io_order_detail_biz.id
</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,

@ -1,25 +1,29 @@
<?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.inout.IoOrderInvoiceMapper">
<insert id="insertInvoice" parameterType="com.glxp.api.entity.inout.IoOrderInvoiceEntity">
INSERT INTO io_order_invoice( orderIdFk, bindRlFk,batchNo, productDate, expireDate
)
INSERT INTO io_order_invoice(orderIdFk, bindRlFk, batchNo, productDate, expireDate)
values (#{orderIdFk},
#{bindRlFk},
#{batchNo},
#{productDate},
#{expireDate}
)
#{expireDate})
</insert>
<select id="selectOrderInvoice" parameterType="com.glxp.api.entity.inout.IoOrderInvoiceEntity" resultType="com.glxp.api.entity.inout.IoOrderInvoiceEntity" >
select * from io_order_invoice
<select id="selectOrderInvoice" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
resultType="com.glxp.api.entity.inout.IoOrderInvoiceEntity">
select *
from io_order_invoice
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="bizIdFk != null">
AND bizIdFk = #{bizIdFk}
</if>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
</where>
</select>
</mapper>

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

@ -11,12 +11,12 @@
<insert id="inserts" parameterType="com.glxp.api.entity.sync.SyncDataBustypeEntity">
insert INTO sync_data_bustypes
(`action`, `name`, outChange, orderStatus, direct)
(id, `action`, `name`, outChange, orderStatus, direct)
values
<foreach collection="syncDataBustypeEntities" item="item" index="index"
separator=",">
(#{item.action}, #{item.name},
(#{item.id}, #{item.action}, #{item.name},
#{item.outChange}, #{item.orderStatus}, #{item.direct})
</foreach>
</insert>

@ -33,6 +33,10 @@ CALL Pro_Temp_ColumnWork('io_order', 'suppleCount', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'relKey', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkTime', 'datetime ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkUser', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'regStatus', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'regStatus', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1);
@ -358,3 +362,8 @@ ALTER TABLE `auth_dept_user`
CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('sync_data_set', 'orderInvoice', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order_invoice', 'id', 'bigint ', 2);

Loading…
Cancel
Save