zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java
@@ -578,7 +578,10 @@ */ public static final String SHOP_MANAGE_JJCPAS_CONSUME = "shopManageJjcpasConsume"; /** * 赠送金额购买产品算赠送购买 */ public static final String SHOP_MANAGE_GIFTISFREE = "shopManageGiftisfree"; /** * 钉钉通知token zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
@@ -221,7 +221,7 @@ /** * 收款 */ @RequestMapping(value = "sk") @RequestMapping(value = "/sk") public @ResponseBody AjaxResult sk(SysOrder order) throws GlobleException { orderService.updateReceiptMoney(order); zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java
@@ -237,9 +237,9 @@ public @ResponseBody AjaxResult showList(PaginationVO pageVo, SysVipInfo vipInfo) { // if (!getMe().getShopRole().equals(Dictionary.FLAG_YES_Y)) { vipInfo.setShopId(getMe().getShopId()); // } QueryUtil.setQueryLimit(vipInfo); return showList(vipInfoService, vipInfo, pageVo); } zq-erp/src/main/java/com/matrix/system/hive/action/util/QueryUtil.java
@@ -5,6 +5,7 @@ import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; import java.lang.reflect.Method; @@ -12,40 +13,44 @@ /** * 为查询对象加上当前登录人的门店和公司查询限制 * * @param queryObj */ public static void setQueryLimit(Object queryObj) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); Class<Object> objClazz = (Class<Object>) queryObj.getClass(); try { Method setShopId = (Method) objClazz.getMethod("setShopId",Long.class); setShopId.invoke(queryObj, sysUsers.getShopId()); Method setCompanyId = (Method) objClazz.getMethod("setCompanyId",Long.class); if (!AppConstance.USER_TYPE_ADMIN.equals(sysUsers.getSuUserType())) { Method setShopId = (Method) objClazz.getMethod("setShopId", Long.class); setShopId.invoke(queryObj, sysUsers.getShopId()); } Method setCompanyId = (Method) objClazz.getMethod("setCompanyId", Long.class); setCompanyId.invoke(queryObj, sysUsers.getCompanyId()); } catch (Exception e) { LogUtil.error(e.getMessage(), e); throw new GlobleException("系统参数错误007"); } } /** * 限制数据公司id * * @param queryObj */ public static void setQueryLimitCom(Object queryObj) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); Class<Object> objClazz = (Class<Object>) queryObj.getClass(); try { Method setCompanyId = (Method) objClazz.getMethod("setCompanyId",Long.class); Method setCompanyId = (Method) objClazz.getMethod("setCompanyId", Long.class); setCompanyId.invoke(queryObj, sysUsers.getCompanyId()); } catch (Exception e) { LogUtil.error(e.getMessage(), e); throw new GlobleException("系统参数错误008"); } } } zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.*; /** @@ -193,7 +194,7 @@ calculationProjPercentage(AchieveRuleItem.ACHIEVE_TYPE_ZS,achieveNew.getFreeConsume(),beauticianState.getProjId())); } else { achieveNew.setHisConsume(projUse.getPrice()*beauticianState.getCount()); achieveNew.setHisConsume(new BigDecimal(projUse.getPrice()*beauticianState.getCount()).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue()); //计算提成 achieveNew.setProjPercentage( calculationProjPercentage(AchieveRuleItem.ACHIEVE_TYPE_BJ,achieveNew.getHisConsume(),beauticianState.getProjId())); zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
@@ -1306,7 +1306,7 @@ taocanProjUse.setIsCourse(taocanShoppingGoods.getIsCourse()); taocanProjUse.setIsInfinite(taocanShoppingGoods.getIsInfinite()); // 赠送和打折后金额为0的都视为赠送项目 if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0) { if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0 && !isGiftMoneyPay(order)) { taocanProjUse.setSource(Dictionary.TAOCAN_SOURCE_GM); } else { taocanProjUse.setSource(Dictionary.TAOCAN_SOURCE_ZS); @@ -1359,8 +1359,10 @@ puse.setProjName(sysOrderItem.getShoppingGoods().getName()); // 赠送和打折后金额为0的都视为赠送项目 if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0) { if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0 && !isGiftMoneyPay(order)) { puse.setSource(Dictionary.TAOCAN_SOURCE_GM); puse.setPrice(sysOrderItem.getZkPrice()); } else { @@ -1382,6 +1384,22 @@ sysProjUseDao.insert(puse); } /** * 全是赠送金额,且配置了赠送金额购买计算为赠送 * @param order * @return */ private boolean isGiftMoneyPay(SysOrder order) { BusParameterSettings giftiIsfree = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_GIFTISFREE, order.getCompanyId()); if(giftiIsfree.getParamValue().equals("是")){ return order.getFlows().stream().allMatch(item -> SysOrderFlow.IS_GIFT_Y.equals(item.getIsGift())); }else{ return false; } } /** * 会员卡充值 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java
@@ -35,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -238,7 +239,7 @@ } // 设置项目总时长 sysProjServices.setTotalTime(totalTime); sysProjServices.setMoney(hkPrice); sysProjServices.setMoney(new BigDecimal(hkPrice).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue()); sysProjServicesDao.update(sysProjServices); return sysProjServices; } zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html
@@ -73,7 +73,22 @@ <el-table-column prop="projInfo.name" label="商品名称" width="280"> width="400"> </el-table-column> <el-table-column prop="projUse.source" label="来源" width="400"> </el-table-column> <el-table-column :formatter="hkPrice" label="划扣金额" width="100"> </el-table-column> <el-table-column prop="count" label="次数" width="100"> </el-table-column> <el-table-column prop="projInfo.timeLength" @@ -81,7 +96,6 @@ width="200"> </el-table-column> <el-table-column prop="address" label="服务时间" :formatter="serviceTime"> </el-table-column> <el-table-column zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html
@@ -256,10 +256,10 @@ </el-table-column> <el-table-column label="操作"> <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-cardEdit" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> <el-button matrix:btn="vipinfoClub-youxiao" v-if="scope.row.status!='有效'" type="text" size="small" @click="tabProjValid(scope.$index, scope.row)">有效</el-button> <el-button matrix:btn="vipinfoClub-wuxiao" v-if="scope.row.status!='无效'" type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> <el-button matrix:btn="vipinfoClub-dongjie" v-if="scope.row.status!='冻结'" type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> <el-button matrix:btn="vipinfoClub-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> zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html
@@ -112,6 +112,7 @@ <table class="table table-bordered"> <tr> <th>项目名称</th> <th>次数</th> <th width="100px">服务时长(分钟)</th> <th>服务时间</th> <th width="300px">美疗师</th> @@ -120,6 +121,7 @@ <tr v-for="(item,index) in projService.serviceItems"> <td>{{item.projInfo.name}}</td> <td>{{item.count}}</td> <td><el-input @change="changeTimeLength" v-model="item.projInfo.timeLength"></el-input></td> <td> zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java
@@ -90,6 +90,13 @@ newSetting6.setCategory("店务配置"); newSettings.add(newSetting6); ParameterSettings newSetting7=new ParameterSettings(); newSetting7.setCode(AppConstance.SHOP_MANAGE_GIFTISFREE); newSetting7.setName("赠送金额购买产品算赠送购买"); newSetting7.setType(1); newSetting7.setCategory("店务配置"); newSettings.add(newSetting7); for (ParameterSettings newSetting : newSettings) { List<ParameterSettings> parameterSettings = parameterSettingsDao.selectByModel(newSetting);