| | |
| | | package com.ltkj.web.controller.system; |
| | | |
| | | import cn.hutool.core.codec.Base64; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.vodomain.NewFlowingWaterVo; |
| | | import com.ltkj.hosp.vodomain.TjCollectFeesVo; |
| | | import com.ltkj.mall.domain.MallCheckLog; |
| | | import com.ltkj.mall.domain.MallOrder; |
| | | import com.ltkj.mall.mallOrderUtils.TjConstants; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | private ITjProjectService projectService; |
| | | @Resource |
| | | private ITjChargingStandardService chargingStandardService; |
| | | @Resource |
| | | private ITjOrderRemarkService remarkService; |
| | | |
| | | |
| | | |
| | | @GetMapping("/getNewDate") |
| | | @ApiOperation(value = "获取服务器当前时间") |
| | | public AjaxResult getNewDate() { |
| | | |
| | | Date date = DateUtil.parse(DateUtil.format(DateUtil.date(),"yyyy-MM-dd HH:mm:ss"),"yyyy-MM-dd HH:mm:ss"); |
| | | return AjaxResult.success(date); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getNewDateList") |
| | | @ApiOperation(value = "获取服务器当时间段") |
| | | public AjaxResult getNewDateList() { |
| | | |
| | | Date date = DateUtil.parse(DateUtil.format(DateUtil.date(),"yyyy-MM-dd"),"yyyy-MM-dd"); |
| | | return AjaxResult.success(date); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "获取体检收费记录接口") |
| | | public AjaxResult getFlowingWaterList(@RequestParam(required = false) @ApiParam(value = "体检号") String phone, |
| | | @RequestParam(required = false) @ApiParam(value = "体检人姓名") String name, |
| | | @RequestParam(defaultValue = "1") @ApiParam(value = "收费1 退费2") Long type) { |
| | | @RequestParam(defaultValue = "1") @ApiParam(value = "收费1 退费2 4退费员页面") Long type) { |
| | | List<TjFlowingWater> waterList =null; |
| | | List<Long> collect =null; |
| | | TjCustomer one =null; |
| | |
| | | wq1.in(TjFlowingWater::getOrderId, collect); |
| | | } |
| | | wq1.between(TjFlowingWater::getCreateTime,DateUtil.beginOfDay(date),DateUtil.endOfDay(date)); |
| | | wq1.eq(TjFlowingWater::getPayStasus,type); |
| | | if(type==1){ |
| | | wq1.eq(TjFlowingWater::getPayStasus,type); |
| | | wq1.eq(TjFlowingWater::getTollCollectorId, UserHoder.getLoginUser().getUserId()); |
| | | }else if(type==4){ |
| | | wq1.eq(TjFlowingWater::getPayStasus,1); |
| | | }else { |
| | | wq1.eq(TjFlowingWater::getPayStasus,type); |
| | | } |
| | | |
| | | waterList = flowingWaterService.list(wq1); |
| | | |
| | | if(null !=waterList && waterList.size()>0){ |
| | |
| | | if (null != order) { |
| | | if (null != customerService.getById(order.getUserId())) { |
| | | flowingWater.setCustomer(customerService.getById(order.getUserId())); |
| | | flowingWater.setTjNumber(order.getTjNumber()); |
| | | flowingWater.setTjProName(flowingWaterService.getproNameByOrderId(order.getTjNumber())); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (null != project) { |
| | | return AjaxResult.success(project.getProPrice()); |
| | | } |
| | | return AjaxResult.error("没找到对应项目 请自定义费用"); |
| | | return AjaxResult.success("没找到对应项目 请自定义费用"); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "体检收费接口") |
| | | @Transactional |
| | | public AjaxResult addOrderAndDetail(@RequestBody NewFlowingWaterVo vo) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | if (!MatchUtils.isMobileNO(vo.getPhone())) { |
| | | return AjaxResult.error("手机号格式有误!"); |
| | | } |
| | | // Long cusId = null; |
| | | // LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjCustomer::getCusName, vo.getName()); |
| | | // wq.eq(TjCustomer::getCusPhone, vo.getPhone()); |
| | | // TjCustomer one = customerService.getOne(wq); |
| | | // if (null == one) { |
| | | // if (!MatchUtils.isMobileNO(vo.getPhone())) { |
| | | // return AjaxResult.error("手机号格式有误!"); |
| | | // } |
| | | TjCustomer customer = new TjCustomer(); |
| | | if(null !=vo.getPhone())customer.setCusPhone(vo.getPhone()); |
| | | customer.setCusName(vo.getName()); |
| | | customer.setCusBrithday(new Date()); |
| | | customer.setCusSex(0L); |
| | | customerService.save(customer); |
| | | // cusId = customer.getCusId(); |
| | | // } else { |
| | | // cusId = one.getCusId(); |
| | | // } |
| | | Date date=new Date(); |
| | | TjOrder tjOrder = new TjOrder(); |
| | | tjOrder.setUserId(customer.getCusId()); |
| | |
| | | |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setOrderId(tjOrder.getOrderId()); |
| | | detail.setProId(1712272744924446722L); |
| | | if(null==vo.getTjPro()){ |
| | | detail.setProId(1712272744924446722L); |
| | | }else { |
| | | detail.setProId(vo.getTjPro()); |
| | | } |
| | | detail.setProType("0"); |
| | | detailService.save(detail); |
| | | |
| | | remarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(), user.getNickName(), String.valueOf(user.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | |
| | | TjFlowingWater tjFlowingWater = new TjFlowingWater(); |
| | | tjFlowingWater.setOrderId(tjOrder.getOrderId()); |
| | |
| | | detailService.updateById(detail); |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(tjOrder.getTjNumber()); |
| | | tjChargingStandard.setProId(1712272744924446722L); |
| | | tjChargingStandard.setPrice(vo.getYs().divide(BigDecimal.valueOf(Long.parseLong(vo.getNumber())))); |
| | | tjChargingStandard.setProName("体检项目"); |
| | | if(null==vo.getTjPro()){ |
| | | tjChargingStandard.setProId(1712272744924446722L); |
| | | }else { |
| | | tjChargingStandard.setProId(vo.getTjPro()); |
| | | } |
| | | tjChargingStandard.setProId(vo.getTjPro()); |
| | | tjChargingStandard.setPrice(vo.getSs()); |
| | | if(null==vo.getTjProName()){ |
| | | tjChargingStandard.setProName("体检项目"); |
| | | }else { |
| | | tjChargingStandard.setProName(vo.getTjProName()); |
| | | } |
| | | tjChargingStandard.setCount(Long.valueOf(vo.getNumber())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | |
| | | tjFlowingWater.setPaidIn(BigDecimal.valueOf(0.00).subtract(tjFlowingWater.getRefundPrice())); |
| | | tjFlowingWater.setCopeWith(flowingWater.getCopeWith()); |
| | | tjFlowingWater.setRemarks("已退费"); |
| | | tjFlowingWater.setPayType(flowingWater.getPayType()); |
| | | if (flowingWaterService.save(tjFlowingWater)) { |
| | | flowingWater.setRemarks("已退费"); |
| | | flowingWaterService.updateById(flowingWater); |