1.增加小数类型处理公共类
2.开通支付修改互斥条件和查询参数
3.修改单次支付的开通金额统一单位为分
3 files added
17 files modified
| | |
| | | * 单次支付金额 (单位为分) |
| | | */ |
| | | @NotNull(message = "单次支付金额不能为空") |
| | | private Integer payPrice; |
| | | private double payPrice; |
| | | /** |
| | | * 支付给喜高的费用 (单位为分) |
| | | */ |
| | | @NotNull(message = "单次支付金额不能为空") |
| | | private Integer payKidgrow; |
| | | @NotNull(message = "支付给喜高的费用不能为空") |
| | | private double payKidgrow; |
| | | /** |
| | | * 支付给客户的费用(单位为分) |
| | | */ |
| | | @NotNull(message = "单次支付金额不能为空") |
| | | private Integer payCustom; |
| | | @NotNull(message = "支付给客户金额不能为空") |
| | | private double payCustom; |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | |
| | | * @return |
| | | */ |
| | | int getEnabledCount(Long departmentId); |
| | | /** |
| | | * 获取一个科室所有的有效套餐 |
| | | * @param departmentId |
| | | * hospitalId |
| | | * @return |
| | | */ |
| | | int getUserdProduct(@Param("hospitalId") Long hospitalId,@Param("departmentId") Long departmentId); |
| | | |
| | | |
| | | /** |
| | | * 统计获取数据量 |
| | |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.vo.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderDetail> departmentProductDetail(Map<String, Object> params); |
| | | /** |
| | | * 获取一个科室所有的有效套餐 |
| | | * @param departmentId |
| | | * hospitalId |
| | | * @return |
| | | */ |
| | | int getUserdProduct(@Param("hospitalId") Long hospitalId, @Param("departmentId") Long departmentId); |
| | | } |
| | | |
| | |
| | | return PageResult.<ProductOrderDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | @Override |
| | | public int getUserdProduct(Long hospitalId, Long departmentId) { |
| | | return baseMapper.getUserdProduct(hospitalId,departmentId); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | | * @param params |
| | |
| | | ORDER BY |
| | | create_time DESC |
| | | </select> |
| | | <select id="getUserdProduct" resultType="int"> |
| | | SELECT |
| | | sum(total) |
| | | FROM |
| | | ( |
| | | SELECT |
| | | count(*) total |
| | | FROM |
| | | `product_order` order_order |
| | | LEFT JOIN product_order_record record ON order_order.id = record.order_id |
| | | WHERE |
| | | order_order.hospital_id = #{hospitalId} |
| | | AND order_order.department_id = #{departmentId} |
| | | and record.pro_id!=1000000000000000000 |
| | | AND order_order.is_del = 0 |
| | | AND order_order.enabled = 1 |
| | | AND record.is_del = 0 |
| | | AND record.enabled = 1 |
| | | AND record.pro_endtime>now() |
| | | UNION ALL |
| | | SELECT |
| | | count(*) total |
| | | FROM |
| | | `product_order` order_order |
| | | LEFT JOIN product_order_record record ON order_order.id = record.order_id |
| | | WHERE |
| | | order_order.hospital_id = #{hospitalId} |
| | | AND record.is_share = 1 |
| | | and record.pro_id!=1000000000000000000 |
| | | AND order_order.is_del = 0 |
| | | AND order_order.enabled = 1 |
| | | AND record.is_del = 0 |
| | | AND record.enabled = 1 |
| | | AND record.pro_endtime>now() |
| | | ) cc |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.utils.ArithUtils; |
| | | import com.kidgrow.oprationcenter.model.PayManager; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.service.IPayManagerService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.usercenter.feign.SysDepartmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | private IPayManagerService payManagerService; |
| | | @Autowired |
| | | private IProductOrderDetailService productOrderDetailService; |
| | | @Autowired |
| | | private SysDepartmentService sysDepartmentService; |
| | | |
| | | /** |
| | | * 列表 |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | if (payManager.getId()!=null) { |
| | | //修改支付功能 |
| | | ProductOrderDetail modelDetail=payManagerService.getProductDetail(payManager.getHospitalId(),payManager.getDepartmentId()); |
| | | if(!payManager.getEnabled()&&modelDetail!=null) |
| | | { |
| | | //支付禁用 禁用套餐 |
| | | modelDetail.setEnabled(false); |
| | | modelDetail.setIsDel(true); |
| | | if(!productOrderDetailService.saveOrUpdate(modelDetail)) |
| | | int userdCount=-1; |
| | | if (payManager.getEnabled()) { |
| | | userdCount=productOrderDetailService.getUserdProduct(payManager.getHospitalId(),payManager.getDepartmentId()); |
| | | } |
| | | if (userdCount>0) { |
| | | return ResultBody.failed().msg("该医院已有可用的套餐,不能开通单次支付!"); |
| | | } |
| | | else |
| | | { |
| | | payManager.setPayPrice(ArithUtils.round(payManager.getPayPrice()*100,2)); |
| | | payManager.setPayKidgrow(ArithUtils.round(payManager.getPayKidgrow()*100,2)); |
| | | payManager.setPayCustom(ArithUtils.round(payManager.getPayCustom()*100,2)); |
| | | if (payManager.getId()!=null) { |
| | | //修改支付功能 |
| | | ProductOrderDetail modelDetail=payManagerService.getProductDetail(payManager.getHospitalId(),payManager.getDepartmentId()); |
| | | if(!payManager.getEnabled()&&modelDetail!=null) |
| | | { |
| | | return ResultBody.failed().msg("套餐修改失败!支付开通修改失败!"); |
| | | //支付禁用 禁用套餐 |
| | | modelDetail.setEnabled(false); |
| | | modelDetail.setIsDel(true); |
| | | if(!productOrderDetailService.saveOrUpdate(modelDetail)) |
| | | { |
| | | return ResultBody.failed().msg("套餐修改失败!支付开通修改失败!"); |
| | | } |
| | | } |
| | | } |
| | | else if(modelDetail==null) |
| | | { |
| | | else if(modelDetail==null) |
| | | { |
| | | Boolean isResult=payManagerService.saveproductOrder(payManager,sysUser); |
| | | if (!isResult) { |
| | | return ResultBody.failed().msg("套餐充入失败,支付开通失败!"); |
| | | } |
| | | } |
| | | } else { |
| | | Boolean isResult=payManagerService.saveproductOrder(payManager,sysUser); |
| | | if (!isResult) { |
| | | return ResultBody.failed().msg("套餐充入失败,支付开通失败!"); |
| | | return ResultBody.failed().msg("套餐充入失败!支付开通失败!"); |
| | | } |
| | | } |
| | | } else { |
| | | Boolean isResult=payManagerService.saveproductOrder(payManager,sysUser); |
| | | if (!isResult) { |
| | | return ResultBody.failed().msg("套餐充入失败!支付开通失败!"); |
| | | boolean v = payManagerService.saveOrUpdate(payManager); |
| | | //修改科室的支付功能状态 |
| | | sysDepartmentService.updatePay(payManager.getDepartmentId(),payManager.getEnabled()); |
| | | if (v) { |
| | | return ResultBody.ok().data(payManager).msg("保存成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } |
| | | boolean v = payManagerService.saveOrUpdate(payManager); |
| | | |
| | | if (v) { |
| | | return ResultBody.ok().data(payManager).msg("保存成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ignoreSqls: |
| | | - com.kidgrow.usercenter.mapper.SysRoleMapper.findAll |
| | | - com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper.findDetailList |
| | | - com.kidgrow.oprationcenter.mapper.ProductOrderDetailMapper.getUserdProduct |
| | | |
| | | |
| | | pay: |
New file |
| | |
| | | package com.kidgrow.usercenter.feign; |
| | | |
| | | import com.kidgrow.common.constant.ServiceNameConstants; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.usercenter.feign.fallback.SysDepartmentServiceFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | @FeignClient(name = ServiceNameConstants.USER_SERVICE, fallbackFactory = SysDepartmentServiceFallbackFactory.class, decode404 = true) |
| | | public interface SysDepartmentService { |
| | | /** |
| | | * 根据条件查询 |
| | | * @param departmentId |
| | | * isPay |
| | | */ |
| | | @GetMapping(value = "/sysdepartment/updatePay") |
| | | ResultBody updatePay(@RequestParam("departmentId") Long departmentId, @RequestParam("isPay") Boolean isPay); |
| | | } |
New file |
| | |
| | | package com.kidgrow.usercenter.feign.fallback; |
| | | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.usercenter.feign.SysDepartmentService; |
| | | import feign.hystrix.FallbackFactory; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class SysDepartmentServiceFallbackFactory implements FallbackFactory<SysDepartmentService> { |
| | | @Override |
| | | public SysDepartmentService create(Throwable throwable) { |
| | | return new SysDepartmentService() { |
| | | @Override |
| | | public ResultBody updatePay(@RequestParam("departmentId") Long departmentId, @RequestParam("isPay") Boolean isPay){ |
| | | return ResultBody.failed("操作失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | * 帐号数量,默认6 |
| | | */ |
| | | private Integer accountsCount; |
| | | /** |
| | | * 是否单次支付 1是0否 |
| | | */ |
| | | private Boolean isPay; |
| | | } |
| | |
| | | * @return 如果返回空则视为不存在 |
| | | */ |
| | | String checkDepartmentName(@Param("hosId") Long hosId,@Param("departmentName") String departmentName); |
| | | /** |
| | | * 更新支付功能的开通状态 |
| | | * @param |
| | | * @return boolean |
| | | */ |
| | | boolean updatePay(@Param("departmentId") Long departmentId,@Param("isPay") boolean isPay); |
| | | } |
| | |
| | | * @return SysDepartment对象 |
| | | */ |
| | | SysDepartment findByObject(SysDepartment sysDepartment); |
| | | /** |
| | | * 更新支付功能的开通状态 |
| | | * @param |
| | | * @return boolean |
| | | */ |
| | | boolean updatePay(Long departmentId,boolean isPay); |
| | | |
| | | ResultBody findAll(Map<String, Object> params); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updatePay(Long departmentId, boolean isPay) { |
| | | return baseMapper.updatePay(departmentId,isPay); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody findAll(Map<String, Object> params) { |
| | | return ResultBody.ok().data(baseMapper.selectByMap(params)); |
| | | } |
| | |
| | | WHERE org_parent_id =( SELECT org_id FROM sys_hospital WHERE id = #{hosId} ) |
| | | AND org_name = #{departmentName} |
| | | </select> |
| | | <select id="updatePay" resultType="boolean"> |
| | | UPDATE sys_department |
| | | set is_pay=#{isPay} |
| | | where id=#{departmentId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="p.isScreen != null and p.isScreen !=''"> |
| | | and is_screen = #{p.isScreen} |
| | | </if> |
| | | <if test="p.isPay != null and p.isPay !=''"> |
| | | and is_pay = #{p.isPay} |
| | | </if> |
| | | <if test="p.isAnswer != null and p.isAnswer !=''"> |
| | | and is_answer = #{p.isAnswer} |
| | | </if> |
| | |
| | | DEP.server_user_id, |
| | | DEP.org_id, |
| | | DEP.is_del, |
| | | DEP.is_pay, |
| | | DEP.enabled, |
| | | hospitals.* |
| | | FROM |
| | |
| | | SysDepartment model = sysDepartmentService.getById(id); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | */ |
| | | @ApiOperation(value = "更新支付功能的开通状态") |
| | | @GetMapping("/updatePay") |
| | | public ResultBody updatePay(Long departmentId,Boolean isPay) { |
| | | boolean isPays = sysDepartmentService.updatePay(departmentId,isPay); |
| | | return ResultBody.ok().data(isPays).msg("操作成功"); |
| | | } |
| | | /** |
| | | * 查询 |
| | | */ |
| | | @ApiOperation(value = "查看支付功能的开通状态") |
| | | @GetMapping("/getPayMes") |
| | | public ResultBody getPayMes(Long departmentId) { |
| | | SysDepartment model = sysDepartmentService.getById(departmentId); |
| | | return ResultBody.ok().data(model.getIsPay()).msg("操作成功"); |
| | | } |
| | | /** |
| | | * 根据SysDepartment当做查询条件进行查询 |
| | | */ |
New file |
| | |
| | | package com.kidgrow.common.utils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | |
| | | @Slf4j |
| | | public class ArithUtils { |
| | | /** |
| | | * 精度值 |
| | | */ |
| | | private static final int DEF_DIV_SCALE = 2; |
| | | |
| | | private static final String POINT = "."; |
| | | |
| | | private static DecimalFormat decimalFormat = new DecimalFormat("#.####"); |
| | | |
| | | private ArithUtils() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的加法运算。如果参数为null,则视为0处理。 |
| | | * |
| | | * @param v1 被加数 |
| | | * @param v2 加数 |
| | | * @return 两个参数的和 |
| | | */ |
| | | public static double add(Double v1, Double v2) { |
| | | BigDecimal b1 = BigDecimal.valueOf(v1 == null ? 0D : v1); |
| | | BigDecimal b2 = BigDecimal.valueOf(v2 == null ? 0D : v2); |
| | | return b1.add(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的加法运算。 |
| | | * |
| | | * @param vs 加数 |
| | | * @return 和 |
| | | */ |
| | | public static double add(Double... vs) { |
| | | BigDecimal b1 = new BigDecimal(0); |
| | | for (Double d : vs) { |
| | | BigDecimal b2 = BigDecimal.valueOf(d == null ? 0D : d); |
| | | b1 = b1.add(b2); |
| | | } |
| | | return b1.doubleValue(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 提供精确的减法运算。 |
| | | * |
| | | * @param v1 被减数 |
| | | * @param v2 减数 |
| | | * @return 两个参数的差 |
| | | */ |
| | | public static double sub(double v1, double v2) { |
| | | BigDecimal b1 = BigDecimal.valueOf(v1); |
| | | BigDecimal b2 = BigDecimal.valueOf(v2); |
| | | return b1.subtract(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的乘法运算。 |
| | | * |
| | | * @param v1 被乘数 |
| | | * @param v2 乘数 |
| | | * @return 两个参数的积 |
| | | */ |
| | | public static double mul(double v1, double v2) { |
| | | BigDecimal b1 = BigDecimal.valueOf(v1); |
| | | BigDecimal b2 = BigDecimal.valueOf(v2); |
| | | return b1.multiply(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的乘法运算。 |
| | | * |
| | | * @return 多个values的乘积 |
| | | */ |
| | | public static double mul(Double... values) { |
| | | BigDecimal result = new BigDecimal(1); |
| | | for (Double value : values) { |
| | | result = result.multiply(new BigDecimal(Double.toString(value))); |
| | | } |
| | | return result.doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的乘法运算。 |
| | | * |
| | | * @param v1 被乘数 |
| | | * @param v2 乘数 |
| | | * @return 两个参数的积 |
| | | */ |
| | | public static double mul(double v1, double v2, int scale) { |
| | | BigDecimal b1 = BigDecimal.valueOf(v1); |
| | | BigDecimal b2 = BigDecimal.valueOf(v2); |
| | | return ArithUtils.round(b1.multiply(b2).doubleValue(), scale); |
| | | } |
| | | |
| | | /** |
| | | * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 小数点以后几位,以后的数字四舍五入。 |
| | | * |
| | | * @param v1 被除数 |
| | | * @param v2 除数 |
| | | * @return 两个参数的商 |
| | | */ |
| | | public static double div(double v1, double v2) { |
| | | return div(v1, v2, DEF_DIV_SCALE); |
| | | } |
| | | |
| | | /** |
| | | * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 定精度,以后的数字四舍五入。 |
| | | * |
| | | * @param v1 被除数 |
| | | * @param v2 除数 |
| | | * @param scale 表示表示需要精确到小数点以后几位。 |
| | | * @return 两个参数的商 |
| | | */ |
| | | public static double div(double v1, double v2, int scale) { |
| | | if (scale < 0) { |
| | | throw new IllegalArgumentException("参数scale必须为整数为零!"); |
| | | } |
| | | BigDecimal b1 = BigDecimal.valueOf(v1); |
| | | BigDecimal b2 = BigDecimal.valueOf(v2); |
| | | return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的小数位四舍五入处理。 |
| | | * |
| | | * @param v 需要四舍五入的数字 |
| | | * @param scale 小数点后保留几位 |
| | | * @return 四舍五入后的结果 |
| | | */ |
| | | public static double round(double v, int scale) { |
| | | if (scale < 0) { |
| | | throw new IllegalArgumentException("参数scale必须为整数或零!"); |
| | | } |
| | | BigDecimal b = BigDecimal.valueOf(v); |
| | | BigDecimal one = new BigDecimal("1"); |
| | | return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的类型转换(Float) |
| | | * |
| | | * @param v 需要被转换的数字 |
| | | * @return 返回转换结果 |
| | | */ |
| | | public static float convertsToFloat(double v) { |
| | | BigDecimal b = new BigDecimal(v); |
| | | return b.floatValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的类型转换(Int)不进行四舍五入 |
| | | * |
| | | * @param v 需要被转换的数字 |
| | | * @return 返回转换结果 |
| | | */ |
| | | public static int convertsToInt(double v) { |
| | | BigDecimal b = new BigDecimal(v); |
| | | return b.intValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的类型转换(Long) |
| | | * |
| | | * @param v 需要被转换的数字 |
| | | * @return 返回转换结果 |
| | | */ |
| | | public static long convertsToLong(double v) { |
| | | BigDecimal b = new BigDecimal(v); |
| | | return b.longValue(); |
| | | } |
| | | |
| | | /** |
| | | * 返回两个数中大的一个值 |
| | | * |
| | | * @param v1 需要被对比的第一个数 |
| | | * @param v2 需要被对比的第二个数 |
| | | * @return 返回两个数中大的一个值 |
| | | */ |
| | | public static double returnMax(double v1, double v2) { |
| | | BigDecimal b1 = new BigDecimal(v1); |
| | | BigDecimal b2 = new BigDecimal(v2); |
| | | return b1.max(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 返回两个数中小的一个值 |
| | | * |
| | | * @param v1 需要被对比的第一个数 |
| | | * @param v2 需要被对比的第二个数 |
| | | * @return 返回两个数中小的一个值 |
| | | */ |
| | | public static double returnMin(double v1, double v2) { |
| | | BigDecimal b1 = new BigDecimal(v1); |
| | | BigDecimal b2 = new BigDecimal(v2); |
| | | return b1.min(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 精确比较两个数字 |
| | | * |
| | | * @param v1 需要被对比的第一个数 |
| | | * @param v2 需要被对比的第二个数 |
| | | * @return 如果两个数一样则返回0,如果第一个数比第二个数大则返回1,反之返回-1 |
| | | */ |
| | | public static int compareTo(double v1, double v2) { |
| | | BigDecimal b1 = new BigDecimal(v1); |
| | | BigDecimal b2 = new BigDecimal(v2); |
| | | return b1.compareTo(b2); |
| | | } |
| | | |
| | | /** |
| | | * 获取数字小数位数 |
| | | * |
| | | * @param number 数字. |
| | | * @return 小数位数 |
| | | */ |
| | | public static int getDecimals(double number) { |
| | | String numberString = decimalFormat.format(number); |
| | | if (numberString.indexOf(POINT) > 0) { |
| | | return numberString.length() - String.valueOf(number).indexOf(".") |
| | | - 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取数字小数位数 |
| | | * |
| | | * @param number 数字. |
| | | * @return 小数位数 |
| | | */ |
| | | public static int getDecimals(float number) { |
| | | String numberString = decimalFormat.format(number); |
| | | if (numberString.indexOf(POINT) > 0) { |
| | | return numberString.length() - String.valueOf(number).indexOf(".") |
| | | - 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 对double数据进行取精度. |
| | | * |
| | | * @param value double数据. |
| | | * @param scale 精度位数(保留的小数位数). |
| | | * @param roundingMode : BigDecimal.ROUND_FLOOR(舍去scale位数后所有) |
| | | * 精度取值方式. |
| | | * @return 精度计算后的数据. |
| | | */ |
| | | public static double round(double value, int scale, int roundingMode) { |
| | | BigDecimal bd = new BigDecimal(value); |
| | | bd = bd.setScale(scale, roundingMode); |
| | | double d = bd.doubleValue(); |
| | | bd = null; |
| | | return d; |
| | | } |
| | | } |
| | |
| | | <option value="1">-是-</option> |
| | | <option value="0">-否-</option> |
| | | </select> |
| | | <select id="isanswer" placeholder="支付功能" lay-filter="ispay"> |
| | | <select id="ispay" placeholder="支付功能" lay-filter="ispay"> |
| | | <option value="">-支付功能-</option> |
| | | <option value="1">-是-</option> |
| | | <option value="0">-否-</option> |
| | | <option value="1">-已开通-</option> |
| | | <option value="0">-未开通-</option> |
| | | </select> |
| | | <input id="hosName" class="layui-input search-input" type="text" placeholder="按医院名" /> |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i class="layui-icon permissions" |
| | |
| | | $('#hospita-btn-search').click(function () { |
| | | var isscreen = $('#isscreen').val(); |
| | | var isanswer = $('#isanswer').val(); |
| | | var ispay = $('#ispay').val(); |
| | | var hospitalstate = $('#hospitalstate').val(); |
| | | var hospitalName = $('#hosName').val(); |
| | | |
| | |
| | | var whereModel = { |
| | | isScreen: isscreen, |
| | | isAnswer: isanswer, |
| | | isPay: ispay, |
| | | hospitalState: hospitalstate, |
| | | hospitalName: hospitalName, |
| | | hospitalProvince: hospitalProvince, |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" style="width: 150px;">单次支付金额(元)</label> |
| | | <div class="layui-input-block"> |
| | | <input name="payPrice" type="text" class="layui-input" maxlength="8" lay-verify="required|number" required |
| | | autocomplete="off" style="width: 200px;" /> |
| | | <input name="payPrice" type="text" class="layui-input" maxlength="8" lay-verify="required" required |
| | | autocomplete="off" style="width: 200px;" onkeyup="value=value.replace(/^|[^\d.]+/g,'')"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" style="width: 150px;">客户所得(元)</label> |
| | | <div class="layui-input-block"> |
| | | <input name="payCustom" type="text" autocomplete="off" class="layui-input" maxlength="8" |
| | | lay-verify="required|number" required style="width: 200px;" /> |
| | | lay-verify="required" required style="width: 200px;" onkeyup="value=value.replace(/^|[^\d.]+/g,'')"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" style="width: 150px;">喜高所得(元)</label> |
| | | <div class="layui-input-block"> |
| | | <input name="payKidgrow" type="text" autocomplete="off" class="layui-input" maxlength="8" |
| | | lay-verify="required|number" required style="width: 200px;" /> |
| | | lay-verify="required" required style="width: 200px;" onkeyup="value=value.replace(/^|[^\d.]+/g,'')"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | if (0 === data.code) { |
| | | queryData = data.data; |
| | | if (queryData != null) { |
| | | queryData.payPrice=(parseFloat(queryData.payPrice)/100).toFixed(2); |
| | | queryData.payCustom=(parseFloat(queryData.payCustom)/100).toFixed(2); |
| | | queryData.payKidgrow=(parseFloat(queryData.payKidgrow)/100).toFixed(2); |
| | | form.val('pay-form', queryData); |
| | | } |
| | | } |
| | |
| | | //回显医院基本数据 |
| | | let hospitalData = admin.getTempData('t_hospital'); |
| | | if (hospitalData != null) { |
| | | form.val('recharge-form', hospitalData); |
| | | $("#hospitalAreas").val(hospitalData.hospitalProvince + " " + hospitalData.hospitalCity + " " + |
| | | hospitalData.hospitalArea); |
| | | } |
| | | //装载产品数据 |
| | | table.render({ |
| | | elem: '#product-table', |
| | | url: config.base_server + 'api-opration/product/all', |
| | | method: 'GET', |
| | | cellMinWidth: 50, |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: false, |
| | | where: { |
| | | is_del: 0, |
| | | enabled: 1 |
| | | }, |
| | | cols: [ |
| | | [{ |
| | | field: 'proName', |
| | | sort: true, |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'proType', |
| | | sort: true, |
| | | align: 'center', |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, |
| | | title: '类型' |
| | | }, |
| | | { |
| | | field: 'proTime', |
| | | width: 100, |
| | | title: '时长', |
| | | align: 'center', |
| | | templet: function (d) { |
| | | switch (d.proTimeUnit) { |
| | | case 0: |
| | | return d.proTime + "天"; |
| | | break; |
| | | case 1: |
| | | return d.proTime + "月"; |
| | | break; |
| | | case 2: |
| | | return d.proTime + "年"; |
| | | break; |
| | | } |
| | | admin.req('api-user/sysdepartment/getPayMes?departmentId=' + hospitalData.departmentId, {}, |
| | | function (data) { |
| | | layer.closeAll('loading'); |
| | | debugger |
| | | if (0 === data.code) { |
| | | queryData = data.data; |
| | | if (queryData === true) { |
| | | admin.finishPopupCenter(); |
| | | layer.msg("当前科室开通了单次支付功能,不能进行充值业务!", { |
| | | icon: 3, |
| | | time: 5000 |
| | | }); |
| | | } else { |
| | | form.val('recharge-form', hospitalData); |
| | | $("#hospitalAreas").val(hospitalData.hospitalProvince + " " + hospitalData |
| | | .hospitalCity + " " + |
| | | hospitalData.hospitalArea); |
| | | |
| | | //装载产品数据 |
| | | table.render({ |
| | | elem: '#product-table', |
| | | url: config.base_server + 'api-opration/product/all', |
| | | method: 'GET', |
| | | cellMinWidth: 50, |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: false, |
| | | where: { |
| | | is_del: 0, |
| | | enabled: 1 |
| | | }, |
| | | cols: [ |
| | | [{ |
| | | field: 'proName', |
| | | sort: true, |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'proType', |
| | | sort: true, |
| | | align: 'center', |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, |
| | | title: '类型' |
| | | }, |
| | | { |
| | | field: 'proTime', |
| | | width: 100, |
| | | title: '时长', |
| | | align: 'center', |
| | | templet: function (d) { |
| | | switch (d.proTimeUnit) { |
| | | case 0: |
| | | return d.proTime + "天"; |
| | | break; |
| | | case 1: |
| | | return d.proTime + "月"; |
| | | break; |
| | | case 2: |
| | | return d.proTime + "年"; |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '开始日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '结束日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | templet: '#product-tpl-isShare', |
| | | title: '共享' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar', |
| | | title: '操作' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '开始日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '结束日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | templet: '#product-tpl-isShare', |
| | | title: '共享' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar', |
| | | title: '操作' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | else |
| | | { |
| | | admin.finishPopupCenter(); |
| | | layer.msg("验证医院科室数据异常!", { |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | |
| | | } |
| | | |
| | | //待充值列表功能操作 |
| | | table.on('tool(product-table-temp)', function (obj) { |
| | | if (obj.event === "del") { |
| | |
| | | format: "yyyy-MM-dd", |
| | | show: true, |
| | | done: function (value, date) { |
| | | var nowTr=obj.tr; |
| | | var nowTr = obj.tr; |
| | | if (field === "beginTime") { |
| | | var endTimes = getNowDate(data.proTime, data.proTimeUnit, |
| | | value); |