| | |
| | | package com.matrix.system.hive.service.imp; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.google.common.collect.Lists; |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.pojo.VerifyResult; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.ServiceOrderListDto; |
| | | import com.matrix.system.app.vo.ServiceOrderListVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.service.BusParameterSettingService; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | BusParameterSettingService busParameterSettingService; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsAssembleDao goodsAssembleDao; |
| | | |
| | | /** |
| | | * 新增服务单 jyy |
| | |
| | | lastList.add(lastWork); |
| | | } |
| | | LastestWorkBeatuistaffDao.batchInsert(lastList); |
| | | return sysProjServicesDao.update(projServices); |
| | | int i = sysProjServicesDao.update(projServices); |
| | | |
| | | //根据配置是否完成自动配料 |
| | | if (busParameterSettingService.isSettingOpen(AppConstance.OPEN_SERVICE_ORDER_AUTO_BATCHING, checkProjServices.getCompanyId())){ |
| | | autoBatching(projServices); |
| | | } |
| | | |
| | | |
| | | return i; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据配置是否完成自动配料 |
| | | * |
| | | * @param projServices |
| | | */ |
| | | private void autoBatching(SysProjServices projServices) { |
| | | |
| | | //获取最新的服务单信息 |
| | | projServices=findById(projServices.getId()); |
| | | List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); |
| | | |
| | | |
| | | List<SysOutStoreItem> outStoreItemList = Lists.newLinkedList(); |
| | | beauticianStateList.stream().forEach(item -> { |
| | | |
| | | List<ShoppingGoodsAssemble> shoppingGoodsAssembles = goodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getProjId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP); |
| | | |
| | | if (CollUtil.isNotEmpty(shoppingGoodsAssembles)) { |
| | | outStoreItemList.addAll(shoppingGoodsAssembles.stream().map(assemble -> { |
| | | SysOutStoreItem outStoreItem = new SysOutStoreItem(); |
| | | outStoreItem.setSkuId(assemble.getAssembleGoodId()); |
| | | outStoreItem.setAmount(Double.parseDouble(assemble.getTotal()+"")); |
| | | outStoreItem.setRemark("自动配料"); |
| | | return outStoreItem; |
| | | }).collect(Collectors.toList())); |
| | | } |
| | | }); |
| | | //组合配料参数 |
| | | projServices.setOutStoreItem(outStoreItemList); |
| | | //调用配料出库方法 |
| | | modifyPLProjServices(projServices); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |