|
|
|
@ -312,6 +312,41 @@ public class StBuyOrderServiceImpl extends BaseServiceImpl<StBuyOrderMapper, StB |
|
|
|
baseMapper.updateById(oldBuyOrder); |
|
|
|
baseMapper.updateById(oldBuyOrder); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Long buyOrderApplyFor(String goodsCode, Double buyQty, Long userId, Date buyDate, Long checkUserId, Date checkDate) throws Exception{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StGoods goods = stGoodsService.queryByCode(goodsCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StBuyOrder bo = new StBuyOrder(); |
|
|
|
|
|
|
|
bo.setBoCode(this.nextCode()); |
|
|
|
|
|
|
|
bo.setGoodsId(goods.getId()); |
|
|
|
|
|
|
|
bo.setGrade(goods.getGrade()); |
|
|
|
|
|
|
|
bo.setBuyMan(userId); |
|
|
|
|
|
|
|
User user = userClient.userInfoById(userId).getData(); |
|
|
|
|
|
|
|
bo.setBuyDept(Long.valueOf(user.getDeptId())); |
|
|
|
|
|
|
|
bo.setDeclareMan(userId); |
|
|
|
|
|
|
|
bo.setNeedDept(Long.valueOf(user.getDeptId())); |
|
|
|
|
|
|
|
bo.setDeclareDate(buyDate); |
|
|
|
|
|
|
|
bo.setNeedDate(buyDate); |
|
|
|
|
|
|
|
bo.setBoStatus(StBuyOrder.BOSTATUS_NEW); |
|
|
|
|
|
|
|
bo.setCreateUser(userId); |
|
|
|
|
|
|
|
bo.setCreateTime(buyDate); |
|
|
|
|
|
|
|
bo.setBoStatus(StBuyOrder.BOSTATUS_SUBMIT); |
|
|
|
|
|
|
|
bo.setPlanArea("洛阳新区"); |
|
|
|
|
|
|
|
bo.setCheckDate(checkDate); |
|
|
|
|
|
|
|
bo.setCheckMan(checkUserId); |
|
|
|
|
|
|
|
bo.setBuyQty(buyQty); |
|
|
|
|
|
|
|
bo.setApprovalStatus(StBuyOrder.APPROVAL_STATUS_CHECKED); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.save(bo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<StBuyOrder> list = new ArrayList<>(); |
|
|
|
|
|
|
|
list.add(bo); |
|
|
|
|
|
|
|
this.purOtherRest(list, userId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return bo.getId(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public StBuyOrder getByExtraBill(String extraBill) { |
|
|
|
public StBuyOrder getByExtraBill(String extraBill) { |
|
|
|
return baseMapper.getByExtraBill(extraBill); |
|
|
|
return baseMapper.getByExtraBill(extraBill); |
|
|
|
} |
|
|
|
} |
|
|
|
|