|
|
|
@ -7,13 +7,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.api.dao.collect.IoCollectOrderBackupMapper;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeTempDao;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.EntrustReceEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceDocumentEntity;
|
|
|
|
|
import com.glxp.api.entity.collect.*;
|
|
|
|
|
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
|
|
|
@ -24,19 +28,18 @@ import com.glxp.api.http.sync.SpGetHttpClient;
|
|
|
|
|
import com.glxp.api.req.collect.CollectOrderBizRequest;
|
|
|
|
|
import com.glxp.api.req.collect.CollectOrderRequest;
|
|
|
|
|
import com.glxp.api.req.collect.PostCollectOrderRequest;
|
|
|
|
|
import com.glxp.api.req.inout.ReviewFinishRequest;
|
|
|
|
|
import com.glxp.api.res.basic.BasicSkPrescribeResponse;
|
|
|
|
|
import com.glxp.api.res.collect.CollectOrderBizResponse;
|
|
|
|
|
import com.glxp.api.res.collect.IoCollectOrderResponse;
|
|
|
|
|
import com.glxp.api.service.auth.impl.AuthAdminServiceImpl;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
|
import com.glxp.api.service.basic.SysWorkplaceDocumentService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiRlSupService;
|
|
|
|
|
import com.glxp.api.service.inout.IoAddInoutService;
|
|
|
|
|
import com.glxp.api.service.inout.IoCheckInoutService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import com.glxp.api.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.util.IntUtil;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import com.glxp.api.util.*;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -85,7 +88,12 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
private ErpBasicClient erpBasicClient;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SpGetHttpClient spGetHttpClient;
|
|
|
|
|
SpGetHttpClient spGetHttp;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<IoCollectOrderResponse> filterList(CollectOrderRequest collectOrderRequest) {
|
|
|
|
@ -146,7 +154,7 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void generateOrder(String billNo) {
|
|
|
|
|
public void generateOrder(String billNo,AuthAdmin authAdmin) {
|
|
|
|
|
|
|
|
|
|
IoCollectOrderBackup collectOrder = getByBillNo(billNo);
|
|
|
|
|
SysWorkplaceDocumentEntity sysWorkplaceDocumentEntity = sysWorkplaceDocumentService.findByWorkplaceCode(collectOrder.getWorkPlaceCode(), collectOrder.getBusType());
|
|
|
|
@ -191,14 +199,24 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
}
|
|
|
|
|
} else if (IntUtil.value(sysWorkplaceDocumentEntity.getIsMatching()) == 1 && sysWorkplaceDocumentEntity.getScanType() != 1) {
|
|
|
|
|
//更新单据为已完成
|
|
|
|
|
// IoOrderEntity orderEntity = orderService.findByBillNo(collectOrder.getBillNo());
|
|
|
|
|
//// orderEntity.setStatus(7);
|
|
|
|
|
//// orderEntity.setFromType(2);
|
|
|
|
|
//// orderEntity.setDealStatus(3);
|
|
|
|
|
//// orderEntity.setAuditTime(new Date());
|
|
|
|
|
//// orderService.update(orderEntity);
|
|
|
|
|
//// //推送自助平台
|
|
|
|
|
//// spGetHttpClient.updateCheckStatus(orderEntity, collectOrder.getCreateUser());
|
|
|
|
|
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(collectOrder.getBillNo());
|
|
|
|
|
orderEntity.setStatus(7);
|
|
|
|
|
orderEntity.setFromType(2);
|
|
|
|
|
orderEntity.setDealStatus(3);
|
|
|
|
|
orderEntity.setAuditTime(new Date());
|
|
|
|
|
orderService.update(orderEntity);
|
|
|
|
|
//推送自助平台
|
|
|
|
|
spGetHttpClient.updateCheckStatus(orderEntity, collectOrder.getCreateUser());
|
|
|
|
|
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) {
|
|
|
|
|
if (orderEntity.getFromType() == ConstantStatus.FROM_UDISP) {
|
|
|
|
|
ReviewFinishRequest reviewFinishRequest = new ReviewFinishRequest();
|
|
|
|
|
reviewFinishRequest.setOrderId(collectOrder.getBillNo());
|
|
|
|
|
BaseResponse<String> stringBaseResponse = spGetHttp.reviewOrder(reviewFinishRequest, authAdmin.getId() + "");
|
|
|
|
|
}
|
|
|
|
|
updateReview(authAdmin,orderEntity);
|
|
|
|
|
}
|
|
|
|
|
} else if (IntUtil.value(sysWorkplaceDocumentEntity.getIsMatching()) == 0) {
|
|
|
|
|
//todo 根据单据类型上传医保或者第三方系统
|
|
|
|
|
PostCollectOrderRequest orderRequest = new PostCollectOrderRequest();
|
|
|
|
@ -265,11 +283,11 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean orderUpload(String billNo) {
|
|
|
|
|
public Boolean orderUpload(String billNo,AuthAdmin authAdmin) {
|
|
|
|
|
IoCollectOrderBackup updateOrder = new IoCollectOrderBackup();
|
|
|
|
|
updateOrder.setBillNo(billNo);
|
|
|
|
|
try {
|
|
|
|
|
this.generateOrder(billNo);
|
|
|
|
|
this.generateOrder(billNo,authAdmin);
|
|
|
|
|
updateOrder.setUploadStatus(2);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
updateOrder.setUploadStatus(3);
|
|
|
|
@ -304,4 +322,17 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
}
|
|
|
|
|
return reList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BaseResponse updateReview(AuthAdmin authAdmin, IoOrderEntity orderEntity) {
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED);
|
|
|
|
|
orderEntity.setReviewUser((authAdmin.getId() + ""));
|
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
|
orderEntity.setAuditTime(new Date());
|
|
|
|
|
orderService.update(orderEntity);
|
|
|
|
|
redisUtil.del(ConstantStatus.REDIS_BILLNO + orderEntity.getBillNo());
|
|
|
|
|
redisUtil.del(ConstantStatus.REDIS_BILLNO_CODES + orderEntity.getBillNo());
|
|
|
|
|
//验收完成->进入流程
|
|
|
|
|
ioCheckInoutService.checkSecond(orderEntity);
|
|
|
|
|
return ResultVOUtils.success("更新成功");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|