ruoyi-admin/src/main/java/com/ruoyi/web/controller/enums/PersonType.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,47 @@ package com.ruoyi.web.controller.enums; import com.ruoyi.common.enums.OrganEnum; /** * ç¨æ·ç±»å * * @author ls */ public enum PersonType { OTHER("0", "å ¶ä»äººå"), PROFESSIONAL("1", "ä¸è人å"), COORDINATOR("2", "åè°å"), EXPERT("3","ä¸å®¶"), KIN("4","å®¶å±"); private final String code; private final String info; PersonType(String code, String info) { this.code = code; this.info = info; } public String getCode() { return code; } public String getInfo() { return info; } public static String getInfoByCode(String code) { PersonType[] personTypes = values(); for (int i = 0; i < personTypes.length; i++) { PersonType personType = personTypes[i]; if (personType.getCode().equals(code)) { return personType.getInfo(); } } return null; } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -23,11 +23,13 @@ import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut; import com.ruoyi.project.service.*; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.web.controller.enums.PersonType; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang.StringUtils; import org.apache.ibatis.annotations.Options; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,7 +39,7 @@ import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; /** @@ -49,8 +51,7 @@ @Api("æ¥éç³è¯·") @RestController @RequestMapping("/project/reimbursement") public class ServiceReimbursementController extends BaseController { public class ServiceReimbursementController extends BaseController { @Autowired private IServiceReimbursementService serviceReimbursementService; @@ -73,10 +74,12 @@ private IServiceSystemmessageService ServiceSystemmessage; private static Configuration configuration = null; public ServiceReimbursementController() { configuration = new Configuration(); configuration.setDefaultEncoding("utf-8"); } static String cashUnitLeft[] = { "å ", "æ¾", "ä½°", "ä»", "ä¸", "æ¾", "ä½°", "ä»","亿", "æ¾", "ä½°", "ä»", "ä¸" }; static String cashUnitRight[] = { "è§", "å", "å" }; static String upperNumber[] = { "é¶", "壹", "è´°", "å", "è", "ä¼", "é", "æ","æ", "ç" }; @@ -88,8 +91,7 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:list')") @Log(title = "æ¥è¯¢æ¥éç³è¯·å表", businessType = BusinessType.OTHER) @GetMapping("/list") public TableDataInfo list(ServiceReimbursement serviceReimbursement) { public TableDataInfo list(ServiceReimbursement serviceReimbursement) { SysUser user = SecurityUtils.getLoginUser().getUser(); serviceReimbursement.setCreateBy(user.getUserName()); startPage(); @@ -102,8 +104,7 @@ */ @ApiOperation("æ ¹æ®æ¥ææ¥è¯¢æ¥éç³è¯·å表") @GetMapping("/listWithDate") public TableDataInfo listWithDate(ServiceReimbursementDto serviceReimbursementdto) { public TableDataInfo listWithDate(ServiceReimbursementDto serviceReimbursementdto) { startPage(); List<ServiceReimbursement> list = serviceReimbursementService.selectSearchList(serviceReimbursementdto); return getDataTable(list); @@ -115,8 +116,7 @@ @ApiOperation("æ ¹æ®æéæ¾ç¤ºå®¡æ ¸å表") @Log(title = "æ ¹æ®æéæ¾ç¤ºå®¡æ ¸å表", businessType = BusinessType.OTHER) @GetMapping("/listbypower") public TableDataInfo getListBypower(SpFinancialExpensesIn spFinancialExpensesIn) { public TableDataInfo getListBypower(SpFinancialExpensesIn spFinancialExpensesIn) { LoginUser loginUser = getLoginUser(); String APPLICANT=spFinancialExpensesIn.getAPPLICANT(); @@ -127,28 +127,23 @@ Integer pageNum=spFinancialExpensesIn.getPageNum(); Integer pageSize=spFinancialExpensesIn.getPageSize(); if(pageNum==null) { if (pageNum == null) { pageNum=1; } if(pageSize==null) { if (pageSize == null) { pageSize=10; } if(APPLICANT==null) { if (APPLICANT == null) { APPLICANT=""; } if(APPLICATIONBEGTIME==null) { if (APPLICATIONBEGTIME == null) { APPLICATIONBEGTIME=""; } if(APPLICATIONENDTIME==null) { if (APPLICATIONENDTIME == null) { APPLICATIONENDTIME=""; } //startPage(); @@ -163,8 +158,7 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:export')") @Log(title = "æ¥éç³è¯·", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceReimbursement serviceReimbursement) { public AjaxResult export(ServiceReimbursement serviceReimbursement) { List<ServiceReimbursement> list = serviceReimbursementService.queryList(serviceReimbursement); ExcelUtil<ServiceReimbursement> util = new ExcelUtil<ServiceReimbursement>(ServiceReimbursement.class); return util.exportExcel(list, "æ¥éç³è¯·æ°æ®"); @@ -176,8 +170,7 @@ @ApiOperation("è·åæ¥éç³è¯·è¯¦ç»ä¿¡æ¯") //@PreAuthorize("@ss.hasPermi('project:reimbursement:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceReimbursementService.getById(id)); } @@ -200,28 +193,23 @@ @PostMapping @RepeatSubmit @Options(useGeneratedKeys = true, keyProperty = "id") public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) { public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) { boolean b = serviceReimbursementService.save(serviceReimbursement); if(b) { if (b) { addReiSharedDatd(serviceReimbursement,1); } Long id = serviceReimbursement.getId(); return AjaxResult.success(id); } public int addReiSharedDatd(ServiceReimbursement serviceReimbursement,int nType) { public int addReiSharedDatd(ServiceReimbursement serviceReimbursement, int nType) { //remShare = ; ServiceReimbursementShared remShare = null; if(nType == 1) { if (nType == 1) { remShare = new ServiceReimbursementShared(); remShare.setReimid(serviceReimbursement.getId()); } else //modify } else //modify { List<ServiceReimbursementShared> remlist = serviceReimbursementServiceShare.getRemShareInfoByRemId(serviceReimbursement.getId()); if(remlist!=null) @@ -292,12 +280,9 @@ //remShare.setDonorno(serviceReimbursement.getDonorno()); boolean bRet = false; if(nType==1) { if (nType == 1) { bRet = serviceReimbursementServiceShare.save(remShare); } else { } else { //remShare.setId(serviceReimbursement.); bRet = serviceReimbursementServiceShare.updateById(remShare); } @@ -308,12 +293,9 @@ if(strMutfileUrl == null) return 0; if(strMutfileUrl.isEmpty()) return 0; try { try { uploadOAFileAndUpdateDb(remShare); } catch (Exception e) { } catch (Exception e) { logger.error("è°ç¨ç¬¬ä¸æ¹æ¥å£åºé!"); e.printStackTrace(); } @@ -324,8 +306,7 @@ } int uploadOAFileAndUpdateDb(ServiceReimbursementShared remShare) { int uploadOAFileAndUpdateDb(ServiceReimbursementShared remShare) { //ä¸ä¼ OAæä»¶ //String strUrl = "http://129.88.242.39:8899/seeyon/rest/token?userName=opo&password=127814f8-84e8-4304-84a5-a71573567efd&loginName=demo3"; String strUrl = "http://129.88.242.39:8899/seeyon/rest/token"; @@ -372,20 +353,16 @@ String fileid = ""; String[] urlArray = strMutfileUrl.split(","); for (int i = 0; i < urlArray.length; i++) { for (int i = 0; i < urlArray.length; i++) { String strOneFileName = urlArray[i]; String strTemp = strOneFileName.substring(15); String strFile = filePath + strTemp ; //FileUploadUtils.getAbsoluteFile(filePath,strOneFileName); String struploadResult = ""; File filetest = new File(strFile); try { try { struploadResult = HttpClientKit.sendPostWithFile(filetest,strFUrl); } catch (Exception e) { } catch (Exception e) { e.printStackTrace(); } @@ -427,15 +404,13 @@ JSONObject jsonR = JSONObject.parseObject(struploadResult); JSONArray jsonArr = jsonR.getJSONArray("atts"); for(int j=0;j<jsonArr.size();j++) { for (int j = 0; j < jsonArr.size(); j++) { JSONObject jsonRet = jsonArr.getJSONObject(j); String name1= jsonRet.get("filename").toString(); String id1 = jsonRet.get("fileUrl").toString(); filename+=name1; fileid+=id1; if(i!=urlArray.length-1) { if (i != urlArray.length - 1) { filename+=","; fileid+=","; } @@ -459,23 +434,18 @@ @ApiOperation("å·®æ è´¹ä¸æ¥") @Log(title = "å·®æ è´¹ä¸æ¥", businessType = BusinessType.OTHER) @PostMapping("/travelexpensereport") public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO) { public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO) { ServiceReimbursement serviceReimbursement= serviceReimbursementService.getById(checkFundVO.getFundid()); if(serviceReimbursement!=null) { if (serviceReimbursement != null) { Integer TotalLevel=0; LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); List<Integer> postids =postService.selectPostListByUserId(loginUser.getUserId()); if(!postids.contains(2)) { if (!postids.contains(2)) { serviceReimbursement.setFlowlevel(1L); serviceReimbursement.setRecordstatus(2); } else { } else { serviceReimbursement.setFlowlevel(0L); serviceReimbursement.setRecordstatus(0); } @@ -496,9 +466,7 @@ serviceReimbursementService.updateById(serviceReimbursement); return AjaxResult.success(); } else { } else { return AjaxResult.error(HttpStatus.NO_CONTENT,"è´¹ç¨ç¼å·ä¸æ£ç¡®"); } } @@ -510,11 +478,9 @@ @ApiOperation("å®¡æ ¸è´¹ç¨") @Log(title = "å®¡æ ¸è´¹ç¨", businessType = BusinessType.OTHER) @PostMapping("/checkfund") public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) { public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) { ServiceReimbursement serviceReimbursement= serviceReimbursementService.getById(checkFundVO.getFundid()); if(serviceReimbursement!=null) { if (serviceReimbursement != null) { Integer TotalLevel=0; LoginUser loginUser = getLoginUser(); ServiceFundflowrule serviceFundflowrule=new ServiceFundflowrule(); @@ -523,51 +489,38 @@ serviceFundflowrule.setCheckuserno(loginUser.getUsername()); List<ServiceFundflowrule> serviceFundflowrules= serviceFundflowruleService.queryList(serviceFundflowrule); if(serviceFundflowrules==null || serviceFundflowrules.stream().count()==0) { if (serviceFundflowrules == null || serviceFundflowrules.stream().count() == 0) { return AjaxResult.error(HttpStatus.ERROR,"å½åäººåæ æ¤è®°å½å®¡æ ¸æé"); } if(serviceFundflowrules.get(0).getFlowlevel()-1!=serviceReimbursement.getFlowlevel()) { if (serviceFundflowrules.get(0).getFlowlevel() - 1 != serviceReimbursement.getFlowlevel()) { return AjaxResult.error(HttpStatus.ERROR,"å½å人å䏿¤è®°å½çå®¡æ ¸çº§å«ä¸ç¬¦"); } if(serviceFundflowrules!=null && serviceFundflowrules.stream().count()>0) { if (serviceFundflowrules != null && serviceFundflowrules.stream().count() > 0) { TotalLevel=serviceFundflowrules.get(0).getTotallevel(); } Integer CheckFlag=0; Integer RecordStatus = serviceReimbursement.getRecordstatus(); Integer FlowLevel = Integer.valueOf(serviceReimbursement.getFlowlevel().toString()); Integer OriginalFlowLevel=FlowLevel; if(checkFundVO.getFlowconclusion()==1) { if (checkFundVO.getFlowconclusion() == 1) { CheckFlag=1; if(TotalLevel==0) { if (TotalLevel == 0) { RecordStatus=99; } else { if(TotalLevel==FlowLevel+1) { } else { if (TotalLevel == FlowLevel + 1) { RecordStatus=99; } else { } else { RecordStatus = (FlowLevel+1)*2; } } FlowLevel=FlowLevel+1; } else { } else { CheckFlag=2; RecordStatus = (FlowLevel+1)*2 - 1; FlowLevel=(FlowLevel-1); if(FlowLevel<0) { if (FlowLevel < 0) { FlowLevel=0; } } @@ -589,10 +542,8 @@ List<Integer> postids =postService.selectPostListByUserId(loginUser.getUserId()); if(!postids.contains(2)) { if(CheckFlag==2 && OriginalFlowLevel==1) { if (!postids.contains(2)) { if (CheckFlag == 2 && OriginalFlowLevel == 1) { ServiceFundflow serviceFundflowAuto=new ServiceFundflow(); serviceFundflowAuto.setFundid(serviceReimbursement.getId()); serviceFundflowAuto.setCheckuserno(user.getUserName()); @@ -620,15 +571,12 @@ serviceSystemmessage.setIsread(0); serviceSystemmessage.setMessagetype(1); serviceSystemmessage.setRelevantno(serviceReimbursement.getId()); if(CheckFlag==1) { if (CheckFlag == 1) { //éè¿ serviceSystemmessage.setMessagetitle(""+(OriginalFlowLevel+1)+"çº§å®¡æ ¸éè¿"); serviceSystemmessage.setMessagecontent("æ¨"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime())+"æäº¤çå ³äºæç®æ¡ä¾ã"+serviceReimbursement.getDonorname()+"ãçå·®æ è´¹ç³è¯·å·²éè¿"+(OriginalFlowLevel+1)+"çº§å®¡æ ¸"); } else { } else { //驳å serviceSystemmessage.setMessagetitle(""+(OriginalFlowLevel+1)+"çº§å®¡æ ¸é©³å"); serviceSystemmessage.setMessagecontent("æ¨"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime())+"æäº¤çå ³äºæç®æ¡ä¾ã"+serviceReimbursement.getDonorname()+"ãçå·®æ è´¹ç³è¯·å·²è¢«"+(OriginalFlowLevel+1)+"çº§å®¡æ ¸é©³åï¼åå 为"+checkFundVO.getFlowcontent()+""); @@ -636,9 +584,7 @@ ServiceSystemmessage.save(serviceSystemmessage); return AjaxResult.success(); } else { } else { return AjaxResult.error(HttpStatus.NO_CONTENT,"è´¹ç¨ç¼å·ä¸æ£ç¡®"); } } @@ -652,11 +598,9 @@ @Log(title = "æ¥éç³è¯·", businessType = BusinessType.UPDATE) @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody ServiceReimbursement serviceReimbursement) { public AjaxResult edit(@RequestBody ServiceReimbursement serviceReimbursement) { boolean b= serviceReimbursementService.updateById(serviceReimbursement); if(b) { if (b) { addReiSharedDatd(serviceReimbursement,2); } return toAjax(b); @@ -669,11 +613,9 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')") @Log(title = "å®¡æ ¸è´¹ç¨", businessType = BusinessType.OTHER) @PostMapping("/editMoney") public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement) { public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement) { boolean b= serviceReimbursementService.updateById(null); if(b) { if (b) { addReiSharedDatd(null,2); } return toAjax(b); @@ -686,8 +628,7 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:remove')") @Log(title = "æ¥éç³è¯·", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceReimbursementService.removeByIds(Arrays.asList(ids))); } @@ -716,6 +657,20 @@ //è¾åºææ¡£è·¯å¾ååç§° File outFile = new File(RuoYiConfig.getProfile()+"/download/wordtemplate/"+name+".doc"); //å建æä»¶å¤¹ File folderPath = new File(RuoYiConfig.getProfile() + "/download/wordtemplate"); if (!folderPath.exists()) { boolean success = folderPath.mkdirs(); if (success) { System.out.println("ç®å½å建æå"); } else { System.out.println("ç®å½å建失败"); } } else { System.out.println("ç®å½å·²åå¨"); } Writer out = null; try { @@ -735,52 +690,132 @@ } private void getData(Map dataMap,Long id) { ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(id); if (serviceReimbursement == null) { throw new ServiceException("ä¸è½½å¤±è´¥ï¼ç¨æ·ä¿¡æ¯åºé", HttpStatus.NO_CONTENT); //ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(id); ServiceReimbursement serviceReimbursement = null; ServiceReimbursementEo serviceReimbursementEo = new ServiceReimbursementEo(); serviceReimbursementEo.setId(id); List<ServiceReimbursementEo> rdInfoByItem = serviceReimbursementService.getRDInfoByItem(serviceReimbursementEo); Map<String, List<ServiceReimbursementEo>> listMap = rdInfoByItem.stream() .collect(Collectors.groupingBy(ServiceReimbursementEo::getPersontype)); List<Map<String, BigDecimal>> list = new ArrayList<>(); StringBuffer FYXM1 = new StringBuffer(); StringBuffer FYXM2 = new StringBuffer(); StringBuffer FYXM3 = new StringBuffer(); int flag = 0; String key1 = null; BigDecimal allMoney = new BigDecimal(0.00); BigDecimal otherMoneyall = new BigDecimal(0.00); for (String key : listMap.keySet()) { Map<String, BigDecimal> map = new HashMap<>(); List<ServiceReimbursementEo> values = listMap.get(key); BigDecimal otherMoney = new BigDecimal(0.00); BigDecimal keyOneMoney = new BigDecimal(0.00); BigDecimal keyTwoMoney = new BigDecimal(0.00); for (ServiceReimbursementEo serviceReimbursementEo1 : values) { otherMoney = otherMoney.add(serviceReimbursementEo1.getTrafficexpense()).add(serviceReimbursementEo1.getHotelexpense()) .add(serviceReimbursementEo1.getFoodexpenses()).add(serviceReimbursementEo1.getFoodallowance()) .add(serviceReimbursementEo1.getOtherexpense()).add(serviceReimbursementEo1.getOtherfeeamount()); } map.put(key, otherMoney); list.add(map); // ä¸ä¸ºä¸å®¶æå®¶å± if (!key.equals("3") && !key.equals("4")) { //å°ä¸ä¸æ¬¡çæ¸ ç©º FYXM1.delete(0, FYXM1.length()); //åæ°å¢ otherMoneyall = otherMoneyall.add(otherMoney); FYXM1.append("OPOå·¥ä½äººå" + ":" + otherMoneyall + " "); } else { if (flag == 0) { key1 = key; flag = 1; } if (key1 == key) { FYXM2.append(PersonType.getInfoByCode(key) + ":" + otherMoney); allMoney = allMoney.add(otherMoney); } else { FYXM3.append(PersonType.getInfoByCode(key) + ":" + otherMoney); allMoney = allMoney.add(otherMoney); } } } allMoney = allMoney.add(otherMoneyall); if (FYXM1.length() == 0) { if (FYXM2.length() != 0 && FYXM3.length() != 0) { FYXM1.append(FYXM3); FYXM3.setLength(0); } else if (FYXM2.length() != 0 && FYXM3.length() == 0) { FYXM1.append(FYXM2); FYXM2.setLength(0); } } else if (FYXM2.length() == 0) { if (FYXM3.length() != 0) { FYXM2.append(FYXM3); FYXM3.setLength(0); } } Date dt = serviceReimbursement.getCreateTime(); if (rdInfoByItem == null || rdInfoByItem.size() == 0) { throw new ServiceException("ä¸è½½å¤±è´¥ï¼ç¨æ·ä¿¡æ¯åºé", HttpStatus.NO_CONTENT); } Date dt = rdInfoByItem.get(0).getCreateTime(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = formatter.format(dt); String time = date.substring(0, 10); dataMap.put("TBYYMMDD", time); dataMap.put("BXDFJ", serviceReimbursement.getAttachcount() == 0 ? " " : "" + serviceReimbursement.getAttachcount()); dataMap.put("JXZXM", serviceReimbursement.getDonorname() == null ? "" : serviceReimbursement.getDonorname()); dataMap.put("JSR", serviceReimbursement.getUsername() == null ? "" : serviceReimbursement.getUsername()); dataMap.put("FYXM1", "å·®æ è´¹æ¥éæ»éé¢ï¼ " + String.format("%.2f", serviceReimbursement.getAmountrequested()).toString() + "å "); dataMap.put("BXDFJ", rdInfoByItem.get(0).getAttachcount() == null ? " " : "" + rdInfoByItem.get(0).getAttachcount()); dataMap.put("JXZXM", rdInfoByItem.get(0).getDonorname() == null ? "" : rdInfoByItem.get(0).getDonorname()); dataMap.put("JSR", rdInfoByItem.get(0).getUsername() == null ? "" : rdInfoByItem.get(0).getUsername()); if (FYXM1.length() != 0) { dataMap.put("FYXM1", FYXM1.toString() + "å "); } else { dataMap.put("FYXM1", ""); } if (FYXM2.length() != 0) { dataMap.put("FYXM2", FYXM2.toString() + "å "); } else { dataMap.put("FYXM2", ""); } if (FYXM3.length() != 0) { dataMap.put("FYXM3", FYXM3.toString() + "å "); } else { dataMap.put("FYXM3", ""); dataMap.put("JEXS", serviceReimbursement.getAmountrequested()); } // dataMap.put("JEXS", rdInfoByItem.get(0).getAmountrequested()); dataMap.put("JEXS", allMoney); //double temp = 0; //temp = Math.round(serviceReimbursement.getAmountrequested() * 100) * 0.01d; dataMap.put("JEDS", convert(serviceReimbursement.getAmountrequested()) + "æ´"); // dataMap.put("JEDS", convert(rdInfoByItem.get(0).getAmountrequested().doubleValue()) + "æ´"); dataMap.put("JEDS", convert(allMoney.doubleValue()) + "æ´"); String remark = ""; remark += serviceReimbursement.getCosttypename() == null ? "" : serviceReimbursement.getCosttypename() + "("; remark += rdInfoByItem.get(0).getCosttypename() == null ? "" : rdInfoByItem.get(0).getCosttypename() + "("; remark += serviceReimbursement.getTravelers() == null ? "" : serviceReimbursement.getTravelers() + ": "; remark += rdInfoByItem.get(0).getTravelers() == null ? "" : rdInfoByItem.get(0).getTravelers() + ": "; remark += serviceReimbursement.getIdcardno() == null ? "" : serviceReimbursement.getIdcardno() + "; "; remark += rdInfoByItem.get(0).getIdcardno() == null ? "" : rdInfoByItem.get(0).getIdcardno() + "; "; remark += serviceReimbursement.getDepositbank() == null ? "" : serviceReimbursement.getDepositbank() + ": "; remark += rdInfoByItem.get(0).getDepositbank() == null ? "" : rdInfoByItem.get(0).getDepositbank() + ": "; remark += serviceReimbursement.getBankcardno() == null ? "" : serviceReimbursement.getBankcardno() + ")"; remark += rdInfoByItem.get(0).getBankcardno() == null ? "" : rdInfoByItem.get(0).getBankcardno() + ")"; remark += "\n"; remark += serviceReimbursement.getRemark() == null ? "" : serviceReimbursement.getRemark(); remark += rdInfoByItem.get(0).getRemark() == null ? "" : rdInfoByItem.get(0).getRemark(); dataMap.put("BXBZ", remark); dataMap.put("YYMMDD", time); dataMap.put("FJ", serviceReimbursement.getAttachcount() == 0 ? " " : "" + serviceReimbursement.getAttachcount()); dataMap.put("FP", serviceReimbursement.getInvoicecount() == 0 ? " " : "" + serviceReimbursement.getInvoicecount()); dataMap.put("XM", serviceReimbursement.getTravelers() == null ? "" : serviceReimbursement.getTravelers()); dataMap.put("BXR", serviceReimbursement.getUsername() == null ? "" : serviceReimbursement.getUsername()); dataMap.put("QYZZ", serviceReimbursement.getManagername() == null ? "" : serviceReimbursement.getManagername()); dataMap.put("CCSY", serviceReimbursement.getReason() == null ? "" : serviceReimbursement.getReason()); dataMap.put("FJ", rdInfoByItem.get(0).getAttachcount() == null ? " " : "" + rdInfoByItem.get(0).getAttachcount()); dataMap.put("FP", rdInfoByItem.get(0).getInvoicecount() == null ? " " : "" + rdInfoByItem.get(0).getInvoicecount()); dataMap.put("XM", rdInfoByItem.get(0).getTravelers() == null ? "" : rdInfoByItem.get(0).getTravelers()); dataMap.put("BXR", rdInfoByItem.get(0).getUsername() == null ? "" : rdInfoByItem.get(0).getUsername()); dataMap.put("QYZZ", rdInfoByItem.get(0).getManagername() == null ? "" : rdInfoByItem.get(0).getManagername()); dataMap.put("CCSY", rdInfoByItem.get(0).getReason() == null ? "" : rdInfoByItem.get(0).getReason()); List<ServiceReimbursementdetail> rd = serviceReimbursementdetailService.getAllDetailsByRBID(id); @@ -789,14 +824,14 @@ } List<Map<String, Object>> newsList = new ArrayList<Map<String,Object>>(); int days = 0; double te = 0; double cf = 0; double he = 0; double oe = 0; double fe = 0; double fa = 0; double hj = 0; double qt = 0; BigDecimal te = BigDecimal.ZERO; BigDecimal cf = BigDecimal.ZERO; BigDecimal he = BigDecimal.ZERO; BigDecimal oe = BigDecimal.ZERO; BigDecimal fe = BigDecimal.ZERO; BigDecimal fa = BigDecimal.ZERO; BigDecimal hj = BigDecimal.ZERO; BigDecimal qt = BigDecimal.ZERO; for(ServiceReimbursementdetail s : rd) { Map<String, Object> map=new HashMap<String, Object>(); @@ -828,26 +863,26 @@ days += s.getDays(); map.put("JT", s.getTraffictype() == null ? "" : s.getTraffictype()); map.put("QTFSM", s.getOtherfeedesc() == null ? "" : s.getOtherfeedesc()); map.put("JTF", s.getTrafficexpense() == 0.00 ? "" : String.format("%.2f", s.getTrafficexpense()).toString() + ""); te += s.getTrafficexpense(); map.put("SNJT", s.getCityfee() == 0.00 ? "" : String.format("%.2f", s.getCityfee()).toString() + ""); cf += s.getCityfee(); map.put("ZSF", s.getHotelexpense() == 0.00 ? "" : String.format("%.2f", s.getHotelexpense()).toString() + ""); he += s.getHotelexpense(); map.put("ZF", s.getOtherexpense() == 0.00 ? "" : String.format("%.2f", s.getOtherexpense()).toString() + ""); oe += s.getOtherexpense(); map.put("HSBX", s.getFoodexpenses() == 0.00 ? "" : String.format("%.2f",s.getFoodexpenses()).toString() + ""); fe += s.getFoodexpenses(); map.put("HSBZ", s.getFoodallowance() == 0.00 ? "" : String.format("%.2f",s.getFoodallowance()).toString() + ""); fa += s.getFoodallowance(); map.put("QTF", s.getOtherfeeamount() == 0.00 ? "" : String.format("%.2f",s.getOtherfeeamount()).toString() + ""); qt += s.getOtherfeeamount(); map.put("HJ", String.format("%.2f", s.getTrafficexpense() + s.getCityfee() + s.getHotelexpense() + s.getOtherexpense() + s.getFoodexpenses() + s.getFoodallowance() + s.getOtherfeeamount()).toString() + ""); hj += s.getTrafficexpense() + s.getCityfee() + s.getHotelexpense() + s.getOtherexpense() + s.getFoodexpenses() + s.getFoodallowance() + s.getOtherfeeamount(); map.put("JTF", s.getTrafficexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getTrafficexpense()).toString() + ""); te = te.add(s.getTrafficexpense()); map.put("SNJT", s.getCityfee().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getCityfee()).toString() + ""); cf = cf.add(s.getCityfee()); map.put("ZSF", s.getHotelexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getHotelexpense()).toString() + ""); he = he.add(s.getHotelexpense()); map.put("ZF", s.getOtherexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getOtherexpense()).toString() + ""); oe = oe.add(s.getOtherexpense()); map.put("HSBX", s.getFoodexpenses().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getFoodexpenses()).toString() + ""); fe = fe.add(s.getFoodexpenses()); map.put("HSBZ", s.getFoodallowance().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getFoodallowance()).toString() + ""); fa = fa.add(s.getFoodallowance()); map.put("QTF", s.getOtherfeeamount().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getOtherfeeamount()).toString() + ""); qt = qt.add(s.getOtherfeeamount()); map.put("HJ", String.format("%.2f", s.getTrafficexpense().add(s.getCityfee()).add(s.getHotelexpense()).add(s.getOtherexpense()).add(s.getFoodexpenses()).add(s.getFoodallowance()).add(s.getOtherfeeamount())).toString() + ""); hj = hj.add(s.getTrafficexpense().add(s.getCityfee()).add(s.getHotelexpense()).add(s.getOtherexpense()).add(s.getFoodexpenses()).add(s.getFoodallowance()).add(s.getOtherfeeamount())); //hj = Math.round(hj * 100) * 0.01d; DecimalFormat df = new DecimalFormat("0.00"); // DecimalFormat df = new DecimalFormat("0.00"); hj = new Double(df.format(hj).toString()); // hj = new Double(df.format(hj).toString()); newsList.add(map); } @@ -864,11 +899,11 @@ dataMap.put("TQTF", "" + String.format("%.2f", qt).toString() + ""); dataMap.put("THJ", "" + String.format("%.2f", hj).toString() + ""); dataMap.put("DS", convert(hj) + "æ´"); dataMap.put("DS", convert(hj.doubleValue()) + "æ´"); //dataMap.put("DS", "æ´"); dataMap.put("XS", String.format("%.2f", hj).toString() + ""); dataMap.put("R", serviceReimbursement.getCosttypename() == null ? "" : serviceReimbursement.getCosttypename()); dataMap.put("R", StringUtils.isEmpty(rdInfoByItem.get(0).getCosttypename()) ? "" : rdInfoByItem.get(0).getCosttypename()); } @@ -977,7 +1012,6 @@ System.out.println(result); return result; } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailController.java
@@ -1,7 +1,12 @@ package com.ruoyi.web.controller.project; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; import com.ruoyi.common.utils.bean.DtoConversionUtils; import com.ruoyi.project.domain.ServiceReimbursementdetailShared; import com.ruoyi.project.service.IServiceReimbursementdetailSharedService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -37,6 +42,8 @@ { @Autowired private IServiceReimbursementdetailService serviceReimbursementdetailService; @Autowired private IServiceReimbursementdetailSharedService detailSharedService; /** * æ¥è¯¢æ¥éç³è¯·æç»å表 @@ -109,15 +116,11 @@ public AjaxResult updateRDlList(@RequestBody List<ServiceReimbursementdetail> serviceReimbursementdetails) { for (ServiceReimbursementdetail serviceReimbursementdetail:serviceReimbursementdetails) { if(serviceReimbursementdetail.getId()!=null) { serviceReimbursementdetailService.updateById(serviceReimbursementdetail); }else { //妿ID为空ï¼åè¦æ°å¢ add(serviceReimbursementdetail); serviceReimbursementdetailService.saveOrUpdate(serviceReimbursementdetail); //æ°å¢æä¿®æ¹æ¥éç³è¯·æç»å享表 ServiceReimbursementdetailShared serviceReimbursementdetailShared = DtoConversionUtils.sourceToTarget(serviceReimbursementdetail, ServiceReimbursementdetailShared.class); detailSharedService.saveOrUpdate(serviceReimbursementdetailShared); } } // return toAjax("null"); return null; } ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailSharedController.java
@@ -1,4 +1,4 @@ package com.ruoyi.project.controller; package com.ruoyi.web.controller.project; import java.util.Arrays; import java.util.List; ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementpayeeController.java
@@ -1,13 +1,13 @@ package com.ruoyi.project.controller; package com.ruoyi.web.controller.project; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.ruoyi.project.domain.ReimbursementService; import com.ruoyi.common.utils.bean.DtoConversionUtils; import com.ruoyi.project.domain.Reimbursementpayee; import io.netty.util.internal.ObjectUtil; import com.ruoyi.project.domain.ServiceReimbursementpayeeShared; import com.ruoyi.project.service.IServiceReimbursementpayeeSharedService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; @@ -41,10 +41,12 @@ @Api("å·®æ æ¥é仿¬¾ä¿¡æ¯") @RestController @RequestMapping("/project/reimbursementpayee") public class ServiceReimbursementpayeeController extends BaseController { public class ServiceReimbursementpayeeController extends BaseController { @Autowired private IServiceReimbursementpayeeService serviceReimbursementpayeeService; @Autowired private IServiceReimbursementpayeeSharedService serviceReimbursementpayeeSharedService; /** * æ¥è¯¢å·®æ æ¥é仿¬¾ä¿¡æ¯å表 @@ -52,8 +54,7 @@ @ApiOperation("æ¥è¯¢å·®æ æ¥é仿¬¾ä¿¡æ¯å表") @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:list')") @GetMapping("/list") public TableDataInfo list(ServiceReimbursementpayee serviceReimbursementpayee) { public TableDataInfo list(ServiceReimbursementpayee serviceReimbursementpayee) { startPage(); List<ServiceReimbursementpayee> list = serviceReimbursementpayeeService.queryList(serviceReimbursementpayee); List<Reimbursementpayee> reimbursementpayees=new ArrayList<>(); @@ -79,8 +80,7 @@ @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:export')") @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceReimbursementpayee serviceReimbursementpayee) { public AjaxResult export(ServiceReimbursementpayee serviceReimbursementpayee) { List<ServiceReimbursementpayee> list = serviceReimbursementpayeeService.queryList(serviceReimbursementpayee); ExcelUtil<ServiceReimbursementpayee> util = new ExcelUtil<ServiceReimbursementpayee>(ServiceReimbursementpayee.class); return util.exportExcel(list, "å·®æ æ¥é仿¬¾ä¿¡æ¯æ°æ®"); @@ -92,42 +92,47 @@ @ApiOperation("è·åå·®æ æ¥é仿¬¾ä¿¡æ¯è¯¦ç»ä¿¡æ¯") @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceReimbursementpayeeService.getById(id)); } /** * æ°å¢å·®æ æ¥é仿¬¾ä¿¡æ¯ * æ°å¢æä¿®æ¹å·®æ æ¥é仿¬¾ä¿¡æ¯ */ @ApiOperation("æ°å¢å·®æ æ¥é仿¬¾ä¿¡æ¯") @ApiOperation("æ°å¢æä¿®æ¹å·®æ æ¥é仿¬¾ä¿¡æ¯") @PostMapping("/addOrUpdateRBpayee") public AjaxResult addOrUpdateRBpayee(@RequestBody List<Reimbursementpayee> reimbursementPayees) { List<ServiceReimbursementpayee> addserviceReimbursementpayees=new ArrayList<>(); List<ServiceReimbursementpayee> updateserviceReimbursementpayees=new ArrayList<>(); public AjaxResult addOrUpdateRBpayee(@RequestBody List<Reimbursementpayee> reimbursementPayees) { List<ServiceReimbursementpayee> payees = new ArrayList<>(); List<ServiceReimbursementpayeeShared> payeeSareds = new ArrayList<>(); for (Reimbursementpayee reimbursementPayee:reimbursementPayees) { ServiceReimbursementpayee serviceReimbursementpayee=new ServiceReimbursementpayee(); serviceReimbursementpayee.setRbid(reimbursementPayee.getRbid()); serviceReimbursementpayee.setPersonname(reimbursementPayee.getCol_personname()); serviceReimbursementpayee.setPersontype(reimbursementPayee.getCol_personType()); serviceReimbursementpayee.setBankname(reimbursementPayee.getCol_bank()); serviceReimbursementpayee.setBankcardno(reimbursementPayee.getCol_accounts()); serviceReimbursementpayee.setPaiddate(reimbursementPayee.getCol_date()); serviceReimbursementpayee.setRemark(reimbursementPayee.getCol_illustrate()); serviceReimbursementpayee.setId(reimbursementPayee.getId()); if(ObjectUtils.isEmpty(reimbursementPayee.getId())){ addserviceReimbursementpayees.add(serviceReimbursementpayee); }else { updateserviceReimbursementpayees.add(serviceReimbursementpayee); } //å°è£ æ¯ä»æ°æ® ServiceReimbursementpayee payee = new ServiceReimbursementpayee(); payee.setRbid(reimbursementPayee.getRbid()); payee.setPersonname(reimbursementPayee.getCol_personname()); payee.setPersontype(reimbursementPayee.getCol_personType()); payee.setBankname(reimbursementPayee.getCol_bank()); payee.setBankcardno(reimbursementPayee.getCol_accounts()); payee.setPaiddate(reimbursementPayee.getCol_date()); payee.setRemark(reimbursementPayee.getCol_illustrate()); payee.setId(reimbursementPayee.getId()); //å°è£ æ¯ä»åäº«æ°æ® ServiceReimbursementpayeeShared payeeShared = new ServiceReimbursementpayeeShared(); payeeShared.setRbid(reimbursementPayee.getRbid()); payeeShared.setPersonname(reimbursementPayee.getCol_personname()); payeeShared.setPersontype(reimbursementPayee.getCol_personType()); payeeShared.setBankname(reimbursementPayee.getCol_bank()); payeeShared.setBankcardno(reimbursementPayee.getCol_accounts()); payeeShared.setPaiddate(reimbursementPayee.getCol_date()); payeeShared.setRemark(reimbursementPayee.getCol_illustrate()); payeeShared.setId(reimbursementPayee.getId()); payees.add(payee); payeeSareds.add(payeeShared); } boolean b = false; if(!CollectionUtils.isEmpty(addserviceReimbursementpayees)){ b = serviceReimbursementpayeeService.saveBatch(addserviceReimbursementpayees); }else { b = serviceReimbursementpayeeService.updateBatchById(updateserviceReimbursementpayees); } b = serviceReimbursementpayeeService.saveOrUpdateBatch(payees); b = serviceReimbursementpayeeSharedService.saveOrUpdateBatch(payeeSareds); return toAjax(b); } @@ -139,8 +144,7 @@ @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.INSERT) @PostMapping @RepeatSubmit public AjaxResult add(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { public AjaxResult add(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { return toAjax(serviceReimbursementpayeeService.save(serviceReimbursementpayee)); } @@ -152,8 +156,7 @@ @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.UPDATE) @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { public AjaxResult edit(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { return toAjax(serviceReimbursementpayeeService.updateById(serviceReimbursementpayee)); } @@ -164,8 +167,7 @@ @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:remove')") @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceReimbursementpayeeService.removeByIds(Arrays.asList(ids))); } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -103,7 +103,7 @@ /** * è·åè·¯ç±ä¿¡æ¯ * * /addOrUpdateRBpayee/addOrUpdateRBpayee/addOrUpdateRBpayee * @return è·¯ç±ä¿¡æ¯ */ @GetMapping("getRouters") ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/DtoConversionUtils.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,64 @@ package com.ruoyi.common.utils.bean; import org.springframework.beans.BeanUtils; import java.util.ArrayList; import java.util.Collection; import java.util.List; /** * DTOåentityç¸äºè½¬åå·¥å ·ç±» * * @author liusheng * @date 2023/5/06 */ public class DtoConversionUtils { /** * entity转å为DTO * * @param source å®ä½ç±»entity * @param target ç®æ ç±»DTO * @return 转ååçDTO */ public static <T> T sourceToTarget(Object source, Class<T> target){ if(source == null){ return null; } T targetObject = null; try { targetObject = target.newInstance(); BeanUtils.copyProperties(source, targetObject); } catch (Exception e) { e.printStackTrace(); } return targetObject; } /** * List<entity>转å为List<DTO> * * @param sourceList å®ä½ç±»éåCollection<entity> * @param target ç®æ ç±»DTO * @return 转ååçCollection<DTO> */ public static <T> List<T> sourceToTarget(Collection<?> sourceList, Class<T> target){ if(sourceList == null){ return null; } ArrayList<T> targetList = new ArrayList<>(sourceList.size()); try { for(Object source : sourceList){ T targetObject = target.newInstance(); BeanUtils.copyProperties(source, targetObject); targetList.add(targetObject); } } catch (Exception e) { e.printStackTrace(); } return targetList; } } ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java
@@ -225,5 +225,15 @@ @ApiModelProperty("æç®å®¶å±äººæ°") private Integer donorrelatives; @ApiModelProperty("ç³è¯·æ¶é´") private Date createTime; // @ApiModelProperty("å¼å§æ¶é´") // private Date starttime; // // @ApiModelProperty("ç»ææ¶é´") // private Date endtime; } ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementEo.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,270 @@ package com.ruoyi.project.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; /** * æ¥éç³è¯·å¯¹è±¡å ¥å对象 * * @author åç * @date 2023-04-28 */ @Data @ApiModel("æ¥éç³è¯·å ¥åEO") public class ServiceReimbursementEo extends BaseEntity { /** $column.columnComment */ @ApiModelProperty("$column.columnComment") //æ°æ®åºèªå¢æ¹æ@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO) private Long id; /** æ¥é人ç¼å· */ @ApiModelProperty("æ¥é人ç¼å·") @Excel(name = "æ¥é人ç¼å·") private String userno; /** æ¥é人å§å */ @ApiModelProperty("æ¥é人å§å") @Excel(name = "æ¥é人å§å") private String username; /** è¯ä»¶ç±»å æ ¹æ®åå ¸sys_IDType */ @ApiModelProperty("è¯ä»¶ç±»å æ ¹æ®åå ¸sys_IDType") @Excel(name = "è¯ä»¶ç±»å æ ¹æ®åå ¸sys_IDType") private String idcardtype; /** è¯ä»¶å·ç */ @ApiModelProperty("è¯ä»¶å·ç ") @Excel(name = "è¯ä»¶å·ç ") private String idcardno; /** èç³»çµè¯ */ @ApiModelProperty("èç³»çµè¯") @Excel(name = "èç³»çµè¯") private String phone; /** 弿·é¶è¡ */ @ApiModelProperty("弿·é¶è¡") @Excel(name = "弿·é¶è¡") private String depositbank; /** å¡å· */ @ApiModelProperty("å¡å·") @Excel(name = "å¡å·") private String bankcardno; /** åè¡åç§° */ @ApiModelProperty("åè¡åç§°") @Excel(name = "åè¡åç§°") private String branchbankname; /** é¶è¡å¡ç §çè·¯å¾ å¤ä¸ªç¨;åå¼ */ @ApiModelProperty("é¶è¡å¡ç §çè·¯å¾ å¤ä¸ªç¨;åå¼") @Excel(name = "é¶è¡å¡ç §çè·¯å¾ å¤ä¸ªç¨;åå¼") private String annexbankcard; /** éä»¶è·¯å¾ å¤ä¸ªç¨;åå¼ */ @ApiModelProperty("éä»¶è·¯å¾ å¤ä¸ªç¨;åå¼") @Excel(name = "éä»¶è·¯å¾ å¤ä¸ªç¨;åå¼") private String annexfiles; /** ç³è¯·éé¢ */ @ApiModelProperty("ç³è¯·éé¢") @Excel(name = "ç³è¯·éé¢") private BigDecimal amountrequested; /** 交éè´¹ */ @ApiModelProperty("交éè´¹") @Excel(name = "交éè´¹") private BigDecimal trafficexpense; /** ä½å®¿è´¹ */ @ApiModelProperty("ä½å®¿è´¹") @Excel(name = "ä½å®¿è´¹") private BigDecimal hotelexpense; /** ä¼é£è´¹ */ @ApiModelProperty("ä¼é£è´¹") @Excel(name = "ä¼é£è´¹") private BigDecimal foodexpenses; /** ä¼é£è´¹è¡¥å© */ @ApiModelProperty("ä¼é£è´¹è¡¥å©") @Excel(name = "ä¼é£è´¹è¡¥å©") private BigDecimal foodallowance; /** æè´¹ */ @ApiModelProperty("æè´¹") @Excel(name = "æè´¹") private BigDecimal otherexpense; /** å ¶ä»è´¹ç¨éé¢ */ @ApiModelProperty("å ¶ä»è´¹ç¨éé¢") @Excel(name = "å ¶ä»è´¹ç¨éé¢") private BigDecimal otherfeeamount; /** 颿¯è´¹ç¨ */ @ApiModelProperty("颿¯è´¹ç¨") @Excel(name = "颿¯è´¹ç¨") private Double prepaidamount; /** åç¥¨å¼ æ° */ @ApiModelProperty("åç¥¨å¼ æ°") @Excel(name = "åç¥¨å¼ æ°") private Long invoicecount; /** éä»¶æ° */ @ApiModelProperty("éä»¶æ°") @Excel(name = "éä»¶æ°") private Long attachcount; /** é¨é¨ä¸»ç®¡å·¥å· */ @ApiModelProperty("é¨é¨ä¸»ç®¡å·¥å·") @Excel(name = "é¨é¨ä¸»ç®¡å·¥å·") private String managerno; /** é¨é¨ä¸»ç®¡åå */ @ApiModelProperty("é¨é¨ä¸»ç®¡åå") @Excel(name = "é¨é¨ä¸»ç®¡åå") private String managername; /** é¨é¨ç¼å· */ @ApiModelProperty("é¨é¨ç¼å·") @Excel(name = "é¨é¨ç¼å·") private String deptmentno; /** é¨é¨åç§° */ @ApiModelProperty("é¨é¨åç§°") @Excel(name = "é¨é¨åç§°") private String deptmentname; /** ä¸å¿ç¾å */ @ApiModelProperty("ä¸å¿ç¾å") @Excel(name = "ä¸å¿ç¾å") private String opochecker; /** è´¢å¡å¯é¢é¿ç¾å */ @ApiModelProperty("è´¢å¡å¯é¢é¿ç¾å") @Excel(name = "è´¢å¡å¯é¢é¿ç¾å") private String finvicepresident; /** ä¸å¡å¯é¢é¿ç¾å */ @ApiModelProperty("ä¸å¡å¯é¢é¿ç¾å") @Excel(name = "ä¸å¡å¯é¢é¿ç¾å") private String busvicepresident; /** åå ¬å®¤ä¸»ä»»ç¾å */ @ApiModelProperty("åå ¬å®¤ä¸»ä»»ç¾å") @Excel(name = "åå ¬å®¤ä¸»ä»»ç¾å") private String officedirector; /** è´¢å¡å®¤ä¸»ä»»ç¾å */ @ApiModelProperty("è´¢å¡å®¤ä¸»ä»»ç¾å") @Excel(name = "è´¢å¡å®¤ä¸»ä»»ç¾å") private String financedirector; /** è´¢å¡å®¡æ ¸ */ @ApiModelProperty("è´¢å¡å®¡æ ¸") @Excel(name = "è´¢å¡å®¡æ ¸") private String financechecher; /** å ³èservice_donatebaseinfo表çID */ @ApiModelProperty("å ³èservice_donatebaseinfo表çID") @Excel(name = "å ³èservice_donatebaseinfo表çID") private Long infoid; /** æç®è ç¼å· */ @ApiModelProperty("æç®è ç¼å·") @Excel(name = "æç®è ç¼å·") private String donorno; /** è®°å½ç¶æ */ @ApiModelProperty("è®°å½ç¶æ") @Excel(name = "è®°å½ç¶æ") private Integer recordstatus; /** ä¸ä¼ æ å¿ */ @ApiModelProperty("ä¸ä¼ æ å¿") @Excel(name = "ä¸ä¼ æ å¿") private String uploadflag; /** ä¸ä¼ æ¶é´ */ @ApiModelProperty("ä¸ä¼ æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "ä¸ä¼ æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date uploadtime; @ApiModelProperty("åºå·®äºº") @Excel(name = "åºå·®äºº") private String travelers; @ApiModelProperty("åºå·®äºç±") private String reason; @ApiModelProperty("æç®è å§å") private String donorname; @ApiModelProperty("æ»éé¢") private Double totalamount; @ApiModelProperty("æ»éé¢ç大å") private String bigstrmoney; /** éä»¶å°åï¼add by yangjb 20221124 */ @ApiModelProperty("éä»¶å°å") private String fileurl; private String remark; /** å½åå®¡æ ¸çº§å« å¤äºåªä¸ªé¶æ®µ 0ï¼ç³è¯·ï¼1ï¼ä¸çº§å®¡æ ¸ï¼2ï¼äºçº§å®¡æ ¸ï¼3ï¼ä¸çº§å®¡æ ¸ç */ @ApiModelProperty("å½åå®¡æ ¸çº§å«") private Long flowlevel; /** è´¹ç¨å½å±ï¼0ï¼å ¶ä»äººåï¼1ï¼ä¸è人åï¼2ï¼åè°åï¼3ï¼ä¸å®¶ï¼4ï¼æç®è å®¶å± */ @ApiModelProperty("è´¹ç¨å½å±") private String persontype; /** è´¹ç¨å½å±æè¿° */ @ApiModelProperty("è´¹ç¨å½å±æè¿°") private String costtypename; @ApiModelProperty("æç®å®¶å±é¶è¡") private String donorbank; @ApiModelProperty("æç®å®¶å±é¶è¡å¡å·") private String donorbankcard; @ApiModelProperty("æç®å®¶å±è´¹ç¨è¯´æ") private String donorremark; @ApiModelProperty("æç®å®¶å±è´¹ç¨éé¢") private Double donoramount; @ApiModelProperty("æç®å®¶å±äººæ°") private Integer donorrelatives; @ApiModelProperty("ç³è¯·æ¶é´") private Date createTime; @ApiModelProperty("ç³è¯·æ¶é´") private Date starttime; @ApiModelProperty("ç³è¯·æ¶é´") private Date endtime; } ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetail.java
@@ -64,7 +64,7 @@ /** 交éè´¹ */ @ApiModelProperty("交éè´¹") @Excel(name = "交éè´¹") private Double trafficexpense; private BigDecimal trafficexpense; /** 交éå·¥å · */ @ApiModelProperty("交éå·¥å ·") @@ -74,12 +74,12 @@ /** å¸å 交éè´¹ */ @ApiModelProperty("å¸å 交éè´¹") @Excel(name = "å¸å 交éè´¹") private Double cityfee; private BigDecimal cityfee; /** ä½å®¿è´¹ */ @ApiModelProperty("ä½å®¿è´¹") @Excel(name = "ä½å®¿è´¹") private Double hotelexpense; private BigDecimal hotelexpense; /** åç¥¨å¼ æ° */ @ApiModelProperty("åç¥¨å¼ æ°") @@ -94,17 +94,17 @@ /** æè´¹ */ @ApiModelProperty("æè´¹") @Excel(name = "æè´¹") private Double otherexpense; private BigDecimal otherexpense; /** ä¼é£è´¹ */ @ApiModelProperty("ä¼é£è´¹") @Excel(name = "ä¼é£è´¹") private Double foodexpenses; private BigDecimal foodexpenses; /** ä¼é£è´¹è¡¥å© */ @ApiModelProperty("ä¼é£è´¹è¡¥å©") @Excel(name = "ä¼é£è´¹è¡¥å©") private Double foodallowance; private BigDecimal foodallowance; /** é件表 */ @ApiModelProperty("é件表") @@ -154,7 +154,7 @@ @Excel(name = "æå±è¡éï¼éï¼åç§°") private String traveltownname; private Double otherfeeamount; private BigDecimal otherfeeamount; private String otherfeedesc; ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetailShared.java
@@ -177,15 +177,15 @@ @Excel(name = "å ¶ä»è´¹ç¨è¯´æ") private String otherfeedesc; /** éé¢-æ¥å£ */ @ApiModelProperty("éé¢-æ¥å£") @Excel(name = "éé¢-æ¥å£") private String jine; /** çç±-æ¥å£ */ @ApiModelProperty("çç±-æ¥å£") @Excel(name = "çç±-æ¥å£") private String liyou; // /** éé¢-æ¥å£ */ // @ApiModelProperty("éé¢-æ¥å£") // @Excel(name = "éé¢-æ¥å£") // private String jine; // // /** çç±-æ¥å£ */ // @ApiModelProperty("çç±-æ¥å£") // @Excel(name = "çç±-æ¥å£") // private String liyou; } ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceReimbursementMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.util.List; import com.ruoyi.project.domain.ServiceReimbursement; import com.ruoyi.project.domain.ServiceReimbursementEo; import com.ruoyi.project.domain.dto.ServiceReimbursementDto; import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut; import org.apache.ibatis.annotations.Param; @@ -33,4 +34,12 @@ List<ServiceReimbursement> getInfoByInfoId(Long infoid); List<ServiceReimbursement> getInfoByInfoIdRelatives(Long infoid); /** * * @param serviceReimbursementEo * @return */ List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo); } ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceReimbursementService.java
@@ -3,6 +3,7 @@ import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.project.domain.ServiceReimbursement; import com.ruoyi.project.domain.ServiceReimbursementEo; import com.ruoyi.project.domain.ServiceReimbursementdetail; import com.ruoyi.project.domain.dto.ServiceReimbursementDto; import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut; @@ -35,4 +36,6 @@ List<ServiceReimbursement> getInfoByInfoId(Long infoid); List<ServiceReimbursement> getInfoByInfoIdRelatives(Long infoid); List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo); } ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -2,6 +2,7 @@ import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.project.domain.ServiceReimbursementEo; import com.ruoyi.project.domain.ServiceReimbursementdetail; import com.ruoyi.project.domain.ServiceRelativesconfirmation; import com.ruoyi.project.domain.dto.ServiceReimbursementDto; @@ -106,4 +107,10 @@ return serviceReimbursementMapper.getInfoByInfoIdRelatives(infoid); } @Override public List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo){ return serviceReimbursementMapper.getRDInfoByItem(serviceReimbursementEo); } } ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailServiceImpl.java
@@ -1,9 +1,11 @@ package com.ruoyi.project.service.impl; import java.math.BigDecimal; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.project.domain.ServiceReimbursement; import com.ruoyi.project.mapper.ServiceReimbursementMapper; import com.ruoyi.project.mapper.ServiceReimbursementdetailSharedMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -28,6 +30,9 @@ @Autowired ServiceReimbursementdetailMapper serviceReimbursementdetailMapper; @Autowired ServiceReimbursementdetailSharedMapper detailSharedMapper; @Autowired ServiceReimbursementMapper serviceReimbursementMapper; @@ -77,10 +82,15 @@ Long rbid = serviceReimbursementdetail.getRbid(); ServiceReimbursement serviceReimbursement = serviceReimbursementMapper.selectById(rbid); Double amount = serviceReimbursement.getAmountrequested(); amount = amount - serviceReimbursementdetail.getTrafficexpense() - serviceReimbursementdetail.getCityfee() - serviceReimbursementdetail.getHotelexpense() - serviceReimbursementdetail.getFoodexpenses() - serviceReimbursementdetail.getFoodallowance() - serviceReimbursementdetail.getOtherexpense() - serviceReimbursementdetail.getOtherfeeamount(); serviceReimbursement.setAmountrequested(amount); BigDecimal subtract = BigDecimal.valueOf(amount).subtract(serviceReimbursementdetail.getTrafficexpense()).subtract(serviceReimbursementdetail.getCityfee()).subtract(serviceReimbursementdetail.getHotelexpense()) .subtract(serviceReimbursementdetail.getFoodexpenses()).subtract(serviceReimbursementdetail.getFoodallowance()) .subtract(serviceReimbursementdetail.getOtherexpense()).subtract(serviceReimbursementdetail.getOtherfeeamount()); serviceReimbursement.setAmountrequested(subtract.doubleValue()); int updateAmount = serviceReimbursementMapper.updateById(serviceReimbursement); detailSharedMapper.deleteById(id); return serviceReimbursementdetailMapper.deleteById(id); } ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailSharedServiceImpl.java
@@ -124,12 +124,12 @@ if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getOtherfeedesc())){ wrappers.eq(ServiceReimbursementdetailShared::getOtherfeedesc ,serviceReimbursementdetailShared.getOtherfeedesc()); } if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getJine())){ wrappers.eq(ServiceReimbursementdetailShared::getJine ,serviceReimbursementdetailShared.getJine()); } if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getLiyou())){ wrappers.eq(ServiceReimbursementdetailShared::getLiyou ,serviceReimbursementdetailShared.getLiyou()); } // if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getJine())){ // wrappers.eq(ServiceReimbursementdetailShared::getJine ,serviceReimbursementdetailShared.getJine()); // } // if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getLiyou())){ // wrappers.eq(ServiceReimbursementdetailShared::getLiyou ,serviceReimbursementdetailShared.getLiyou()); // } return this.list(wrappers); } ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml
@@ -58,16 +58,67 @@ </resultMap> <sql id="selectServiceReimbursementVo"> select ID, del_flag, create_by, create_time, update_by, update_time, UserNo, UserName, IDCardType, IDCardNo, Phone, DepositBank, BankCardNo, BranchBankName, AnnexBankCard, AnnexFiles, AmountRequested, PrepaidAmount, InvoiceCount, AttachCount, ManagerNo, ManagerName, DeptmentNo, DeptmentName, OPOchecker, FinVicePresident, BusVicePresident, OfficeDirector, FinanceDirector, FinanceChecher, InfoID, DonorNo, remark, RecordStatus, uploadflag, uploadtime, Travelers, DonorName, Reason, FlowLevel, costtype, costtypename,fileurl,donorbank,donorbankcard,donorremark, donoramount,donorrelatives from service_reimbursement select ID, del_flag, create_by, create_time, update_by, update_time, UserNo, UserName, IDCardType, IDCardNo, Phone, DepositBank, BankCardNo, BranchBankName, AnnexBankCard, AnnexFiles, AmountRequested, PrepaidAmount, InvoiceCount, AttachCount, ManagerNo, ManagerName, DeptmentNo, DeptmentName, OPOchecker, FinVicePresident, BusVicePresident, OfficeDirector, FinanceDirector, FinanceChecher, InfoID, DonorNo, remark, RecordStatus, uploadflag, uploadtime, Travelers, DonorName, Reason, FlowLevel, costtype, costtypename, fileurl, donorbank, donorbankcard, donorremark, donoramount, donorrelatives from service_reimbursement </sql> <select id="selectServiceReimbursementList" parameterType="ServiceReimbursement" resultMap="ServiceReimbursementResult"> <select id="selectServiceReimbursementList" parameterType="ServiceReimbursement" resultMap="ServiceReimbursementResult"> <include refid="selectServiceReimbursementVo"/> <where> <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> <if test="createTime != null "> and create_time = #{createTime}</if> <if test="username != null and username != ''"> and UserName like concat('%', #{username}, '%')</if> <if test="deptmentname != null and deptmentname != ''"> and DeptmentName like concat('%', #{deptmentname}, '%')</if> <if test="deptmentname != null and deptmentname != ''">and DeptmentName like concat('%', #{deptmentname}, '%') </if> <if test="donorno != null and donorno != ''"> and DonorNo = #{donorno}</if> <if test="recordstatus != null and recordstatus != ''"> and RecordStatus = #{recordstatus}</if> <if test="uploadflag != null and uploadflag != ''"> and uploadflag = #{uploadflag}</if> @@ -75,20 +126,24 @@ </where> </select> <select id="getMaxId" resultType="java.lang.Long"> select max(ID) from service_reimbursement select max(ID) from service_reimbursement </select> <select id="selectSearchList" resultMap="ServiceReimbursementResult"> <include refid="selectServiceReimbursementVo"/> <where> <if test="createTime != null and createTime != ''" > and create_time >= #{searchstarttime} and create_time <= #{searchendtime} </if> <if test="createTime != null and createTime != ''">and create_time >= #{searchstarttime} and create_time <= #{searchendtime} </if> <if test="travelers != null and travelers != ''"> and Travelers = #{travelers}</if> </where> </select> <select id="getListBypower" statementType="CALLABLE" resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut"> <select id="getListBypower" statementType="CALLABLE" resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut"> call SP_FINANCIAL_EXPENSES(#{PAUSERNO,mode=IN,jdbcType=VARCHAR},#{PAFUNDTYPE,mode=IN,jdbcType=INTEGER},#{PAAPPLICANT,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONBEGTIME,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONENDTIME,mode=IN,jdbcType=VARCHAR},#{PADEPARTMENT,mode=IN,jdbcType=VARCHAR},#{CHECKFLAG,mode=IN,jdbcType=INTEGER},#{APPLYTYPE,mode=IN,jdbcType=INTEGER}) </select> <select id="getInfoByInfoId" resultType="com.ruoyi.project.domain.ServiceReimbursement"> @@ -100,4 +155,34 @@ where infoid = #{infoid} and del_flag = '0' and costtype = "4" </select> <select id="getRDInfoByItem" resultType="com.ruoyi.project.domain.ServiceReimbursementEo"> SELECT a.id as id,a.UserNo as userno,a.FlowLevel as recordstatus,b.persontype as persontype,a.create_time as createTime, a.UserName as username,b.personname as travelers,a.AmountRequested as amountrequested,a.Reason as reason,a.Phone as phone,a.DepositBank as depositbank,a.BankCardNo as bankcardno,a.DonorName as donorname,b.trafficexpense as trafficexpense,b.hotelexpense as hotelexpense,b.FoodExpenses as foodexpenses, b.foodallowance as foodallowance, b.otherexpense as otherexpense,b.otherfeeamount as otherfeeamount FROM service_reimbursement a LEFT JOIN service_reimbursementdetail b on a.id=b.RBID where a.del_flag != 1 and b.del_flag!=1 <if test="id != null"> and a.id = #{id} </if> <if test='travelers != null and travelers != ""'> and b.personname=#{travelers} </if> <if test='username != null and username != ""'> and a.UserName=#{username} </if> <if test='recordstatus != null and recordstatus != ""'> and a.FlowLevel=#{recordstatus} </if> <if test='travelers != null and travelers != ""'> and b.personname=#{travelers} </if> <if test='starttime != null and endtime != ""'> and a.create_time BETWEEN #{starttime} AND #{endtime} </if> ORDER BY a.id desc </select> </mapper>