示例#1
0
 /** 保存明细数据 */
 private void addDetails(Context context, Instorage entity, List<InstorageItem> detailList)
     throws Exception {
   if (null == detailList || detailList.isEmpty()) {
     throw new Exception("生成入库单失败(明细数据缺失)");
   }
   for (InstorageItem det : detailList) {
     det.setSheetId(entity.getRECID());
     det.setId(context.newRECID());
     context.handle(new InstorageItemTask(det), Method.INSERT);
   }
 }
示例#2
0
 /** 对一个入库单实体添加基础数据 */
 private void fillEntity(Context context, Instorage entity, String type) {
   Login login = context.find(Login.class);
   Employee emp = context.find(Employee.class, login.getEmployeeId());
   entity.setRECID(context.newRECID());
   entity.setSheetType(type);
   entity.setCreateDate(new Date().getTime());
   if (CheckIsNull.isNotEmpty(entity.getPartnerId())) {
     Partner partner = context.find(Partner.class, entity.getPartnerId());
     if (null != partner) {
       entity.setPartnerName(partner.getName());
       entity.setPartnerShortName(partner.getShortName());
       entity.setPartnerCode(partner.getCode());
     }
   }
   Store store = context.find(Store.class, entity.getStoreId());
   if (null != store) {
     entity.setStoreName(store.getName());
     entity.setStoreNamePY(PinyinHelper.getLetter(store.getName()));
   }
   if (CheckingInType.Irregular.getCode().equals(type)
       || CheckingInType.Kit.getCode().equals(type)) {
     entity.setCreatorId(login.getEmployeeId());
     entity.setCreator(emp.getName());
   }
 }