Merge remote-tracking branch 'origin/hive2.0' into hive2.0
# Conflicts:
#	zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/MoneyCardUseMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/QuestionMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/SysBeauticianStateMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/SysProjUseMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/SysSkinCheckRecordMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/SysStoreInfoMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/SysUsersMapperImpl.java
#	zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/SysWorkBeatuistaffMapperImpl.java
 
	
	
	
	
	
	
		
		8 files deleted
	
		
		31 files modified
	
	
 
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.Arrays; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |         if (CollectionUtils.isNotEmpty(serviceTcVos)) { | 
 |  |  |             serviceTcVos.forEach(item -> { | 
 |  |  |                 List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId()); | 
 |  |  |                 List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); | 
 |  |  |                 List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(sysProjUses); | 
 |  |  |                 item.setProj(taocanProj); | 
 |  |  |             }); | 
 
 |  |  | 
 |  |  |     @ApiModelProperty(value = "头像") | 
 |  |  |     private String photo; | 
 |  |  |  | 
 |  |  |     @Length(max = 10, min = 1) | 
 |  |  |     @ApiModelProperty(value = "会员编号") | 
 |  |  |     private String vipNo; | 
 |  |  |  | 
 |  |  | 
 |  |  |     @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") | 
 |  |  |     private Date birthday; | 
 |  |  |  | 
 |  |  |     @Length(max = 6,message = "资金密码为6位数") | 
 |  |  |     @ApiModelProperty(value = "资金密码", example = "123456") | 
 |  |  |     private String password; | 
 |  |  |  | 
 
 |  |  | 
 |  |  |     @Resource | 
 |  |  |     private SysVipInfoService vipInfoService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     @Resource | 
 |  |  |     private MoneyCardUseFlowDao moneyCardUseFlowDao; | 
 |  |  |     @Autowired | 
 |  |  |  | 
 |  |  |     @Resource | 
 |  |  |     private   MoneyCardUseDao moneyCardUseDao; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |     @RequestMapping(value = "/editFormCz") | 
 |  |  |     public String editFormCz(Long id) { | 
 |  |  |         MoneyCardUse cardUseInfo = cardUseService.findByVipId(id); | 
 |  |  |  | 
 |  |  |         if (cardUseInfo == null) { | 
 |  |  |             cardUseInfo = new MoneyCardUse(); | 
 |  |  |             cardUseInfo.setVipId(id); | 
 |  |  |             cardUseInfo.setCardName("储值卡"); | 
 |  |  |             cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); | 
 |  |  |             cardUseInfo.setRealMoney(0D); | 
 |  |  |             cardUseInfo.setGiftMoney(0D); | 
 |  |  |             cardUseInfo.setSource("-"); | 
 |  |  |             cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); | 
 |  |  |             cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); | 
 |  |  |             moneyCardUseDao.insert(cardUseInfo); | 
 |  |  |             cardUseInfo=vipInfoService.addVipDefaultCard(id); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         WebUtil.getRequest().setAttribute("obj", cardUseInfo); | 
 |  |  |         return "admin/hive/beautySalon/cz-form"; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_FAIL, "冻结失败"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @RequestMapping(value = "getEffectCard") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult getEffectCard(MoneyCardUse moneyCardUse) { | 
 |  |  |         AjaxResult result = AjaxResult.buildSuccessInstance(""); | 
 |  |  |         //要退款的充值卡 | 
 |  |  |         MoneyCardUse srcCardUse = cardUseService.findById(moneyCardUse.getId()); | 
 |  |  |         if (!srcCardUse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX)) { | 
 |  |  |             throw new GlobleException("不是有效充值卡"); | 
 |  |  |         } | 
 |  |  |         //该会员是否有有效会籍卡 | 
 |  |  |         MoneyCardUse targetCardUse = cardUseService.findByVipId(moneyCardUse.getVipId()); | 
 |  |  |  | 
 |  |  |         double money = srcCardUse.getRealMoney(); | 
 |  |  |  | 
 |  |  |         if (targetCardUse != null) { | 
 |  |  |             targetCardUse.setRealMoney(money); | 
 |  |  |             List<MoneyCardUse> list = Arrays.asList(targetCardUse); | 
 |  |  |  | 
 |  |  |             if (targetCardUse.getId().equals(srcCardUse.getId())) { | 
 |  |  |                 result.setInfo("会籍卡退款只能退现金"); | 
 |  |  |                 result.setRows(list); | 
 |  |  |  | 
 |  |  |             } else { | 
 |  |  |                 result.setInfo("有有效会籍卡"); | 
 |  |  |                 result.setRows(list); | 
 |  |  |             } | 
 |  |  |         } else { | 
 |  |  |             //无会员卡则new一个,为了把钱传递到前台 | 
 |  |  |             targetCardUse = new MoneyCardUse(); | 
 |  |  |             targetCardUse.setRealMoney(money); | 
 |  |  |             List<MoneyCardUse> list1 = Arrays.asList(targetCardUse); | 
 |  |  |             result.setInfo("无有效会籍卡,退现金"); | 
 |  |  |             result.setRows(list1); | 
 |  |  |         } | 
 |  |  |         return result; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/returnMoney") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult returnMoney(MoneyCardUse moneyCardUse, Long hjkId, String tcRemark, Long | 
 |  |  |             shopId, Double money | 
 |  |  |             , String tcName) { | 
 |  |  |         int i = cardUseService.returnMoney(moneyCardUse, hjkId); | 
 |  |  |         if (i > 0) { | 
 |  |  |             return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); | 
 |  |  |         } | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_FAIL, "冻结失败"); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         MoneyCardUse cardUseInfo = cardUseService.findByVipId(order.getVipId()); | 
 |  |  |  | 
 |  |  |         if (cardUseInfo == null) { | 
 |  |  |             cardUseInfo = new MoneyCardUse(); | 
 |  |  |             cardUseInfo.setVipId(order.getVipId()); | 
 |  |  |             cardUseInfo.setCardName("储值卡"); | 
 |  |  |             cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); | 
 |  |  |             cardUseInfo.setRealMoney(0D); | 
 |  |  |             cardUseInfo.setGiftMoney(0D); | 
 |  |  |             cardUseInfo.setSource("-"); | 
 |  |  |             cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); | 
 |  |  |             cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); | 
 |  |  |             moneyCardUseDao.insert(cardUseInfo); | 
 |  |  |             cardUseInfo=sysVipInfoService.addVipDefaultCard(order.getVipId()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         //打印需求加入门店信息 | 
 
 |  |  | 
 |  |  | import com.matrix.system.constance.Dictionary; | 
 |  |  | import com.matrix.system.hive.bean.*; | 
 |  |  | import com.matrix.system.hive.dao.*; | 
 |  |  | import com.matrix.core.tools.DateUtil; | 
 |  |  | import com.matrix.system.hive.pojo.TaoCanVo; | 
 |  |  | import com.matrix.system.hive.service.*; | 
 |  |  | import org.apache.commons.collections.CollectionUtils; | 
 |  |  | import org.jsoup.helper.DataUtil; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Controller; | 
 |  |  | import org.springframework.ui.ModelMap; | 
 |  |  | 
 |  |  |         queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); | 
 |  |  |         List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); | 
 |  |  |         taoCanList.forEach(item->{ | 
 |  |  |             item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId())); | 
 |  |  |             item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus())); | 
 |  |  |             item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId())); | 
 |  |  |         }); | 
 |  |  |         result.putInMap("projList", projList); | 
 
 |  |  | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_FAIL, "项目转让失败"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/returnProj") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult returnTc(SysProjUse sysProjUse, Long moneyCardUseId, String tcRemark, Long shopId, Double money, String tcName) { | 
 |  |  |  | 
 |  |  |         MoneyCardUse card = null; | 
 |  |  |         if (moneyCardUseId != null) { | 
 |  |  |             card = moneyCardUseService.findById(moneyCardUseId); | 
 |  |  |         } | 
 |  |  |         int i = projUseService.returnMoneyProj(sysProjUse, card, moneyCardUseId); | 
 |  |  |         if (i > 0) { | 
 |  |  |  | 
 |  |  |             return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); | 
 |  |  |         } | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_FAIL, "退款失败"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @RequestMapping(value = "/getEffectCard") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult getEffectCard(SysProjUse sysProjUse) { | 
 |  |  |         MoneyCardUse cardUse = moneyCardUseService.findByVipId(sysProjUse.getVipId()); | 
 |  |  |         double money = projUseService.getTotalMoneyProj(sysProjUse); | 
 |  |  |         if (cardUse != null) { | 
 |  |  |             cardUse.setRealMoney(money); | 
 |  |  |             List<MoneyCardUse> list = new ArrayList<MoneyCardUse>(); | 
 |  |  |             list.add(cardUse); | 
 |  |  |             return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, "有有效会籍卡", list, null); | 
 |  |  |         } else { | 
 |  |  |             //无会员卡则new一个,为了把钱传递到前台 | 
 |  |  |             cardUse = new MoneyCardUse(); | 
 |  |  |             cardUse.setRealMoney(money); | 
 |  |  |             List<MoneyCardUse> list = new ArrayList<MoneyCardUse>(); | 
 |  |  |             list.add(cardUse); | 
 |  |  |             return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, "无有效会籍卡", list, null); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 冻结会员项目 | 
 
 |  |  | 
 |  |  |         List<SysProjUse> projUseList =sysProjUseService.findInPage(sysProjUse,null); | 
 |  |  |         //设置套餐中的项目 | 
 |  |  |         projUseList.forEach(taocanProjUse -> { | 
 |  |  |             taocanProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(taocanProjUse.getId())); | 
 |  |  |             taocanProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(taocanProjUse.getId(),sysProjUse.getStatus())); | 
 |  |  |         }); | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_SUCCESS, projUseList, sysProjUseService.findTotal(sysProjUse)); | 
 |  |  |     } | 
 |  |  | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_FAIL, "套餐转让失败"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/returnTc") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult returnTc(SysProjUse sysProjUse, Long moneyCardUseId, String tcRemark, Long shopId, Double money, String tcName) { | 
 |  |  |  | 
 |  |  |         System.out.println("moneyCardUseId = " + moneyCardUseId); | 
 |  |  |         MoneyCardUse card = moneyCardUseService.findById(moneyCardUseId); | 
 |  |  |         System.out.println("card = " + card); | 
 |  |  |         int i = sysProjUseService.returnMoneyTc(sysProjUse, card, moneyCardUseId); | 
 |  |  |         if (i > 0) { | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); | 
 |  |  |         } | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_FAIL, "退款失败"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/getEffectCard") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult getEffectCard(SysProjUse sysProjUse) { | 
 |  |  | 
 |  |  |     public String editForm(Long id) { | 
 |  |  |         if (id != null) { | 
 |  |  |             SysProjUse sysProjUse = sysProjUseService.findById(id); | 
 |  |  |             sysProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(sysProjUse.getId())); | 
 |  |  |             sysProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(sysProjUse.getId(), sysProjUse.getStatus())); | 
 |  |  |             WebUtil.getRequest().setAttribute("obj", sysProjUse); | 
 |  |  |         } | 
 |  |  |         return "admin/hive/vip/tc-form"; | 
 
 |  |  | 
 |  |  |      */ | 
 |  |  |     private Long  goodsId; | 
 |  |  |              | 
 |  |  |     /** | 
 |  |  |      * 订单ID | 
 |  |  |      */ | 
 |  |  |     private Long  orderId; | 
 |  |  | 			 | 
 |  |  |      | 
 |  |  |     private Long  vipId; | 
 |  |  |              | 
 |  |  | 
 |  |  |     private String  isOver; | 
 |  |  |              | 
 |  |  |     /** | 
 |  |  |      * 是会籍卡? Y 是,N否 | 
 |  |  |      * 是默认储值卡? Y 是,N否 | 
 |  |  |      */ | 
 |  |  |     private String  isVipCar; | 
 |  |  |     /** | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     private String cardName; | 
 |  |  |  | 
 |  |  |     public Long getOrderId() { | 
 |  |  |         return orderId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setOrderId(Long orderId) { | 
 |  |  |         this.orderId = orderId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getCardName() { | 
 |  |  |         return cardName; | 
 |  |  |     } | 
 
 |  |  | 
 |  |  |     private Long orderItemId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 订单id | 
 |  |  |      */ | 
 |  |  |     @Extend | 
 |  |  |     private Long orderId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 单次扣减金额(理解为单次手工业绩) | 
 |  |  |      * =订单金额/订单数量 | 
 |  |  |      * 如果是赠送则等于产品原价,业绩记录为赠销 | 
 |  |  | 
 |  |  |     private String updateRemark; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public Long getOrderId() { | 
 |  |  |         return orderId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setOrderId(Long orderId) { | 
 |  |  |         this.orderId = orderId; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getUpdateRemark() { | 
 |  |  |         return updateRemark; | 
 |  |  |     } | 
 
 |  |  | 
 |  |  |      */ | 
 |  |  |     public void transfer(MoneyCardUse moneyCardUse, Long vipId2, Double money); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * jyy | 
 |  |  |      */ | 
 |  |  |     public int returnMoney(MoneyCardUse moneyCardUse, Long hjkId); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 设置为有效 | 
 
 |  |  | 
 |  |  |     public int invalidTc(SysProjUse sysProjUse); | 
 |  |  |      | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * @param sysProjUse | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public int returnMoneyTc(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 设置为有效套餐 | 
 |  |  |      * @param proj | 
 |  |  | 
 |  |  |      | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * @param sysProjUse | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public int returnMoneyProj(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId); | 
 |  |  |     /** | 
 |  |  |      * 设置为有效套餐 | 
 |  |  |      * @param proj | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public AjaxResult activeProj(SysProjUse proj); | 
 |  |  |     /** | 
 |  |  |      * 退款项目 | 
 |  |  |      * @param sysProjUse | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public double getTotalMoneyProj(SysProjUse sysProjUse); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public int updateProjUseTck(SysProjUse projUse); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public List<SysProjUse> selectTaocanProjUse(Long id); | 
 |  |  |     public List<SysProjUse> selectTaocanProjUse(Long id, String status); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import com.matrix.system.app.dto.VipInfoListDto; | 
 |  |  | import com.matrix.system.app.vo.VipInfoDetailVo; | 
 |  |  | import com.matrix.system.app.vo.VipInfoListVo; | 
 |  |  | import com.matrix.system.hive.bean.MoneyCardUse; | 
 |  |  | import com.matrix.system.hive.bean.SysVipInfo; | 
 |  |  | import com.matrix.system.hive.plugin.util.BaseServices; | 
 |  |  | import com.matrix.system.hive.pojo.VipInfoVo; | 
 |  |  |  | 
 |  |  | import java.io.File; | 
 |  |  | import java.io.IOException; | 
 |  |  | import java.io.UnsupportedEncodingException; | 
 |  |  | import java.security.NoSuchAlgorithmException; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |  */ | 
 |  |  | public interface SysVipInfoService  extends BaseServices<SysVipInfo>{ | 
 |  |  |  | 
 |  |  |     public  int addVipDefaultCard(Long vipId); | 
 |  |  |     public MoneyCardUse addVipDefaultCard(Long vipId); | 
 |  |  |     /** | 
 |  |  |      * 新增SysVipInfo | 
 |  |  |      *  | 
 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private SysVipLevelDao viplevelDao; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public int add(MoneyCardUse moneyCardUse) { | 
 |  |  |  | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     //退款 | 
 |  |  |     @Override | 
 |  |  |     public int returnMoney(MoneyCardUse moneyCardUse, Long hjkId) { | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         MoneyCardUse realObj = moneyCardUseDao.selectById(moneyCardUse.getId()); | 
 |  |  |  | 
 |  |  |         //检测商品是否已付款完成 | 
 |  |  |         if (realObj.getOrderItemId() != 1) {//不是数据迁移过来的判断付款状态 | 
 |  |  |             checkOrderStatu(realObj.getOrderItemId()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (!realObj.getStatus().equals(Dictionary.TAOCAN_STATUS_YX)) { | 
 |  |  |             throw new GlobleException("不是有效充值卡"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (realObj.getSource().contains(Dictionary.TAOCAN_SOURCE_ZR)) { | 
 |  |  |             throw new GlobleException("转让的充值卡不能退款"); | 
 |  |  |         } | 
 |  |  |         if (realObj.getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)) { | 
 |  |  |             throw new GlobleException("赠送的充值卡不能退款"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (Dictionary.FLAG_YES_Y.equals(realObj.getIsVipCar())) { | 
 |  |  |             //更新会员等级 | 
 |  |  |             realObj.getVipInfo().setLevelId(0L); | 
 |  |  |             infoDao.update(realObj.getVipInfo()); | 
 |  |  |         } | 
 |  |  |         StringBuilder content = new StringBuilder(); | 
 |  |  |  | 
 |  |  |         //有会籍卡退到会籍卡中,无则退了现金 | 
 |  |  |         if (hjkId != null && !hjkId.equals("")) { | 
 |  |  |             MoneyCardUse vipCard = moneyCardUseDao.selectById(hjkId); | 
 |  |  |             vipCard.setRealMoney(vipCard.getRealMoney() + realObj.getRealMoney()); | 
 |  |  |             moneyCardUseDao.update(vipCard); | 
 |  |  |             content.append(realObj.getCardName() + "退款¥" + realObj.getRealMoney() + "到会籍卡") | 
 |  |  |                     .append(vipCard.getCardName()) | 
 |  |  |                     .append(",余次:" + vipCard.getLastCountName()) | 
 |  |  |                     .append(",本金余额:" + vipCard.getRealMoney()) | 
 |  |  |                     .append(",有效期:" + DateUtil.dateToString(vipCard.getFailTime(), DateUtil.DATE_FORMAT_MM)) | 
 |  |  |                     .append(",是否赠送:" + vipCard.getSourceName()); | 
 |  |  |         } else { | 
 |  |  |             content.append(realObj.getCardName() + "退款现金¥" + moneyCardUse.getReturnMonery() + ""); | 
 |  |  |         } | 
 |  |  |         DecimalFormat df = new DecimalFormat("#.00"); | 
 |  |  |         double d = Double.valueOf(df.format(realObj.getRealMoney() - Double.valueOf(moneyCardUse.getReturnMonery()))); | 
 |  |  |         //退款的本金为零,状态为已退款 | 
 |  |  |         realObj.setRealMoney(d); | 
 |  |  |         //赠送金额也清零 | 
 |  |  |         realObj.setGiftMoney(0.0); | 
 |  |  |         if (d <= 0) { | 
 |  |  |             realObj.setStatus(Dictionary.TAOCAN_STATUS_TK); | 
 |  |  |         } | 
 |  |  |         int i = moneyCardUseDao.update(realObj); | 
 |  |  |         SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); | 
 |  |  |         //新增退款流水 | 
 |  |  |         return i; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     //设置为有效 | 
 |  |  |     @Override | 
 
 |  |  | 
 |  |  | import com.matrix.core.constance.MatrixConstance; | 
 |  |  | import com.matrix.core.exception.GlobleException; | 
 |  |  | import com.matrix.core.pojo.PaginationVO; | 
 |  |  | import com.matrix.core.tools.DateUtil; | 
 |  |  | import com.matrix.core.tools.StringUtils; | 
 |  |  | import com.matrix.core.tools.WebUtil; | 
 |  |  | import com.matrix.system.app.dto.OrderListDto; | 
 |  |  | 
 |  |  | import com.matrix.system.hive.bean.*; | 
 |  |  | import com.matrix.system.hive.dao.*; | 
 |  |  | import com.matrix.system.hive.plugin.util.CollectionUtils; | 
 |  |  | import com.matrix.core.tools.DateUtil; | 
 |  |  | import com.matrix.system.hive.plugin.util.MoneyUtil; | 
 |  |  | import com.matrix.system.hive.pojo.CzXkVo; | 
 |  |  | import com.matrix.system.hive.pojo.ShoppingCarItem; | 
 |  |  | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import javax.annotation.Resource; | 
 |  |  | import javax.servlet.http.HttpSession; | 
 |  |  | import javax.validation.constraints.NotEmpty; | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.Calendar; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.*; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @date 2016-07-03 20:53 | 
 |  |  | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public void updateReceiptMoney(SysOrder pageOrder) throws GlobleException { | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         if (!Dictionary.ORDER_STATU_DFK.equals(pageOrder.getStatu())) { | 
 |  |  |             throw new GlobleException("该订单已经收过款,请刷新页面再试!"); | 
 |  |  |         } | 
 |  |  | 
 |  |  |             sysVipInfoDao.update(vipInfo); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         //设置订单的成交状态 | 
 |  |  |         changeOrderStatu(pageOrder); | 
 |  |  |  | 
 |  |  |         // 设置会员充值卡使用情况 | 
 |  |  |         addMoneyCardUse(pageOrder); | 
 |  |  |  | 
 |  |  |         // 新增出库单 | 
 |  |  |         addOutStore(pageOrder); | 
 |  |  |  | 
 |  |  |         // 改变客户项目套餐使用情况 | 
 |  |  |         addTaocanProj(pageOrder); | 
 |  |  |  | 
 |  |  |         // 新增出库单 | 
 |  |  |         addOutStore(pageOrder); | 
 |  |  |  | 
 |  |  |         // 设置业绩 | 
 |  |  |         achieveNewService.addAchaeveByOrder(pageOrder); | 
 |  |  |  | 
 |  |  |         setShopSelCount(pageOrder); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 收款改变订单状态,划扣金额 | 
 |  |  |      * | 
 |  |  |      * @author:姜友瑶 | 
 |  |  |      */ | 
 |  |  |     private void changeOrderStatu(SysOrder sourceOrder) { | 
 |  |  |         int i = 1; | 
 |  |  |  | 
 |  |  |         String orderStatus = Dictionary.ORDER_STATU_YFK; | 
 |  |  |         String flowType = SysOrderFlow.FLOW_TYPE_BUY; | 
 |  |  |         double cashPayTotal = 0D; | 
 |  |  |         double cardPayTotal = 0D; | 
 |  |  |  | 
 |  |  |         //处理支付流水 | 
 |  |  |         int flowCount = 1; | 
 |  |  |         for (SysOrderFlow flow : sourceOrder.getFlows()) { | 
 |  |  |             flow.setFlowNo(codeService.getFlowCode() + "-" + i); | 
 |  |  |  | 
 |  |  |             //支付内容摘要设置 | 
 |  |  |             Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); | 
 |  |  |             ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); | 
 |  |  |             flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); | 
 |  |  |  | 
 |  |  |             // 若是退款,则取负数 | 
 |  |  |             if (Dictionary.ORDER_STATU_TK.equals(sourceOrder.getStatu())) { | 
 |  |  |                 flowType = SysOrderFlow.FLOW_TYPE_REFUND; | 
 |  |  |                 // 若是退款,则取负数 | 
 |  |  |                 flow.setAmount(flow.getAmount().negate()); | 
 |  |  |                 flow.setOrderId(sourceOrder.getOldOrderId()); | 
 |  |  |             } else { | 
 |  |  |                 flow.setOrderId(sourceOrder.getId()); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             flow.setVipId(sourceOrder.getVipId()); | 
 |  |  |             flow.setFlowType(flowType); | 
 |  |  |             // 若使用储值卡付款 | 
 |  |  |             if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { | 
 |  |  |                 if (flow.getCardId() != null) { | 
 |  |  |                     MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); | 
 |  |  |                     cardPaySk(moneyCardUse, sourceOrder, flow); | 
 |  |  |                     cardPayTotal += flow.getAmount().doubleValue(); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             //欠款处理 | 
 |  |  |             if (SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod())) { | 
 |  |  |                 orderStatus = Dictionary.ORDER_STATU_QK; | 
 |  |  |                 sourceOrder.setArrears(flow.getAmount().doubleValue()); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             if (!SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod()) && !SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { | 
 |  |  |             //统计储值卡支付 | 
 |  |  |             if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { | 
 |  |  |                 if (flow.getCardId() != null) { | 
 |  |  |                     MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); | 
 |  |  |                     cardPayTotal += flow.getAmount().doubleValue(); | 
 |  |  |  | 
 |  |  |                     //修改储值卡余额 | 
 |  |  |                     cardPaySk(moneyCardUse, sourceOrder, flow); | 
 |  |  |                 }else{ | 
 |  |  |                     throw new GlobleException("无效的储值卡支付方式"); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             //统计现金支付 | 
 |  |  |             if (!SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod()) | 
 |  |  |                     && !SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { | 
 |  |  |                 cashPayTotal += flow.getAmount().doubleValue(); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             flow.setFlowNo(codeService.getFlowCode() + "-" + flowCount); | 
 |  |  |             flow.setVipId(sourceOrder.getVipId()); | 
 |  |  |             flow.setFlowType(flowType); | 
 |  |  |             flow.setShopId(sourceOrder.getShopId()); | 
 |  |  |             flow.setCompanyId(sourceOrder.getCompanyId()); | 
 |  |  |             sysOrderFlowDao.insert(flow); | 
 |  |  |             i++; | 
 |  |  |             flowCount++; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         //修改订单信息 | 
 |  |  |         if (Dictionary.ORDER_STATU_TK.equals(sourceOrder.getStatu())) { | 
 |  |  |             orderStatus = Dictionary.ORDER_STATU_TK; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 更新收款状态 | 
 |  |  |         sourceOrder.setStatu(orderStatus); | 
 |  |  |         sourceOrder.setCardPay(cardPayTotal); | 
 |  |  | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |                     moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_GM); | 
 |  |  |                     moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); | 
 |  |  |                     moneyCardUse.setCardName(moneyCar.getName()); | 
 |  |  |  | 
 |  |  |                     if (Dictionary.FLAG_YES.equals(moneyCar.getCarIsAll())) { | 
 |  |  |                         moneyCardUse.setIsVipCar(Dictionary.FLAG_YES_Y); | 
 |  |  |                     } else { | 
 |  |  |                         // 非会籍卡 | 
 |  |  |                         moneyCardUse.setIsVipCar(Dictionary.FLAG_NO_N); | 
 |  |  |                     } | 
 |  |  |                     moneyCardUse.setVipId(sourceOrder.getVipId()); | 
 |  |  |  | 
 |  |  |                     // 是否为赠送 | 
 |  |  |                     if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_YES)) { | 
 |  |  | 
 |  |  |                     } else { | 
 |  |  |                         moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_GM); | 
 |  |  |                     } | 
 |  |  |                     //余次处理 | 
 |  |  |                     if (moneyCar.getCarUseCount() == null || moneyCar.getCarUseCount() == 0) { | 
 |  |  |                         moneyCardUse.setUseTotal(999999999); | 
 |  |  |                         moneyCardUse.setLastCount(999999999); | 
 |  |  | 
 |  |  |                         moneyCardUse.setUseTotal(moneyCar.getCarUseCount()); | 
 |  |  |                         moneyCardUse.setLastCount(moneyCar.getCarUseCount()); | 
 |  |  |                     } | 
 |  |  |                     moneyCardUse.setVipId(sourceOrder.getVipId()); | 
 |  |  |  | 
 |  |  |                     //失效时间处理 | 
 |  |  |                     Date invalidTime = shoppingGoodsService.calInvalidTime(sysOrderItem.getShoppingGoods(), 1, null); | 
 |  |  |                     moneyCardUse.setFailTime(invalidTime); | 
 |  |  |  | 
 |  |  | 
 |  |  |                 if (sum < outStoreItem.getAmount()) { | 
 |  |  |                     ShoppingGoods sysGoods = shoppingGoodsDao.selectById(outStoreItem.getSkuId()); | 
 |  |  |                     if (sysGoods != null) { | 
 |  |  |                         throw new GlobleException("出库失败:【" + sysGoods.getName()+"-"+sysGoods.getCode()+  "库存不足】"); | 
 |  |  |                         throw new GlobleException("出库失败:【" + sysGoods.getName() + "库存不足】"); | 
 |  |  |                     } else { | 
 |  |  |                         throw new GlobleException("出库失败没有找到出库产品"); | 
 |  |  |                     } | 
 |  |  | 
 |  |  |             //综合卡中包含的项目 | 
 |  |  |             List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_XM); | 
 |  |  |             assembleList.forEach(item -> { | 
 |  |  |                 createProjuseByAssemble(order, sysOrderItem, item, null); | 
 |  |  |                 //TODO 补综合卡逻辑 | 
 |  |  |                 createProjuseByAssemble(order, sysOrderItem, item, null, null); | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |             //处理综合卡中包含的套餐 | 
 |  |  | 
 |  |  |      * 通过组合关系创建用户项目余次 | 
 |  |  |      */ | 
 |  |  |     private SysProjUse createProjuseByAssemble(SysOrder order, SysOrderItem sysOrderItem, | 
 |  |  |                                                ShoppingGoodsAssemble goodsAssemble, Long taocanId) { | 
 |  |  |                                                ShoppingGoodsAssemble goodsAssemble, Long taocanId, Date failTime) { | 
 |  |  |         //计算折扣 | 
 |  |  |         Double zk=sysOrderItem.getZkPrice()/sysOrderItem.getPrice(); | 
 |  |  |  | 
 |  |  | 
 |  |  |         } else { | 
 |  |  |             puse.setSource(Dictionary.TAOCAN_SOURCE_ZS); | 
 |  |  |         } | 
 |  |  |         // 设置失效时间 | 
 |  |  |         Calendar cal = Calendar.getInstance(); | 
 |  |  |         cal.set(2200, 1, 1); | 
 |  |  |         puse.setFailTime(cal.getTime()); | 
 |  |  |         puse.setFailTime(failTime); | 
 |  |  |         sysProjUseDao.insert(puse); | 
 |  |  |         return puse; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         //创建套餐绑定的项目 | 
 |  |  |         List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(projId, ShoppingGoods.SHOPPING_GOODS_TYPE_XM); | 
 |  |  |         for (ShoppingGoodsAssemble assemble : assembleList) { | 
 |  |  |             SysProjUse tempUse = createProjuseByAssemble(order, sysOrderItem, assemble, taocanProjUse.getId()); | 
 |  |  |             SysProjUse tempUse = createProjuseByAssemble(order, sysOrderItem, assemble, taocanProjUse.getId(),taocanProjUse.getFailTime()); | 
 |  |  |             sumBanance += tempUse.getBalance(); | 
 |  |  |             surplusCount+=tempUse.getSurplusCount(); | 
 |  |  |         } | 
 |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 会员卡充值 | 
 |  |  |      * | 
 |  |  |      * @param czVo | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public void refundOrderMoney(SysOrder pageOrder) { | 
 |  |  |         SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
 |  |  |         // 插入订单流水 | 
 |  |  |  | 
 |  |  |         // 修改订单状态 | 
 |  |  |         changeOrderStatu(pageOrder); | 
 |  |  |  | 
 |  |  |         List<SysOrderItem> returnItems = new ArrayList<>(); | 
 
 |  |  | 
 |  |  | import com.matrix.system.hive.bean.*; | 
 |  |  | import com.matrix.system.hive.dao.*; | 
 |  |  | import com.matrix.system.hive.plugin.util.CollectionUtils; | 
 |  |  | import com.matrix.core.tools.DateUtil; | 
 |  |  | import com.matrix.system.hive.plugin.util.MoneyUtil; | 
 |  |  | import com.matrix.system.hive.service.SysProjUseService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import javax.xml.crypto.Data; | 
 |  |  | import java.sql.Timestamp; | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  | 
 |  |  |         return i; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * cardUser暂时没有用到 | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public int returnMoneyTc(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId) { | 
 |  |  |         //充值记录 | 
 |  |  |         //SysRechargeFlow flow=new SysRechargeFlow(); | 
 |  |  |  | 
 |  |  |         // 计算出套餐所有项目的剩余次数的钱 | 
 |  |  |         getTotalMoney(sysProjUse, cardUse, moneyCardUseId); | 
 |  |  |         //3、套餐下的项目状态改为退款 | 
 |  |  |         sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_TK); | 
 |  |  |         int j = sysProjUseDao.updateProjStatus(sysProjUse); | 
 |  |  |  | 
 |  |  |         return j; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /*********************以下为项目使用情况操作***********************/ | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款 | 
 |  |  |      * | 
 |  |  |      * @param sysProjUse | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public int returnMoneyProj(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId) { | 
 |  |  |         int i = 0; | 
 |  |  |         sysProjUse = sysProjUseDao.selectById(sysProjUse.getId()); | 
 |  |  |         //判断套餐是否存在欠款 | 
 |  |  |         checkOrderStatu(sysProjUse); | 
 |  |  |         if (!(sysProjUse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX))) { | 
 |  |  |             throw new GlobleException("不是有效项目"); | 
 |  |  |         } | 
 |  |  |         if (sysProjUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZR)) { | 
 |  |  |             throw new GlobleException("转让的项目不能退款"); | 
 |  |  |         } | 
 |  |  |         if (sysProjUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZS)) { | 
 |  |  |             throw new GlobleException("赠送的项目不能退款"); | 
 |  |  |         } | 
 |  |  |         StringBuilder content = new StringBuilder(); | 
 |  |  |         ShoppingGoodsAssemble shoppingGoodsAssemble = shoppingGoodsAssembleDao.selectById(sysProjUse.getAssembleId()); | 
 |  |  |         ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(shoppingGoodsAssemble.getShoppingGoodsId()); | 
 |  |  |         content.append(shoppingGoods + "退款"); | 
 |  |  |         if (cardUse != null) { | 
 |  |  |             // 1、金额退到该用户的有效会籍卡中 | 
 |  |  |             MoneyCardUse upCard = moneyCardUseDao.selectById(cardUse.getId()); | 
 |  |  |             upCard.setRealMoney(upCard.getRealMoney() + sysProjUse.getBalance()); | 
 |  |  |             ; | 
 |  |  |             moneyCardUseDao.update(upCard); | 
 |  |  |  | 
 |  |  |             content.append("到会籍卡(" + upCard.getCardName() + ")" + sysProjUse.getBalance() + "元") | 
 |  |  |                     .append(",余次:" + upCard.getLastCountName()) | 
 |  |  |                     .append(",本金余额:" + upCard.getRealMoney()) | 
 |  |  |                     .append(",有效期:" + DateUtil.dateToString(upCard.getFailTime(), DateUtil.DATE_FORMAT_MM)) | 
 |  |  |                     .append(",是否赠送:" + upCard.getSourceName()); | 
 |  |  |         } else { | 
 |  |  |             content.append("现金" + sysProjUse.getBalance() + "元"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_TK); | 
 |  |  |         return sysProjUseDao.update(sysProjUse); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 设置为有效套餐 | 
 |  |  | 
 |  |  |         return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 退款项目 | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public double getTotalMoneyProj(SysProjUse sysProjUse) { | 
 |  |  |         sysProjUse = sysProjUseDao.selectById(sysProjUse.getId()); | 
 |  |  |         //判断套餐是否存在欠款 | 
 |  |  |         checkOrderStatu(sysProjUse); | 
 |  |  |         if (!(sysProjUse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX))) { | 
 |  |  |             throw new GlobleException("不是有效项目"); | 
 |  |  |         } | 
 |  |  |         if (sysProjUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZR)) { | 
 |  |  |             throw new GlobleException("转让的项目不能退款"); | 
 |  |  |         } | 
 |  |  |         if (sysProjUse.getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)) { | 
 |  |  |             throw new GlobleException("赠送的项目不能退款"); | 
 |  |  |         } | 
 |  |  |         return sysProjUse.getBalance(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public List<SysProjUse> selectTaocanProjUse(Long taocanId) { | 
 |  |  |     public List<SysProjUse> selectTaocanProjUse(Long taocanId, String status) { | 
 |  |  |         SysProjUse projUse = new SysProjUse(); | 
 |  |  |         projUse.setTaocanId(taocanId); | 
 |  |  |         projUse.setStatus(status); | 
 |  |  |         return sysProjUseDao.selectByModel(projUse); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public  int addVipDefaultCard(Long vipId){ | 
 |  |  |     public MoneyCardUse addVipDefaultCard(Long vipId){ | 
 |  |  |         MoneyCardUse defaultCardUse=new MoneyCardUse(); | 
 |  |  |         defaultCardUse.setVipId(vipId); | 
 |  |  |         defaultCardUse.setCardName("储值卡"); | 
 |  |  | 
 |  |  |         defaultCardUse.setGiftMoney(0D); | 
 |  |  |         defaultCardUse.setSource("-"); | 
 |  |  |         defaultCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); | 
 |  |  |         return  moneyCardUseDao.insert(defaultCardUse); | 
 |  |  |         moneyCardUseDao.insert(defaultCardUse); | 
 |  |  |         return  defaultCardUse; | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import com.matrix.core.pojo.AjaxResult; | 
 |  |  | import com.matrix.core.tools.DateUtil; | 
 |  |  | import com.matrix.core.tools.LogUtil; | 
 |  |  | import com.matrix.core.tools.StringUtils; | 
 |  |  | import com.matrix.core.tools.excl.ExcelSheetPO; | 
 |  |  | import com.matrix.core.tools.excl.ExcelUtil; | 
 |  |  | import com.matrix.core.tools.excl.ExcelVersion; | 
 |  |  | 
 |  |  |     @PostMapping(value = "/findOrderFlow") | 
 |  |  |     public @ResponseBody | 
 |  |  |     AjaxResult findOrderFlow(@RequestBody OrderFlowListDto orderFlowListDto) { | 
 |  |  |         if(StringUtils.isBlank(orderFlowListDto.getSort())){ | 
 |  |  |             orderFlowListDto.setSort("createTime"); | 
 |  |  |             orderFlowListDto.setOrder("desc"); | 
 |  |  |         } | 
 |  |  |         if (!DataAuthUtil.hasAllShopAuth()) { | 
 |  |  |             QueryUtil.setQueryLimit(orderFlowListDto); | 
 |  |  |         } else { | 
 
 |  |  | 
 |  |  |         if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ | 
 |  |  |             param.put("shopId",sysUsers.getShopId()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return AjaxResult.buildSuccessInstance(beauticianStateDao.selectItemDetail(param), | 
 |  |  |                 beauticianStateDao.selectItemDetailTotal(param)); | 
 |  |  |     } | 
 
 |  |  | 
 |  |  |             // 在session存放当前查询的客户 | 
 |  |  |             MoneyCardUse cardUseInfo = cardUseService.findByVipId(vips.get(0).getId()); | 
 |  |  |             if (cardUseInfo == null) { | 
 |  |  |                 cardUseInfo = new MoneyCardUse(); | 
 |  |  |                 cardUseInfo.setVipId(vips.get(0).getId()); | 
 |  |  |                 cardUseInfo.setCardName("储值卡"); | 
 |  |  |                 cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); | 
 |  |  |                 cardUseInfo.setRealMoney(0D); | 
 |  |  |                 cardUseInfo.setGiftMoney(0D); | 
 |  |  |                 cardUseInfo.setSource("-"); | 
 |  |  |                 cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); | 
 |  |  |                 cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); | 
 |  |  |                 moneyCardUseDao.insert(cardUseInfo); | 
 |  |  |                 cardUseInfo=vipInfoService.addVipDefaultCard(vips.get(0).getId()); | 
 |  |  |             } | 
 |  |  |             vips.get(0).setLevelCard(cardUseInfo); | 
 |  |  |             WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); | 
 
 |  |  | 
 |  |  | import com.matrix.biz.dao.BizUserDao; | 
 |  |  | import com.matrix.component.rabbitmq.RabiitMqTemplate; | 
 |  |  | import com.matrix.component.redis.RedisUserLoginUtils; | 
 |  |  | import com.matrix.core.constance.MatrixConstance; | 
 |  |  | import com.matrix.core.exception.GlobleException; | 
 |  |  | import com.matrix.core.pojo.AjaxResult; | 
 |  |  | import com.matrix.core.pojo.PaginationVO; | 
 |  |  | import com.matrix.core.pojo.VerifyResult; | 
 |  |  | 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.mapper.SysBeauticianStateMapper; | 
 |  |  | import com.matrix.system.app.mapper.SysProjServiceMapper; | 
 |  |  | import com.matrix.system.app.mapper.SysProjUseMapper; | 
 |  |  | import com.matrix.system.app.vo.*; | 
 |  |  | import com.matrix.system.common.bean.SysUsers; | 
 |  |  | import com.matrix.system.common.dao.SysUsersDao; | 
 |  |  | import com.matrix.system.common.interceptor.HostInterceptor; | 
 |  |  | import com.matrix.system.common.tools.DataAuthUtil; | 
 |  |  | import com.matrix.system.common.tools.LocationUtil; | 
 |  |  | import com.matrix.system.constance.Dictionary; | 
 |  |  | import com.matrix.system.hive.bean.*; | 
 |  |  | 
 |  |  | import com.matrix.system.hive.service.*; | 
 |  |  | import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; | 
 |  |  | import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; | 
 |  |  | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; | 
 |  |  | import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; | 
 |  |  | import com.matrix.system.shopXcx.bean.ShopProduct; | 
 |  |  | import com.matrix.system.shopXcx.dao.ShopProductDao; | 
 |  |  | import com.matrix.system.shopXcx.dao.ShopSkuDao; | 
 |  |  | import com.matrix.system.shopXcx.dto.YYDayOfWeek; | 
 |  |  | import com.matrix.system.shopXcx.dto.YYmonth; | 
 |  |  | import com.matrix.system.shopXcx.mqTask.DTO.UserProjInfo; | 
 |  |  | import io.swagger.annotations.*; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | 
 |  |  |  | 
 |  |  |         if (CollectionUtils.isNotEmpty(serviceTcVos)) { | 
 |  |  |             serviceTcVos.forEach(item -> { | 
 |  |  |                 List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId()); | 
 |  |  |                 List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); | 
 |  |  |                 List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(sysProjUses); | 
 |  |  |                 item.setProj(taocanProj); | 
 |  |  |             }); | 
 
 |  |  | 
 |  |  |  | 
 |  |  | #线上测试环境 | 
 |  |  |  | 
 |  |  | #spring.datasource.username=ct_test | 
 |  |  | #spring.datasource.password=123456 | 
 |  |  | #spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 | 
 |  |  | spring.datasource.username=ct_test | 
 |  |  | spring.datasource.password=123456 | 
 |  |  | spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 | 
 |  |  |  | 
 |  |  | spring.datasource.username=chuhuan | 
 |  |  | spring.datasource.password=chuhuan | 
 |  |  | spring.datasource.url=jdbc:mysql://175.6.132.141:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 | 
 |  |  | #spring.datasource.username=chuhuan | 
 |  |  | #spring.datasource.password=chuhuan | 
 |  |  | #spring.datasource.url=jdbc:mysql://175.6.132.141:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 | 
 |  |  |  | 
 |  |  |  | 
 |  |  | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource | 
 
 |  |  | 
 |  |  |         <result property="isVipCar" column="is_vip_car"/> | 
 |  |  |         <result property="remark" column="remark"/> | 
 |  |  |         <result property="cardName" column="card_name"/> | 
 |  |  |         <result property="orderId" column="orderId"/> | 
 |  |  |  | 
 |  |  |         <!-- 对应会员信息 --> | 
 |  |  |         <association property="vipInfo" javaType="SysVipInfo" | 
 |  |  | 
 |  |  |         select | 
 |  |  |         a.id, | 
 |  |  |         a.order_item_id, | 
 |  |  |         d.id AS orderId, | 
 |  |  |         a.use_total, | 
 |  |  |         a.last_count, | 
 |  |  |         a.real_money, | 
 |  |  | 
 |  |  |         a.remark, | 
 |  |  |         a.card_name | 
 |  |  |         from money_card_use a | 
 |  |  |         where vip_id = #{record.vipId} | 
 |  |  |         left join shopping_goods b on a.goods_id=b.id | 
 |  |  |         left join sys_order_item c on a.ORDER_ITEM_ID=c.id | 
 |  |  |         left join sys_order d on c.ORDER_ID=d.id | 
 |  |  |         where a.vip_id = #{record.vipId} | 
 |  |  |         <if test="record!=null"> | 
 |  |  |             <if test="record.orderItemId != null and record.orderItemId !='' "> | 
 |  |  |                 and a.order_item_id = #{record.orderItemId} | 
 |  |  | 
 |  |  |         select count(*) | 
 |  |  |         from money_card_use a | 
 |  |  |         left join shopping_goods b on a.goods_id=b.id | 
 |  |  |         where vip_id = #{record.vipId} | 
 |  |  |         left join sys_order_item c on a.ORDER_ITEM_ID=c.id | 
 |  |  |         left join sys_order d on c.ORDER_ID=d.id | 
 |  |  |         where a.vip_id = #{record.vipId} | 
 |  |  |         <if test="record!=null"> | 
 |  |  |             <if test="record.orderItemId != null and record.orderItemId !='' "> | 
 |  |  |                 and a.order_item_id = #{record.orderItemId} | 
 
 |  |  | 
 |  |  |     <select id="selectItemDetail" resultType="java.util.HashMap" parameterType="java.util.HashMap"> | 
 |  |  |         select | 
 |  |  |         f.SHOP_NAME, | 
 |  |  |         b.yy_time, | 
 |  |  |         b.consume_time, | 
 |  |  |         b.SERVICE_NO, | 
 |  |  |         d.su_name, | 
 |  |  | 
 |  |  |         a.COUNT, | 
 |  |  |         h.PRICE, | 
 |  |  |         h.SOURCE, | 
 |  |  |         a.STATE | 
 |  |  |         a.STATE, | 
 |  |  |         a.extract | 
 |  |  |         from sys_beautician_state a | 
 |  |  |         left join sys_proj_services b on a.SERVICES_ID=b.ID | 
 |  |  |         left join shopping_goods c on a.proj_id=c.id | 
 
 |  |  | 
 |  |  |             <if test="record.shopId != null and record.shopId != ''"> | 
 |  |  |                 and a.shop_id=#{record.shopId} | 
 |  |  |             </if> | 
 |  |  |  | 
 |  |  |         </where> | 
 |  |  |         <if test="record.sort !=null"> | 
 |  |  |             order by | 
 |  |  |             a.${record.sort} ${record.order} | 
 |  |  |         </if> | 
 |  |  |         <if test="record.offset >=0  and record.limit >0"> | 
 |  |  |             limit | 
 |  |  |             #{record.offset},#{record.limit} | 
 
 |  |  | 
 |  |  |         <result property="deductionNum" column="deductionNum"/> | 
 |  |  |         <result property="isCourse" column="is_course"/> | 
 |  |  |         <result property="timeLength" column="time_length"/> | 
 |  |  |         <result property="orderId" column="orderId"/> | 
 |  |  |         <!-- 对应项目信息--> | 
 |  |  |         <association property="projInfo" javaType="ShoppingGoods" | 
 |  |  |                      resultMap="com.matrix.system.hive.dao.ShoppingGoodsDao.ShoppingGoodsMap"/> | 
 |  |  | 
 |  |  |     <select id="selectInPage" resultMap="SysProjUseMap"> | 
 |  |  |         select | 
 |  |  |         a.*, | 
 |  |  |         d.id as orderId, | 
 |  |  |         b.TIME_LENGTH, | 
 |  |  |         b.img | 
 |  |  |         from sys_proj_use a | 
 |  |  |         left join shopping_goods b on a.proj_id=b.id | 
 |  |  |         left join sys_order_item c on a.ORDER_ITEM_ID=c.id | 
 |  |  |         left join sys_order d on c.ORDER_ID=d.id | 
 |  |  |         where 1=1 | 
 |  |  |         <if test="record!=null"> | 
 |  |  |             <if test="record.id != null and record.id !='' "> | 
 |  |  | 
 |  |  |     <!-- 查询总条数 --> | 
 |  |  |     <select id="selectTotalRecord" resultType="java.lang.Integer"> | 
 |  |  |         select count(*) | 
 |  |  |         from sys_proj_use | 
 |  |  |         from sys_proj_use a | 
 |  |  |         left join shopping_goods b on a.proj_id=b.id | 
 |  |  |         left join sys_order_item c on a.ORDER_ITEM_ID=c.id | 
 |  |  |         left join sys_order d on c.ORDER_ID=d.id | 
 |  |  |         where 1=1 | 
 |  |  |         <if test="record!=null"> | 
 |  |  |             <if test="record.id != null and record.id !='' "> | 
 |  |  |                 and ID = #{record.id} | 
 |  |  |                 and a.ID = #{record.id} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.queryKey != null and record.queryKey !='' "> | 
 |  |  |                 and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(goods_no, #{record.queryKey})) | 
 |  |  |             </if> | 
 |  |  |             <if test="record.orderItemId != null and record.orderItemId !='' "> | 
 |  |  |                 and ORDER_ITEM_ID = #{record.orderItemId} | 
 |  |  |                 and a.ORDER_ITEM_ID = #{record.orderItemId} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.projId != null and record.projId !='' "> | 
 |  |  |                 and PROJ_ID = #{record.projId} | 
 |  |  |                 and a.PROJ_ID = #{record.projId} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.surplusCount != null and record.surplusCount !='' "> | 
 |  |  |                 and SURPLUS_COUNT = #{record.surplusCount} | 
 |  |  |                 and a.SURPLUS_COUNT = #{record.surplusCount} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.isOver != null and record.isOver !='' "> | 
 |  |  |                 and IS_OVER = #{record.isOver} | 
 |  |  |                 and a.IS_OVER = #{record.isOver} | 
 |  |  |             </if> | 
 |  |  |             <!-- 查询具体某一个套餐的使用情况 --> | 
 |  |  |             <if | 
 |  |  |                     test="record.taocanId != null and record.taocanId !=-1 and record.taocanId !=-2"> | 
 |  |  |                 and TAOCAN_ID = #{record.taocanId} | 
 |  |  |                 and a.TAOCAN_ID = #{record.taocanId} | 
 |  |  |             </if> | 
 |  |  |             <!-- 查询所有的项目使用情况 --> | 
 |  |  |             <if test="record.taocanId != null and record.taocanId ==-1 "> | 
 |  |  |                 and TAOCAN_ID IS NULL | 
 |  |  |                 and a.TAOCAN_ID IS NULL | 
 |  |  |             </if> | 
 |  |  |             <!-- 查询所有的套餐使用情况 --> | 
 |  |  |             <if test="record.taocanId != null and record.taocanId ==-2 "> | 
 |  |  |                 and TAOCAN_ID IS NOT NULL | 
 |  |  |                 and a.TAOCAN_ID IS NOT NULL | 
 |  |  |             </if> | 
 |  |  |             <if test="record.vipId != null and record.vipId !='' "> | 
 |  |  |                 and VIP_ID = #{record.vipId} | 
 |  |  |                 and a.VIP_ID = #{record.vipId} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.failTime != null  "> | 
 |  |  |                 and a.FAIL_TIME = #{record.failTime} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.targetFailTime != null  "> | 
 |  |  |                 and date_format(#{record.targetFailTime}, '%Y-%m-%d') > date_format(a.FAIL_TIME, '%Y-%m-%d') | 
 |  |  |             </if> | 
 |  |  |             <if test="record.price != null and record.price !='' "> | 
 |  |  |                 and PRICE = #{record.price} | 
 |  |  |                 and a.PRICE = #{record.price} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.assembleId != null and record.assembleId !='' "> | 
 |  |  |                 and ASSEMBLE_ID = #{record.assembleId} | 
 |  |  |                 and a.ASSEMBLE_ID = #{record.assembleId} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.source != null and record.source !='' "> | 
 |  |  |                 and SOURCE like concat('%',#{record.source},'%') | 
 |  |  |                 and a.SOURCE like concat('%',#{record.source},'%') | 
 |  |  |             </if> | 
 |  |  |             <if test="record.status != null and record.status !='' "> | 
 |  |  |                 and STATUS = #{record.status} | 
 |  |  |                 and a.STATUS = #{record.status} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.platformFlag != null and record.platformFlag !='' "> | 
 |  |  |                 and PLATFORM_FLAG = #{record.platformFlag} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.projName != null and record.projName !='' "> | 
 |  |  |                 and PROJ_NAME like concat('%',#{record.projName},'%') | 
 |  |  |                 and a.PLATFORM_FLAG = #{record.platformFlag} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.type != null and record.type !='' "> | 
 |  |  |                 and type = #{record.type} | 
 |  |  |                 and a.type = #{record.type} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.projName != null and record.projName !='' "> | 
 |  |  |                 and a.PROJ_NAME like concat('%',#{record.projName},'%') | 
 |  |  |             </if> | 
 |  |  |             <if test="record.balance != null and record.balance !='' "> | 
 |  |  |                 and balance = #{record.balance} | 
 |  |  |                 and a.balance = #{record.balance} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.remark != null and record.remark !='' "> | 
 |  |  |                 and remark = #{record.remark} | 
 |  |  |                 and a.remark = #{record.remark} | 
 |  |  |             </if> | 
 |  |  |  | 
 |  |  |             <if test="record.isCourse != null and record.isCourse !='' "> | 
 |  |  |                 and   is_course = #{record.isCourse}, | 
 |  |  |                 and  a.is_course = #{record.isCourse}, | 
 |  |  |             </if> | 
 |  |  |         </if> | 
 |  |  |     </select> | 
 
 |  |  | 
 |  |  | body, body.full-height-layout #page-wrapper, body.full-height-layout #wrapper, | 
 |  |  |     html { | 
 |  |  |     height: 100%; | 
 |  |  |     overflow: hidden; | 
 |  |  | } | 
 |  |  |  | 
 |  |  | #page-wrapper { | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     <el-row class="table-style"  > | 
 |  |  |  | 
 |  |  |         <el-table id="proj" :data="table.rows"  :height="height" stripe> | 
 |  |  |         <el-table id="proj" :data="table.rows"  :height="height" stripe @sort-change="sortChange"> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="orderNo" | 
 |  |  |                     label="订单号" | 
 |  |  | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="createTime" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="交易时间" | 
 |  |  |                     show-overflow-tooltip | 
 |  |  |                     width="180"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="flowType" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="交易类型"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="amount" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="交易金额"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="payMethod" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="支付方式"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  | 
 |  |  |             resetForm(formName) { | 
 |  |  |                 this.$refs[formName].resetFields(); | 
 |  |  |             }, | 
 |  |  |             sortChange:function (column){ | 
 |  |  |                 if(column.order){ | 
 |  |  |                     if(column.order.indexOf("desc")){ | 
 |  |  |                         this.form.order="desc"; | 
 |  |  |                     }else{ | 
 |  |  |                         this.form.order="asc"; | 
 |  |  |                     } | 
 |  |  |                     this.form.sort=column.prop; | 
 |  |  |                     this.loadData(); | 
 |  |  |                 } | 
 |  |  |             }, | 
 |  |  |             loadData:function(){ | 
 |  |  |                 let _this = this; | 
 |  |  |                 let data=_this.getRequestParam(); | 
 |  |  | 
 |  |  |                     orderNo:_this.form.orderNo, | 
 |  |  |                     oprationMan:_this.form.oprationMan, | 
 |  |  |                     queryKey:_this.form.queryKey, | 
 |  |  |                     shopId:_this.form.shopId, | 
 |  |  |                     startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', | 
 |  |  |                     endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', | 
 |  |  |                     shopId:_this.form.shopId, | 
 |  |  |                     order:_this.form.order, | 
 |  |  |                     sort:_this.form.sort, | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |             }, | 
 |  |  |             search:function(){ | 
 
 |  |  | 
 |  |  |                 <tr> | 
 |  |  |                     <th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th> | 
 |  |  |                     <th data-field="SHOP_NAME" >门店</th> | 
 |  |  |                     <th data-field="consume_time"  data-formatter="MGrid.getTime"  data-sortable="true"   >服务日期</th> | 
 |  |  |                     <th data-field="yy_time"  data-formatter="MGrid.getTime"  data-sortable="true"   >预约时间</th> | 
 |  |  |                     <th data-field="consume_time"  data-formatter="MGrid.getTime"  data-sortable="true"   >划扣时间</th> | 
 |  |  |                     <th data-field="SERVICE_NO" >服务单号</th> | 
 |  |  |                     <th data-field="PROJ_NAME" >服务名称</th> | 
 |  |  |                     <th data-field="TYPE_NAME" >分类</th> | 
 |  |  |                     <th data-field="VIP_NAME" >客户名</th> | 
 |  |  |                       <th data-field="COUNT"  data-sortable="true"     >次数</th> | 
 |  |  |                       <th data-field="PRICE"  data-sortable="true"       >单价</th> | 
 |  |  |                       <th data-field="PRICE"  data-sortable="true">划扣单价</th> | 
 |  |  |                       <th data-field="extract"  data-sortable="true"  >提成</th> | 
 |  |  |                       <th data-field="su_name" >美疗师</th> | 
 |  |  |                       <th data-field="SOURCE" >来源</th> | 
 |  |  |                 </tr> | 
 |  |  | 
 |  |  |             //有删除权限 | 
 |  |  |             var delUrl=""; | 
 |  |  |             myGrid=MGrid.initGrid({ | 
 |  |  |                  url:basePath+"/admin/serviceStatistics/showList" | 
 |  |  |                  url:basePath+"/admin/serviceStatistics/showList", | 
 |  |  |                 sortName:"yy_time", | 
 |  |  |                 sortOrder:"desc" | 
 |  |  |              }); | 
 |  |  |         }); | 
 |  |  |          | 
 
 |  |  | 
 |  |  |                                         <el-button matrix:btn="vipInfo-wuxiao" v-if="scope.row.status!='无效'" type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-dongjie" v-if="scope.row.status!='冻结'" type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-cardEdit" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> | 
 |  |  |                                         <el-button type="text"  @click="openOrder(scope.$index, scope.row)" size="small">订单</el-button> | 
 |  |  |                                         <el-button  type="text" size="small" @click="openProjUseFlow(scope.$index, scope.row)">操作记录</el-button> | 
 |  |  |                                     </template> | 
 |  |  |                                 </el-table-column> | 
 |  |  | 
 |  |  |                                         <el-button matrix:btn="vipInfo-wuxiao" v-if="scope.row.status!='无效' && scope.row.taocanId == null" type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-dongjie" v-if="scope.row.status!='冻结' && scope.row.taocanId == null" type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-cardEdit" v-if="scope.row.taocanId == null" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> | 
 |  |  |                                         <el-button type="text" v-if="scope.row.orderId != null"  @click="openOrder(scope.$index, scope.row)" size="small">订单</el-button> | 
 |  |  |                                         <el-button  type="text" size="small" @click="openProjUseFlow(scope.$index, scope.row)">操作记录</el-button> | 
 |  |  |                                     </template> | 
 |  |  |                                 </el-table-column> | 
 |  |  | 
 |  |  |                                         label="状态"> | 
 |  |  |                                 </el-table-column> | 
 |  |  |                                 <el-table-column | 
 |  |  |                                         prop="isVipCar" | 
 |  |  |                                         label="是否是会籍卡"  :formatter="cardIsVipFormatter"> | 
 |  |  |                                 </el-table-column> | 
 |  |  |                                 <el-table-column | 
 |  |  |                                         prop="isOver" | 
 |  |  |                                         label="是否使用完成" :formatter="cardIsOrderFormatter"> | 
 |  |  |                                 </el-table-column> | 
 |  |  | 
 |  |  |                                 </el-table-column> | 
 |  |  |                                 <el-table-column label="操作" fixed="right" width="160"> | 
 |  |  |                                     <template slot-scope="scope"> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-youxiao" v-if="scope.row.status!='有效'" type="text" size="small" @click="tabProjValid(scope.$index, scope.row)">有效</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-wuxiao" v-if="scope.row.status!='无效'" type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-dongjie" v-if="scope.row.status!='冻结'" type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-youxiao" v-if="scope.row.status!='有效' && scope.row.isVipCar =='N' " type="text" size="small" @click="tabProjValid(scope.$index, scope.row)">有效</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-wuxiao" v-if="scope.row.status!='无效' && scope.row.isVipCar =='N'  " type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-dongjie" v-if="scope.row.status!='冻结' && scope.row.isVipCar =='N' " type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> | 
 |  |  |                                         <el-button matrix:btn="vipInfo-cardEdit" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> | 
 |  |  |                                         <el-button type="text"  v-if="scope.row.isVipCar =='N'"  @click="openOrder(scope.$index, scope.row)" size="small">订单</el-button> | 
 |  |  |                                         <el-button  type="text" size="small" @click="openMoneyCardUseFlow(scope.$index, scope.row)">操作记录</el-button> | 
 |  |  |                                     </template> | 
 |  |  |                                 </el-table-column> | 
 |  |  | 
 |  |  |             } | 
 |  |  |         }, | 
 |  |  |         methods : { | 
 |  |  |             //打开订单详情页面 | 
 |  |  |             openOrder(index,row){ | 
 |  |  |                 layer.full(layer.open({ | 
 |  |  |                     type : 2, | 
 |  |  |                     title : "订单详情", | 
 |  |  |                     maxmin : true, | 
 |  |  |                     content : [ basePath + '/admin/order/orderItem?id=' + row.orderId ] | 
 |  |  |                 })); | 
 |  |  |             }, | 
 |  |  |             querySearch(queryString, cb) { | 
 |  |  |                 $.AjaxProxy({ | 
 |  |  |                     p: { | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     <el-row class="table-style"  > | 
 |  |  |  | 
 |  |  |         <el-table id="proj" :data="table.rows"  :height="height" stripe> | 
 |  |  |         <el-table id="proj" :data="table.rows"  :height="height" stripe @sort-change="sortChange"> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="orderNo" | 
 |  |  |                     label="订单号" | 
 |  |  | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="createTime" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="交易时间" | 
 |  |  |                     show-overflow-tooltip | 
 |  |  |                     width="180"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="flowType" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="交易类型"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="amount" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="交易金额"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  |                     prop="payMethod" | 
 |  |  |                     sortable="custom" | 
 |  |  |                     label="支付方式"> | 
 |  |  |             </el-table-column> | 
 |  |  |             <el-table-column | 
 |  |  | 
 |  |  |                 orderNo:'', | 
 |  |  |                 oprationMan:'', | 
 |  |  |                 queryKey:'', | 
 |  |  |                 order:'', | 
 |  |  |                 sort:'' | 
 |  |  |             }, | 
 |  |  |             height:'calc(100vh - 240px)', | 
 |  |  |             flowTypeList:[ | 
 |  |  | 
 |  |  |             resetForm(formName) { | 
 |  |  |                 this.$refs[formName].resetFields(); | 
 |  |  |             }, | 
 |  |  |             sortChange:function (column){ | 
 |  |  |                 if(column.order){ | 
 |  |  |                     if(column.order.indexOf("desc")){ | 
 |  |  |                         this.form.order="desc"; | 
 |  |  |                     }else{ | 
 |  |  |                         this.form.order="asc"; | 
 |  |  |                     } | 
 |  |  |                     this.form.sort=column.prop; | 
 |  |  |                     this.loadData(); | 
 |  |  |                 } | 
 |  |  |             }, | 
 |  |  |             loadData:function(){ | 
 |  |  |                 let _this = this; | 
 |  |  |                 let data=_this.getRequestParam(); | 
 |  |  | 
 |  |  |                         _this.table.total=data.total; | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |             }, | 
 |  |  |             getRequestParam(){ | 
 |  |  |                 let _this = this; | 
 |  |  |                 return   { | 
 |  |  |                     name:_this.form.name, | 
 |  |  |                     payMethod:_this.form.payMethod, | 
 |  |  |                     flowType:_this.form.flowType, | 
 |  |  |                     orderNo:_this.form.orderNo, | 
 |  |  |                     oprationMan:_this.form.oprationMan, | 
 |  |  |                     queryKey:_this.form.queryKey, | 
 |  |  |                     startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', | 
 |  |  |                     endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', | 
 |  |  |                     shopId:_this.form.shopId, | 
 |  |  |                     order:_this.form.order, | 
 |  |  |                     sort:_this.form.sort, | 
 |  |  |                 } | 
 |  |  |             }, | 
 |  |  |             search:function(){ | 
 |  |  |                 this.table.currentPage=1; | 
 |  |  | 
 |  |  |                     maxmin : true, | 
 |  |  |                     content : [ basePath + '/admin/order/orderItem?id=' + row.orderId ] | 
 |  |  |                 })); | 
 |  |  |             }, | 
 |  |  |             getRequestParam(){ | 
 |  |  |                 let _this = this; | 
 |  |  |                 return   { | 
 |  |  |                     name:_this.form.name, | 
 |  |  |                     payMethod:_this.form.payMethod, | 
 |  |  |                     flowType:_this.form.flowType, | 
 |  |  |                     orderNo:_this.form.orderNo, | 
 |  |  |                     oprationMan:_this.form.oprationMan, | 
 |  |  |                     queryKey:_this.form.queryKey, | 
 |  |  |                     startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', | 
 |  |  |                     endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', | 
 |  |  |                 } | 
 |  |  |             }, | 
 |  |  |             //导出 | 
 |  |  |           exportExcel(){ | 
 
 |  |  | 
 |  |  |             <thead> | 
 |  |  |                 <tr> | 
 |  |  |                     <th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th> | 
 |  |  |                     <th data-field="consume_time"  data-formatter="MGrid.getTime"  data-sortable="true"   >服务日期</th> | 
 |  |  |                     <th data-field="SHOP_NAME" >门店</th> | 
 |  |  |                     <th data-field="yy_time"  data-formatter="MGrid.getTime"  data-sortable="true"   >预约时间</th> | 
 |  |  |                     <th data-field="consume_time"  data-formatter="MGrid.getTime"  data-sortable="true"   >划扣时间</th> | 
 |  |  |                     <th data-field="SERVICE_NO" >服务单号</th> | 
 |  |  |                     <th data-field="PROJ_NAME" >服务名称</th> | 
 |  |  |                     <th data-field="TYPE_NAME" >分类</th> | 
 |  |  |                     <th data-field="VIP_NAME" >客户名</th> | 
 |  |  |                       <th data-field="COUNT"  data-sortable="true"     >次数</th> | 
 |  |  |                       <th data-field="PRICE"  data-sortable="true"       >单价</th> | 
 |  |  |                     <th data-field="PRICE"  data-sortable="true"       >划扣单价</th> | 
 |  |  |                     <th data-field="extract"  data-sortable="true"  >提成</th> | 
 |  |  |                       <th data-field="su_name" >美疗师</th> | 
 |  |  |                       <th data-field="SOURCE" >来源</th> | 
 |  |  |                 </tr> | 
 |  |  | 
 |  |  |             //有删除权限 | 
 |  |  |             var delUrl=""; | 
 |  |  |             myGrid=MGrid.initGrid({ | 
 |  |  |                  url:basePath+"/admin/serviceStatistics/showList" | 
 |  |  |                 url:basePath+"/admin/serviceStatistics/showList", | 
 |  |  |                 sortName:"yy_time", | 
 |  |  |                 sortOrder:"desc" | 
 |  |  |              }); | 
 |  |  |         }); | 
 |  |  |          |