This commit is contained in:
huadengwu 2024-07-05 10:52:51 +08:00
parent a2fb573f5c
commit bdb88eeba8
2 changed files with 11 additions and 17 deletions

View File

@ -6536,3 +6536,6 @@ INSERT INTO `jjjerp_upload_group` VALUES (7, 'image', '11', 0, 0, 10001, '2023-0
INSERT INTO `jjjerp_upload_group` VALUES (8, 'image', '2', 0, 1, 10001, '2024-05-07 14:42:50', '2024-05-07 14:42:53'); INSERT INTO `jjjerp_upload_group` VALUES (8, 'image', '2', 0, 1, 10001, '2024-05-07 14:42:50', '2024-05-07 14:42:53');
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE `jjjerp_bill_head`
MODIFY COLUMN `file_urls` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '附件内容' AFTER `print_remark`;

View File

@ -717,17 +717,17 @@ public class BillHeadServiceImpl extends BaseServiceImpl<BillHeadMapper, BillHea
AdminUser sales = shopUserService.getById(head.getSalesId()); AdminUser sales = shopUserService.getById(head.getSalesId());
if(sales != null){ if(sales != null){
//业务员名称 //业务员名称
head.setSalesName(sales.getRealName()); head.setSalesName(sales.getUserName());
} }
AdminUser audit = shopUserService.getById(head.getAuditId()); AdminUser audit = shopUserService.getById(head.getAuditId());
if(audit != null){ if(audit != null){
//审核员名称 //审核员名称
head.setAuditName(audit.getRealName()); head.setAuditName(audit.getUserName());
} }
AdminUser creator = shopUserService.getById(head.getCreatorId()); AdminUser creator = shopUserService.getById(head.getCreatorId());
if(creator != null){ if(creator != null){
//创建人名称 //创建人名称
head.setCreatorName(creator.getRealName()); head.setCreatorName(creator.getUserName());
} }
if(BillTypeEnum.CGRKD.getValue().equals(head.getBillType())){ if(BillTypeEnum.CGRKD.getValue().equals(head.getBillType())){
//业务类型,1直接采购入库,2订单采购入库 //业务类型,1直接采购入库,2订单采购入库
@ -1440,7 +1440,7 @@ public class BillHeadServiceImpl extends BaseServiceImpl<BillHeadMapper, BillHea
throw new BusinessException("商品Id不能为空"); throw new BusinessException("商品Id不能为空");
} }
if(item.getProductExtendId() == null){ if(item.getProductExtendId() == null){
throw new BusinessException("商品扩展id不能为空"); throw new BusinessException("商品规格id不能为空");
} }
if(item.getBasicNumber() == null){ if(item.getBasicNumber() == null){
throw new BusinessException("操作总数量不能为空"); throw new BusinessException("操作总数量不能为空");
@ -1666,7 +1666,7 @@ public class BillHeadServiceImpl extends BaseServiceImpl<BillHeadMapper, BillHea
item.setBillType(oldHead.getBillType()); item.setBillType(oldHead.getBillType());
//检查商品属性 //检查商品属性
this.checkItem(item); this.checkItem(item);
if(item.getIsDelete() != null && item.getIsDelete() == 0){ if(item.getIsDelete() != null && item.getIsDelete() == 0 && item.getAllPrice() != null){
totalPrice = totalPrice.add(item.getAllPrice()); totalPrice = totalPrice.add(item.getAllPrice());
} }
totalNum = totalNum + item.getBasicNumber(); totalNum = totalNum + item.getBasicNumber();
@ -1742,11 +1742,10 @@ public class BillHeadServiceImpl extends BaseServiceImpl<BillHeadMapper, BillHea
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean auditMarketOrder(BillHead head) { public boolean auditMarketOrder(BillHead head) {
AdminUser adminUser = shopUserService.getById(ShopLoginUtil.getUserId()); AdminUser adminUser = shopUserService.getById(ShopLoginUtil.getUserId());
//是否为超级管理员0不是,1是
if(!adminUser.getIsSuper()){
throw new BusinessException("只有超管有审批权限");
}
BillHead oldHead = this.getById(head.getBillId()); BillHead oldHead = this.getById(head.getBillId());
if(oldHead == null){
throw new BusinessException("单据不能为空");
}
//审核状态0未审核1审核通过,2审核拒绝 //审核状态0未审核1审核通过,2审核拒绝
if(oldHead.getAuditStatus() != 10){ if(oldHead.getAuditStatus() != 10){
throw new BusinessException("只有待审核订单才能审核"); throw new BusinessException("只有待审核订单才能审核");
@ -1774,10 +1773,6 @@ public class BillHeadServiceImpl extends BaseServiceImpl<BillHeadMapper, BillHea
//售后类型(10退货退款 20换货 30退款 40补发 50 维修 60 其他) //售后类型(10退货退款 20换货 30退款 40补发 50 维修 60 其他)
.set(BillHead::getRefundType, oldHead.getRefundType()) .set(BillHead::getRefundType, oldHead.getRefundType())
); );
//是否为超级管理员0不是,1是
if(!adminUser.getIsSuper()){
throw new BusinessException("只有超管有审批权限");
}
//审核状态0未审核1审核通过,2审核拒绝 //审核状态0未审核1审核通过,2审核拒绝
if(oldHead.getAuditStatus() != 10){ if(oldHead.getAuditStatus() != 10){
throw new BusinessException("只有待审核订单才能审核"); throw new BusinessException("只有待审核订单才能审核");
@ -1879,10 +1874,6 @@ public class BillHeadServiceImpl extends BaseServiceImpl<BillHeadMapper, BillHea
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean auditOrder(BillHead head) { public boolean auditOrder(BillHead head) {
AdminUser adminUser = shopUserService.getById(ShopLoginUtil.getUserId()); AdminUser adminUser = shopUserService.getById(ShopLoginUtil.getUserId());
//是否为超级管理员0不是,1是
if(!adminUser.getIsSuper()){
throw new BusinessException("只有超管有审批权限");
}
BillHead oldHead = this.getById(head.getBillId()); BillHead oldHead = this.getById(head.getBillId());
//审核状态0未审核1审核通过,2审核拒绝 //审核状态0未审核1审核通过,2审核拒绝
if(oldHead.getAuditStatus() != 10){ if(oldHead.getAuditStatus() != 10){