| | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | 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.dao.UtilDao; |
| | | import com.matrix.system.common.service.BusParameterSettingService; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.common.tools.ServiceUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.TableMapping; |
| | | import com.matrix.system.enums.BooleanEnum; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.hive.bean.SysBeauticianState; |
| | | import com.matrix.system.hive.bean.SysBedState; |
| | | import com.matrix.system.hive.bean.SysProjServices; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysOrderDao; |
| | | import com.matrix.system.hive.dao.SysOrderItemDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopOrderDetails; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.mqTask.OrderDingDingNoticeTask; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 测试类示例 |
| | |
| | | @Autowired |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao vipDap; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao vipDao; |
| | |
| | | @Autowired |
| | | private ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | @Autowired |
| | | SysBedStateDao sysBedStateDao; |
| | | @Autowired |
| | | private SysProjServicesDao sysProjServicesDao; |
| | | |
| | | @Autowired |
| | | private SysBedStateDao bedStateDao; |
| | | |
| | | @Autowired |
| | | private SysBeauticianStateDao beauticianStateDao; |
| | | |
| | | @Autowired |
| | | TaiYanAliyunSmsService taiYanAliyunSmsService; |
| | | |
| | | @Autowired |
| | | ServicesFlowDao servicesFlowDao; |
| | | |
| | | @Autowired |
| | | SysUsersDao userDao; |
| | | |
| | | @Autowired |
| | | ShoppingGoodsAssembleDao shoppingGoodsAssembleDao; |
| | | |
| | | @Autowired |
| | | BusParameterSettingService busParameterSettingService; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | ShoppingGoodsAssembleDao goodsAssembleDao; |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | @Autowired |
| | | private UtilDao utilDao; |
| | | |
| | | @Autowired |
| | | private ServiceUtil serviceUtil; |
| | | |
| | | @Test |
| | | public void testQuChong(){ |
| | | boolean b = serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", "18229856946", |
| | | "company_id", 17); |
| | | System.out.println("___________" + b); |
| | | } |
| | | |
| | | private HashMap<String, Object> excuteTow(String tableName, String column1, Object value1, String column2, |
| | | Object value2) { |
| | | HashMap<String, Object> query = new HashMap<>(MatrixConstance.COLLECTION_SIZE); |
| | | query.put("tableName", tableName); |
| | | query.put("column1", column1); |
| | | query.put("value1", value1); |
| | | query.put("column2", column2); |
| | | query.put("value2", value2); |
| | | query = (HashMap<String, Object>) utilDao.selectRepeatTowColumn(query); |
| | | return query; |
| | | } |
| | | |
| | | @Test |
| | | public void testServiceError(){ |
| | | SysProjServices projServices = new SysProjServices(); |
| | | projServices.setId(12948L); |
| | | |
| | | SysProjServices checkprojServices = sysProjServicesDao.selectById(projServices.getId()); |
| | | if (!checkprojServices.getState().equals(Dictionary.SERVICE_STATU_FWZ)) { |
| | | throw new GlobleException("该服务单状态为" + checkprojServices.getState() + ",不可以进行当前操作!"); |
| | | } |
| | | SysBeauticianState checkBeauticianState = new SysBeauticianState(); |
| | | checkBeauticianState.setServicesId(projServices.getId()); |
| | | checkBeauticianState.setState(Dictionary.BEATUI_STATE_FWJS); |
| | | int rerunlt = beauticianStateDao.chengItemState(checkBeauticianState); |
| | | |
| | | // 验证是否是最后一个美疗师结束服务 |
| | | boolean isOver = true; |
| | | List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(checkprojServices.getId()); |
| | | for (SysBeauticianState beauticianState : beauticianStateList) { |
| | | if (!beauticianState.getState().equals(Dictionary.BEATUI_STATE_FWJS)) { |
| | | isOver = false; |
| | | break; |
| | | } |
| | | } |
| | | if (isOver) { |
| | | // 释放床位资源 |
| | | SysBedState checkBedState = sysBedStateDao.selectBySerIdAndBedId(checkprojServices.getBedId(), checkprojServices.getId()); |
| | | if (checkBedState != null) { |
| | | checkBedState.setBedState(Dictionary.BED_STATE_SYJS); |
| | | bedStateDao.update(checkBedState); |
| | | } |
| | | checkprojServices.setEndTime(new Date()); |
| | | // 计算时差 |
| | | long minspace = DateUtil.getDifTimeMin(checkprojServices.getStartTime(), checkprojServices.getEndTime()) |
| | | - checkprojServices.getTotalTime(); |
| | | // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 |
| | | checkprojServices.setIsOverTime(minspace + ""); |
| | | checkprojServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | sysProjServicesDao.update(checkprojServices); |
| | | } |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(checkprojServices.getCompanyId(), checkprojServices.getShopId(),1028L, |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_END, |
| | | checkprojServices.getId(), |
| | | checkprojServices.getServiceNo(), |
| | | checkprojServices.getVipId()); |
| | | } |
| | | |
| | | public boolean isSettingOpen(String settingKey,Long companyId) { |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(settingKey, companyId); |
| | | return ( |
| | | Objects.nonNull(busParameterSettings) |
| | | && StringUtils.isNotBlank(busParameterSettings.getParamValue()) |
| | | // && AppConstance.IS_Y.equals(busParameterSettings.getParamValue()) |
| | | && BooleanEnum.TRUE.getValue() == busParameterSettings.getIntParamValue() |
| | | ); |
| | | } |
| | | |
| | | @Test |
| | | public void testBoolean(){ |
| | | boolean settingOpen = isSettingOpen(AppConstance.OPEN_SERVICE_ORDER_AUTO_BATCHING, 17L); |
| | | System.out.println("----------------------------"+settingOpen); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | @Rollback |