新增选入采购订单

master
anthonywj 2 years ago
parent eec39c7d16
commit 5da78e6481

@ -18,6 +18,8 @@ import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.inout.*;
import com.glxp.api.entity.purchase.PurOrderDetailEntity;
import com.glxp.api.entity.purchase.PurOrderEntity;
import com.glxp.api.entity.purchase.SupProductEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
@ -33,6 +35,8 @@ import com.glxp.api.res.inout.IoOrderInvoiceResponse;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.basic.*;
import com.glxp.api.service.inout.*;
import com.glxp.api.service.purchase.PurOrderDetailService;
import com.glxp.api.service.purchase.PurOrderService;
import com.glxp.api.service.purchase.SupCertService;
import com.glxp.api.service.purchase.SupProductService;
import com.glxp.api.service.system.SystemParamConfigService;
@ -399,6 +403,71 @@ public class IoOrderDetailBizController extends BaseController {
}
@Resource
PurOrderService purOrderService;
@Resource
PurOrderDetailService purOrderDetailService;
//选入领用单据至业务单据
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/addPurOrder")
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse addPurOrder(@RequestBody PurOrderEntity purOrderEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
purOrderEntity = purOrderService.selectById(purOrderEntity.getId());
List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + "");
BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(purOrderEntity.getBillType());
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(basicBusTypeChangeEntity.getTargetAction());
AuthAdmin authAdmin = getUser();
//创建单据
IoOrderEntity orderEntity = new IoOrderEntity();
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
orderEntity.setBillNo(orderNo);
orderEntity.setCreateUser(authAdmin.getId() + "");
orderEntity.setCreateTime(new Date());
orderEntity.setUpdateUser(authAdmin.getId() + "");
orderEntity.setUpdateTime(new Date());
orderEntity.setCustomerId(authAdmin.getCustomerId() + "");
orderEntity.setCorpOrderId(purOrderEntity.getBillNo());
orderEntity.setAction(bussinessTypeEntity.getAction());
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
orderEntity.setDeptCode(purOrderEntity.getDeptCode());
orderEntity.setInvCode(purOrderEntity.getInvCode());
orderEntity.setFromReceiveBillNo(purOrderEntity.getBillNo());
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT);
orderEntity.setFromType(ConstantStatus.FROM_RECEIVE);
orderEntity.setOrderType(ConstantStatus.ORDER_TYPE_BIZ);
orderEntity.setBusType(bussinessTypeEntity.getBusType());
orderService.insertOrder(orderEntity);
for (PurOrderDetailEntity purReceiveDetailEntity : purOrderDetailEntities) {
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(purReceiveDetailEntity.getProductId().longValue());
ioOrderDetailBizEntity.setOrderIdFk(orderEntity.getBillNo());
ioOrderDetailBizEntity.setBindRlFk(udiRelevanceResponse.getId());
ioOrderDetailBizEntity.setUuidFk(udiRelevanceResponse.getUuid());
ioOrderDetailBizEntity.setNameCode(udiRelevanceResponse.getNameCode());
ioOrderDetailBizEntity.setCoName(udiRelevanceResponse.getCpmctymc());
ioOrderDetailBizEntity.setCertCode(udiRelevanceResponse.getZczbhhzbapzbh());
ioOrderDetailBizEntity.setYlqxzcrbarmc(udiRelevanceResponse.getYlqxzcrbarmc());
ioOrderDetailBizEntity.setManufacturer(udiRelevanceResponse.getManufactory());
ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname());
ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh());
ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice());
ioOrderDetailBizEntity.setSupId(purReceiveDetailEntity.getSupId());
ioOrderDetailBizEntity.setCount(purReceiveDetailEntity.getCount());
orderDetailBizService.insert(ioOrderDetailBizEntity);
}
return ResultVOUtils.success("选入成功!");
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/delBizProduct")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
@ -483,13 +552,13 @@ public class IoOrderDetailBizController extends BaseController {
@Log(title = "发票管理", businessType = BusinessType.INSERT)
public BaseResponse insertInvoice(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) {
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + "");
ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo());
ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate());
ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate());
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + "");
ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo());
ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate());
ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate());
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
return ResultVOUtils.success("成功");

@ -320,8 +320,8 @@ public class SupCertController {
int i = 1;
if (selectSupCertList != null && selectSupCertList.size() > 0) {
for (SupCertEntity obj : selectSupCertList) {
List<String> urlList=Arrays.asList(obj.getFilePath().split(","));
for (String url:urlList){
List<String> urlList = Arrays.asList(obj.getFilePath().split(","));
for (String url : urlList) {
//组装数据
Map<String, Object> supData = new HashMap<>();
supData.put("companyName", supCompanyEntity.getCompanyName() == null ? ' ' : supCompanyEntity.getCompanyName());
@ -340,7 +340,7 @@ public class SupCertController {
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark());
supData.put("filePath", "d:/udi/udiwms/udiwmsfile/register/file/image2/" + url);
supData.put("filePath", filePath + "register/file/image2/" + url);
list.add(supData);
i++;
}
@ -434,8 +434,8 @@ public class SupCertController {
int i = 1;
if (selectSupCertList != null && selectSupCertList.size() > 0) {
for (SupCertEntity obj : selectSupCertList) {
List<String> urlList=Arrays.asList(obj.getFilePath().split(","));
for (String url:urlList){
List<String> urlList = Arrays.asList(obj.getFilePath().split(","));
for (String url : urlList) {
//组装数据
Map<String, Object> supData = new HashMap<>();
supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName());
@ -456,7 +456,7 @@ public class SupCertController {
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark());
supData.put("filePath", "d:/udi/udiwms/udiwmsfile/register/file/image2/" + url);
supData.put("filePath", filePath + "register/file/image2/" + url);
list.add(supData);
i++;
}
@ -498,8 +498,8 @@ public class SupCertController {
if (selectSupCertList != null && selectSupCertList.size() > 0) {
for (SupCertEntity obj : selectSupCertList) {
List<String> urlList=Arrays.asList(obj.getFilePath().split(","));
for (String url:urlList){
List<String> urlList = Arrays.asList(obj.getFilePath().split(","));
for (String url : urlList) {
//组装数据
Map<String, Object> supData = new HashMap<>();
supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName());
@ -522,7 +522,7 @@ public class SupCertController {
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark());
supData.put("filePath", "d:/udi/udiwms/udiwmsfile/register/file/image2/" + url);
supData.put("filePath", filePath + "register/file/image2/" + url);
list.add(supData);
i++;
}
@ -536,12 +536,12 @@ public class SupCertController {
//首营预览文件
@PostMapping("/udiwms/image/register/file")
public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) {
List<String> urlList=Arrays.asList(filterImageRequest.getImageUrl().split(","));
List<String> urlList = Arrays.asList(filterImageRequest.getImageUrl().split(","));
List<String> list = new ArrayList<>();
for (String obj:urlList){
String url = filterImageRequest.getCertFileUrl() + obj;
list.add(url);
}
for (String obj : urlList) {
String url = filterImageRequest.getCertFileUrl() + obj;
list.add(url);
}
return ResultVOUtils.success(list);
}

@ -115,7 +115,6 @@ public class SpsSyncDownloadController {
codeTempEntity.setId(null);
codeMappert.insert(codeTempEntity);
}
}
}

@ -1,15 +1,13 @@
package com.glxp.api.dao.purchase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.purchase.PurOrderEntity;
import com.glxp.api.req.purchase.PurOrderRequest;
import com.glxp.api.req.purchase.PurPlanRequest;
import com.glxp.api.res.purchase.PurOrderResponse;
import com.glxp.api.res.purchase.PurPlanResponse;
import java.util.List;
public interface PurOrderDao extends BaseMapper<PurOrderEntity> {
public interface PurOrderDao extends BaseMapperPlus<PurOrderDao, PurOrderEntity, PurOrderEntity> {
List<PurOrderResponse> queryPageList(PurOrderRequest purPlanRequest);
}
}

@ -38,9 +38,9 @@ public class ReceiveServiceImpl implements ReceiveService {
@Override
public int updateOrder(PurReceiveEntity purReceiveEntity) {
QueryWrapper<PurReceiveEntity> ew=new QueryWrapper<>();
ew.eq("billNo",purReceiveEntity.getBillNo());
return receiveDao.update(purReceiveEntity,ew);
QueryWrapper<PurReceiveEntity> ew = new QueryWrapper<>();
ew.eq("billNo", purReceiveEntity.getBillNo());
return receiveDao.update(purReceiveEntity, ew);
}
@Override

@ -1,7 +1,7 @@
package com.glxp.api.service.purchase;
import com.glxp.api.entity.inout.PurReceiveEntity;
import com.glxp.api.entity.purchase.PurOrderEntity;
import com.glxp.api.entity.purchase.PurPlanEntity;
import com.glxp.api.req.purchase.PurOrderRequest;
@ -12,6 +12,7 @@ import com.glxp.api.res.purchase.PurPlanResponse;
import java.util.List;
public interface PurOrderService {
PurOrderEntity selectById(Long id);
List<PurOrderResponse> queryPageList(PurOrderRequest purOrderRequest);

@ -3,6 +3,7 @@ package com.glxp.api.service.purchase.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.purchase.PurOrderDao;
import com.glxp.api.dao.purchase.PurPlanDao;
import com.glxp.api.entity.inout.PurReceiveEntity;
import com.glxp.api.entity.purchase.PurOrderEntity;
import com.glxp.api.entity.purchase.PurPlanEntity;
import com.glxp.api.req.purchase.PurOrderRequest;
@ -25,6 +26,11 @@ public class PurOrderServiceImpl implements PurOrderService {
@Resource
PurOrderDao purOrderDao;
@Override
public PurOrderEntity selectById(Long id) {
return purOrderDao.selectById(id);
}
@Override
public List<PurOrderResponse> queryPageList(PurOrderRequest purOrderRequest) {
if (purOrderRequest == null) {

@ -36,7 +36,7 @@ public class AsyncSpsTask implements SchedulingConfigurer {
scheduledRequest.setCronName("syncIdcSps");
logger.info("syncIdcSps----------------");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
String cron = scheduledEntity != null ? scheduledEntity.getCron() : "0 0/3 * * * ?";
String cron = scheduledEntity != null ? scheduledEntity.getCron() : "0 0/50 * * * ?";
if (cron.isEmpty()) {
logger.error("cron is null");

Loading…
Cancel
Save