From 717613a313c8d7a1c7f8485944c8ce69f9c0e34b Mon Sep 17 00:00:00 2001 From: leewand <1005070037@qq.com> Date: Fri, 24 Jul 2020 10:17:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?wb=20=E5=85=B6=E4=BB=96=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E3=80=81=E5=8E=BB=E6=8E=89=E7=89=B9=E6=89=B9=E3=80=81=E5=B7=AE?= =?UTF-8?q?=E6=97=85=E8=B4=B9=E5=8F=AA=E4=BF=9D=E5=AD=98=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/wb/ribs/biz/ApproveRoleBiz.java | 44 +++++++-- .../neuray/security/wb/ribs/biz/QtfyBiz.java | 69 +++++++++++++ .../neuray/security/wb/ribs/biz/RibsBiz.java | 49 +++++++++- .../security/wb/ribs/biz/WechatBiz.java | 65 +++++++++++-- .../wb/ribs/controller/QtController.java | 73 ++++++++++++++ .../wb/ribs/controller/RibsController.java | 96 ++++++++++++++++++- .../security/wb/ribs/mapper/QtfyMapper.java | 15 +++ .../neuray/security/wb/ribs/vo/QtVo.java | 37 +++++++ .../main/resources/mapper/ribs/QtfyMapper.xml | 62 ++++++++++++ 9 files changed, 481 insertions(+), 29 deletions(-) create mode 100644 neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/QtfyBiz.java create mode 100644 neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/QtController.java create mode 100644 neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/mapper/QtfyMapper.java create mode 100644 neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java create mode 100644 neuray-pm-provider/neuray-pm-provider-wb/src/main/resources/mapper/ribs/QtfyMapper.xml diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java index ccd4153..775f334 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java @@ -55,7 +55,7 @@ public class ApproveRoleBiz extends BaseBiz { query.put("querytype","approve"); } query.put("rolebmfzr",true); - }else if("2".equals(roleId)){ + /*}else if("2".equals(roleId)){ if("approve".equals(type)){ bxztStrs.add("3"); query.put("querytype","approve"); @@ -63,7 +63,7 @@ public class ApproveRoleBiz extends BaseBiz { query.put("showall",true); query.put("querytype","query"); } - query.put("rolezjl",true); + query.put("rolezjl",true);*/ }else if("3".equals(roleId)){ if("approve".equals(type)){ bxztStrs.add("4"); @@ -124,6 +124,7 @@ public class ApproveRoleBiz extends BaseBiz { approveRoleVo.setStaffId(staffId); List roleIds = new ArrayList<>(); roleIds = super.selectList(approveRoleVo); + List bxztStrs = new ArrayList<>(); // 查询页面和审批页面各角色可见范围 // 如果是负责人,则只能看见自己部门的人员 if(roleIds!=null && roleIds.size()!=0){ @@ -131,13 +132,38 @@ public class ApproveRoleBiz extends BaseBiz { query.put("staffId",staffId); } } + roleIds = super.selectList(approveRoleVo); + if(roleIds != null && roleIds.size() != 0) { + for (ApproveRoleVo item : roleIds) { + // 查询页面和审批页面各角色可见范围 + // 如果是负责人,则只能看见自己部门的人员 + String roleId = item.getRoleId(); + String deptCode = item.getDeptCode(); + if ("1".equals(roleId)) { + query.put("staffId", staffId); + query.put("querytype", "query"); + query.put("rolebmfzr", true); + } else if ("3".equals(roleId)) { + query.put("showall", true); + query.put("querytype", "query"); + query.put("rolekj", true); + } else if ("4".equals(roleId)) { + query.put("showall", true); + query.put("querytype", "query"); + query.put("rolecwzj", true); + } + } + if (bxztStrs.size() != 0) { + query.put("bxzts", bxztStrs); + } + } /* 审批页面各角色可见范围 审批角色( 1、部门审批负责人 2、总经理 3、会计 4、财务总监 ) 报销状态( 1、已保存 2、已提交 3、已初审 4、已复审 5、驳回 6、已复核 7、已打款 ) 角色-状态 1-2,2-3,3-4,3-6 */ - if("1".equals(roleIds.get(0).getRoleId())){ + /*if("1".equals(roleIds.get(0).getRoleId())){ query.put("bxzt","2"); }else if("2".equals(roleIds.get(0).getRoleId())){ query.put("bxzt","3"); @@ -145,7 +171,7 @@ public class ApproveRoleBiz extends BaseBiz { query.put("bxzt","4"); }else if("4".equals(roleIds.get(0).getRoleId())){ query.put("bxzt","6"); - } + }*/ //Query query = new Query(query); List list = approveRoleMapper.page(query); @@ -169,10 +195,10 @@ public class ApproveRoleBiz extends BaseBiz { query.put("staffId", staffId); query.put("querytype", "approve"); query.put("rolebmfzr", true); - } else if ("2".equals(roleId)) { + /*} else if ("2".equals(roleId)) { bxztStrs.add("3"); query.put("querytype", "approve"); - query.put("rolezjl", true); + query.put("rolezjl", true);*/ } else if ("3".equals(roleId)) { bxztStrs.add("4"); query.put("querytype", "approve"); @@ -209,8 +235,8 @@ public class ApproveRoleBiz extends BaseBiz { if("1".equals(vo.getRoleId())){ param.put("staffId",staffId); param.put("roleBmfzr",true); - }else if("2".equals(vo.getRoleId())){ - param.put("roleZjl",true); + /*}else if("2".equals(vo.getRoleId())){ + param.put("roleZjl",true);*/ }else if("3".equals(vo.getRoleId())){ param.put("roleKj",true); }else if("4".equals(vo.getRoleId())){ @@ -237,7 +263,7 @@ public class ApproveRoleBiz extends BaseBiz { // } // // } - String[] arr = { "1","2","3"}; + String[] arr = { "1","2","3","4"}; List list = new ArrayList<>(); for(String str:arr){ param.put("bxlx",str); diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/QtfyBiz.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/QtfyBiz.java new file mode 100644 index 0000000..3063c0f --- /dev/null +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/QtfyBiz.java @@ -0,0 +1,69 @@ +package com.gitee.neuray.security.wb.ribs.biz; + +import com.gitee.neuray.security.common.biz.BaseBiz; +import com.gitee.neuray.security.common.msg.TableResultResponse; +import com.gitee.neuray.security.common.util.Query; +import com.gitee.neuray.security.common.util.UUIDUtils; +import com.gitee.neuray.security.wb.ribs.mapper.QtfyMapper; +import com.gitee.neuray.security.wb.ribs.vo.QtVo; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +@Transactional(rollbackFor = Exception.class) +public class QtfyBiz extends BaseBiz { + @Autowired private QtfyMapper qtfyMapper; + + /** + * 获取交通费信息 + * + * @param query + * @return + */ + public TableResultResponse getQtInfo(Query query) { + // query.put("staffId", request.getHeader("userId")); + Page result = PageHelper.startPage(query.getPageNo(), query.getPageSize()); + List list = qtfyMapper.getQtInfo(query); + return new TableResultResponse( + result.getPageSize(), result.getPageNum(), result.getPages(), result.getTotal(), list); + } + + /** 删除交通费信息 */ + public void delQt(String id) { + super.deleteById(id); + } + + /** + * 修改交通费信息 + * + * @param qtVo + */ + public void updQt(QtVo qtVo) { + super.updateSelectiveById(qtVo); + } + + /** + * 新增交通费 + * + * @param qtVo + */ + public void insertQt(QtVo qtVo) { + String id = UUIDUtils.generateShortUuid(); + qtVo.setId(id); + super.insertSelective(qtVo); + } + + @Override + protected String getPageName() { + return null; + } + + public List queryQt(QtVo qtVo){ + return qtfyMapper.queryQt(qtVo); + } +} diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/RibsBiz.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/RibsBiz.java index b2d4b0f..d086158 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/RibsBiz.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/RibsBiz.java @@ -31,13 +31,16 @@ public class RibsBiz extends BaseBiz { @Autowired private ClfBiz clfBiz; @Autowired private JtfBiz jtfBiz; @Autowired private CyfBiz cyfBiz; + @Autowired private QtfyBiz qtfyBiz; @Autowired private ClfMapper clfMapper; @Autowired private JtfMapper jtfMapper; @Autowired private CyfMapper cyfMapper; + @Autowired private QtfyMapper qtfyMapper; @Autowired private ApproveRoleMapper approveRoleMapper; @Autowired private HistoryMapper historyMapper; @Autowired private WechatBiz wechatBiz; @Autowired private StaffFeign staffFeign; + @Autowired private ApproveRoleBiz approveRoleBiz; /** * 分页获取信息 * @@ -91,13 +94,33 @@ public class RibsBiz extends BaseBiz { System.out.println("STEP5-------------------------------------"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); //插入历史表 //如果是经理特批的提交,则代表是部门负责人提交,则历史表里新增一条提交操作 - if("3".equals(ribsVo.getBxzt()) && "2".equals(ribsVo.getTp())){ + + String staffId = ribsVo.getStaffId(); + ApproveRoleVo approveRoleVo = new ApproveRoleVo(); + approveRoleVo.setStaffId(staffId); + List list = approveRoleBiz.selectList(approveRoleVo); + boolean flag = false; + for(ApproveRoleVo role : list){ + if("1".equals(role.getRoleId())){ + flag = true; + break; + } + } + // 如果提交人有部门负责人角色,则新增一条提交。 + if(flag){ RibsVo ribsVoCopy = new RibsVo(); BeanUtils.copyProperties(ribsVo,ribsVoCopy); ribsVoCopy.setBxzt("2"); ribsVo.setYj("同意"); insertHistory(ribsVoCopy,null,userId); } + /*if("3".equals(ribsVo.getBxzt()) && "2".equals(ribsVo.getTp())){ + RibsVo ribsVoCopy = new RibsVo(); + BeanUtils.copyProperties(ribsVo,ribsVoCopy); + ribsVoCopy.setBxzt("2"); + ribsVo.setYj("同意"); + insertHistory(ribsVoCopy,null,userId); + }*/ insertHistory(ribsVo,null,userId); System.out.println("STEP6-------------------------------------"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); @@ -142,6 +165,14 @@ public class RibsBiz extends BaseBiz { List jtfVos = jtfBiz.queryJtf(jtfVo); ret.put("data",jtfVos); ret.put("type","jtf"); + //其他费用 + }else if("5".equals(ribsVo.getBxlx())){ + QtVo qtVo = new QtVo(); + qtVo.setBxdh(bxdh); + qtVo.setStaffId(staffId); + List qtVos = qtfyBiz.queryQt(qtVo); + ret.put("data",qtVos); + ret.put("type","jtf"); } return ret; @@ -191,9 +222,10 @@ public class RibsBiz extends BaseBiz { ribsVo.setBxzt("3"); } //2总经理审批 设置为已复审 - }else if("2".equals(roleId)){ + // 去掉总经理审批 + /*}else if("2".equals(roleId)){ ribsVo.setBxzt("4"); - //3会计审核 设置为已复核 + //3会计审核 设置为已复核*/ }else if("3".equals(roleId)){ ribsVo.setBxzt("6"); //4财务总监审核 设置为已打款 @@ -259,6 +291,13 @@ public class RibsBiz extends BaseBiz { CyfVo cyfVo = new CyfVo(); cyfVo.setBczt(ribsVo.getBxzt()); cyfMapper.updateByExampleSelective(cyfVo,example); + }else if("5".equals(bxlx)){ + Example example = new Example(QtVo.class); + Example.Criteria criteria = example.createCriteria(); + criteria.andEqualTo("bxdh",bxdh); + QtVo qtVo = new QtVo(); + qtVo.setBczt(ribsVo.getBxzt()); + qtfyMapper.updateByExampleSelective(qtVo,example); } } @@ -336,8 +375,8 @@ public class RibsBiz extends BaseBiz { //之前状态为已提交的角色为部门负责人,已初审角色为总经理,已复审角色为会计,已复核角色为财务总监 if("2".equals(bxztBefore)){ roleId = "1"; - }else if("3".equals(bxztBefore)){ - roleId = "2"; + /*}else if("3".equals(bxztBefore)){ + roleId = "2";*/ }else if("4".equals(bxztBefore)){ roleId = "3"; }else if("6".equals(bxztBefore)){ diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/WechatBiz.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/WechatBiz.java index b6cd04f..b22f9bf 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/WechatBiz.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/WechatBiz.java @@ -12,10 +12,7 @@ import com.gitee.neuray.security.wb.ribs.util.PoiUtil; import com.gitee.neuray.security.wb.ribs.util.wechat.Dictionary; import com.gitee.neuray.security.wb.ribs.util.wechat.HttpUtil; import com.gitee.neuray.security.wb.ribs.util.wechat.entity.*; -import com.gitee.neuray.security.wb.ribs.vo.ClfVo; -import com.gitee.neuray.security.wb.ribs.vo.CyfVo; -import com.gitee.neuray.security.wb.ribs.vo.JtfVo; -import com.gitee.neuray.security.wb.ribs.vo.RibsVo; +import com.gitee.neuray.security.wb.ribs.vo.*; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; @@ -75,6 +72,9 @@ public class WechatBiz { @Autowired private JtfBiz jtfBiz; + @Autowired + private QtfyBiz qtfyBiz; + @Autowired private RibsBiz ribsBiz; @@ -234,6 +234,7 @@ public class WechatBiz { List clfVos = new ArrayList<>(); List jtfVos = new ArrayList<>(); List cyfVos = new ArrayList<>(); + List qtVos = new ArrayList<>(); XSSFSheet fkdSheet = wb.getSheetAt(1); // XSSFSheet jtfSheet = wb.getSheetAt(2); // XSSFSheet cyfSheet = wb.getSheetAt(3); @@ -253,6 +254,11 @@ public class WechatBiz { cyfVo.setBxdh(bxdh); cyfVos = cyfBiz.selectList(cyfVo); cyfSheet(wb,cyfVos,staff); + }else if("5".equals(bxlx)){ //餐饮费 + QtVo qtVo = new QtVo(); + qtVo.setBxdh(bxdh); + qtVos = qtfyBiz.selectList(qtVo); + qtSheet(wb,qtVos,staff); } System.out.println("STEP7-------------------------------------"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); //处理付款单 @@ -327,8 +333,11 @@ public class WechatBiz { //计算需要新增的行数 int clfVosSize = clfVos.size(); int insertRows = 0; - if(clfVosSize*2 > 6){ + /*if(clfVosSize*2 > 6){ insertRows = clfVosSize*2 - 6; + }*/ + if(clfVosSize > 6){ + insertRows = clfVosSize - 6; } //新增行 if(insertRows != 0){ @@ -352,8 +361,8 @@ public class WechatBiz { clfSheet.getRow(position).getCell(6).setCellValue(Double.valueOf(clfVos.get(i).getCcbz() == null || "".equals(clfVos.get(i).getCcbz()) ? "0" : clfVos.get(i).getCcbz())); clfSheet.getRow(position).getCell(7).setCellValue(clfVos.get(i).getZsts()); clfSheet.getRow(position).getCell(8).setCellValue(clfVos.get(i).getZsrs()); - clfSheet.getRow(position).getCell(9).setCellValue(clfVos.get(i).getZsje() == null || "".equals(clfVos.get(i).getZsje()) ? "0" : clfVos.get(i).getZsje()); - clfSheet.getRow(position).getCell(10).setCellValue(clfVos.get(i).getZsbz() == null || "".equals(clfVos.get(i).getZsbz()) ? "0" : clfVos.get(i).getZsbz()); + clfSheet.getRow(position).getCell(9).setCellValue(Double.valueOf(clfVos.get(i).getZsje() == null || "".equals(clfVos.get(i).getZsje()) ? "0" : clfVos.get(i).getZsje())); + clfSheet.getRow(position).getCell(10).setCellValue(Double.valueOf(clfVos.get(i).getZsbz() == null || "".equals(clfVos.get(i).getZsbz()) ? "0" : clfVos.get(i).getZsbz())); String qtfy = ""; String qtfysm = ""; @@ -370,12 +379,12 @@ public class WechatBiz { clfSheet.getRow(position).getCell(11).setCellValue(qtfy+ "(" + qtfysm + ")。" +bz); - position ++; + /*position ++; //回程 clfSheet.getRow(position).getCell(0).setCellValue(clfVos.get(i).getBCfsj()); clfSheet.getRow(position).getCell(1).setCellValue(clfVos.get(i).getBCfd()); clfSheet.getRow(position).getCell(2).setCellValue(clfVos.get(i).getBMdd()); - /** 去_出行方式 codelist name = CXFS 1、火车及动车 2、飞机 3其他 */ + *//** 去_出行方式 codelist name = CXFS 1、火车及动车 2、飞机 3其他 *//* if("1".equals(clfVos.get(i).getBCxfs())||"2".equals(clfVos.get(i).getBCxfs())){ clfSheet.getRow(position).getCell(3).setCellValue(Double.valueOf(clfVos.get(i).getBJtf())); }else if("3".equals(clfVos.get(i).getBCxfs())){ @@ -384,7 +393,7 @@ public class WechatBiz { clfSheet.getRow(position).getCell(5).setCellValue(Double.valueOf(clfVos.get(i).getBJtf())); } clfSheet.getRow(position).getCell(11).setCellValue(clfVos.get(i).getBz()); - +*/ position ++ ; } XSSFFormulaEvaluator.evaluateAllFormulaCells(wb); @@ -443,6 +452,42 @@ public class WechatBiz { return cyfSheet; } + + /** + * 其他费用 + * @param wb + * @param qtVos + * @param staffInfo + * @return + */ + public XSSFSheet qtSheet(XSSFWorkbook wb, List qtVos, Map staffInfo){ + String name = staffInfo.get("name").toString(); + XSSFSheet qtSheet = wb.getSheetAt(5); + // BigDecimalUtils.add(); + //计算需要新增的行数 + int qtVosSize = qtVos.size(); + int insertRows = 0; + if(qtVosSize > 6){ + insertRows = qtVosSize - 6; + } + //新增行 + if(insertRows != 0){ + PoiUtil.insertRow(qtSheet,7,insertRows); + } + int position = 3; + for(int i = 0;i params) { + // 查询列表数据 + String ids = ""; + if(params.get("bczt") != null && !"".equals(params.get("bczt"))){ + ids = params.get("bczt").toString(); + String[] idsStrs = ids.split(","); + params.put("bczt",idsStrs); + } + Query query = new Query(params); + return qtfyBiz.getQtInfo(query); + } + + /** + * 填报餐饮费 + * + * @return + */ + @RequestMapping(value = "insertQt", method = RequestMethod.POST) + public ObjectRestResponse insertQt(@RequestBody QtVo qtVo) { + qtfyBiz.insertQt(qtVo); + return new ObjectRestResponse().rel(true); + } + /** + * 餐饮费修改 + * + * @return + */ + @RequestMapping(value = "updQt", method = RequestMethod.PUT) + public ObjectRestResponse updQt(@RequestBody QtVo qtVo) { + qtfyBiz.updQt(qtVo); + return new ObjectRestResponse().rel(true); + } + /** + * 餐饮费删除 + * + * @return + */ + @RequestMapping(value = "delQt/{id}", method = RequestMethod.DELETE) + public ObjectRestResponse delQt(@PathVariable String id) { + qtfyBiz.delQt(id); + return new ObjectRestResponse().rel(true); + } +} diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java index 3710754..e094b93 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java @@ -38,6 +38,7 @@ public class RibsController { @Autowired private ClfBiz clfBiz; @Autowired private CyfBiz cyfBiz; @Autowired private JtfBiz jtfBiz; + @Autowired private QtfyBiz qtfyBiz; @Autowired private WechatBiz wechatBiz; @Autowired private ApproveRoleBiz approveRoleBiz; @Autowired private StaffFeign staffFeign; @@ -132,7 +133,8 @@ public class RibsController { // 特殊:如果乘坐的是火车一等座或者飞机,需要特批。 // 为避免不必要的数据库交互,先确定报销为非特批 - if("0".equals(ribsVo.getTp())){ + // 去掉特批 + /*if("0".equals(ribsVo.getTp())){ List clfVos = new ArrayList<>(); ClfVo clfVo = new ClfVo(); clfVo.setBxdh(bxdh); @@ -144,7 +146,7 @@ public class RibsController { ribsVo.setTp("1"); } } - } + }*/ System.out.println("STEP4-------------------------------------"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); ribsBiz.commitBXD(ribsVo,bxdh,userId); @@ -325,6 +327,85 @@ public class RibsController { return new ObjectRestResponse().rel(true); } + /** + * 提交市内交通费 + * + * @return + */ + @RequestMapping(value = "commitQt", method = RequestMethod.POST) + public ObjectRestResponse commitQt(@RequestBody Map map,HttpServletRequest request) { + + String wxUserId = request.getHeader("wxUserId"); + String orgCode = request.getHeader("orgCode"); + String accessToken = request.getHeader("wxAccessToken"); + String userId = request.getHeader("userId"); + String orgName = null; + try { + orgName = URLDecoder.decode(request.getHeader("orgName"),"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + String name = null; + try { + name = URLDecoder.decode(request.getHeader("name"),"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + String position = null; + try { + position = URLDecoder.decode(request.getHeader("position"),"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + Map wechatInfo = new HashMap(); + Map staffInfo = new HashMap(); + wechatInfo.put("wxUserId",wxUserId); + wechatInfo.put("accessToken",accessToken); + + staffInfo.put("orgCode",orgCode); + staffInfo.put("orgName",orgName); + staffInfo.put("position",position); + staffInfo.put("name",name); + + RibsVo ribsVo = JSONObject.parseObject(JSONObject.toJSONString(map.get("ribsVo")),RibsVo.class); + /*Map wechatInfo = JSONObject.parseObject(JSONObject.toJSONString(map.get("wechatInfo")),Map.class); + Map staffInfo = JSONObject.parseObject(JSONObject.toJSONString(map.get("staffInfo")),Map.class);*/ + wechatInfo.put("ids",ribsVo.getIds()); + // 生成报销单号 + String bxdh = ""; + if("ribsVo.getBxdh()".equals(ribsVo.getBxdh())||null == ribsVo.getBxdh()){ + bxdh = createBxdh("JTF"); + }else{ + bxdh = ribsVo.getBxdh(); + } + + ribsVo.setBxzt("2"); + + //检验是否特批 + checkTp(ribsVo); + + // 修改子表差旅费状态为提交,修改报销单号 + for (int i = 0; i < ribsVo.getIds().split(",").length; i++) { + QtVo qtVo = new QtVo(); + qtVo.setBczt(ribsVo.getBxzt()); // 保存状态 + qtVo.setId(ribsVo.getIds().split(",")[i]); // ID + qtVo.setBxdh(bxdh); // 报销单号 + qtfyBiz.updQt(qtVo); + } + // 提交报销单 + //ribsVo.setBxdh(bxdh); + ribsVo.setIds(null); + + ribsBiz.commitBXD(ribsVo,bxdh,userId); + try { + wechatBiz.excelAndSend(wechatInfo,"市内交通费",ribsVo,staffInfo,request); + } catch (IOException e) { + e.printStackTrace(); + } + return new ObjectRestResponse().rel(true); + } + /** * 报销单删除 * @@ -346,6 +427,10 @@ public class RibsController { CyfVo cyfVo = new CyfVo(); cyfVo.setBxdh(bxdh); cyfBiz.delete(cyfVo); + }else if("others".equals(type)){ + QtVo qtVo = new QtVo(); + qtVo.setBxdh(bxdh); + qtfyBiz.delete(qtVo); } HistoryVo historyVo = new HistoryVo(); historyVo.setBxdh(bxdh); @@ -500,11 +585,12 @@ public class RibsController { ribsVo.setTp("1"); }*/ - //如果是部门审批人提交,走总经理特批 + // //如果是部门审批人提交,走总经理特批 (废除) + // 如果是部门负责人提交,状态置为已复审 if(list != null && list.size() != 0){ if("1".equals(list.get(0).getRoleId())){ - ribsVo.setTp("2"); - ribsVo.setBxzt("3"); + // ribsVo.setTp("2"); + ribsVo.setBxzt("4"); } } } diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/mapper/QtfyMapper.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/mapper/QtfyMapper.java new file mode 100644 index 0000000..1af673f --- /dev/null +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/mapper/QtfyMapper.java @@ -0,0 +1,15 @@ +package com.gitee.neuray.security.wb.ribs.mapper; + +import com.gitee.neuray.security.common.util.Query; +import com.gitee.neuray.security.wb.ribs.vo.JtfVo; +import com.gitee.neuray.security.wb.ribs.vo.QtVo; +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.BaseMapper; +import tk.mybatis.mapper.common.Mapper; + +import java.util.List; +@Repository +public interface QtfyMapper extends Mapper { + List getQtInfo(Query query); + List queryQt(QtVo qtVo); +} diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java new file mode 100644 index 0000000..3c5066e --- /dev/null +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java @@ -0,0 +1,37 @@ +package com.gitee.neuray.security.wb.ribs.vo; + +import com.gitee.neuray.security.common.entity.BaseEntity; +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.Table; +import java.util.Date; + +/** + * 其他费用 + */ +@Data +@Table(name = "T_WB_QTFY") +public class QtVo extends BaseEntity { + + @Column(name = "BXDH") + private String bxdh; + @Column(name = "STAFF_ID") + private String staffId; + @Column(name = "BXDH") + private String deptCode; + @Column(name = "BXDH") + private String sy; + @Column(name = "BXDH") + private String je; + @Column(name = "BXDH") + private String bz; + @Column(name = "BXDH") + private String bczt; + @Column(name = "BXDH") + private String zdsy; + @Column(name = "fssj") + private Date fssj; + + +} diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/resources/mapper/ribs/QtfyMapper.xml b/neuray-pm-provider/neuray-pm-provider-wb/src/main/resources/mapper/ribs/QtfyMapper.xml new file mode 100644 index 0000000..4d14497 --- /dev/null +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/resources/mapper/ribs/QtfyMapper.xml @@ -0,0 +1,62 @@ + + + + + + + + + + -- Gitee From 0e8a9925db4f1eae74b9b534400e07fcc428e5bc Mon Sep 17 00:00:00 2001 From: leewand <1005070037@qq.com> Date: Fri, 24 Jul 2020 10:35:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?wb=20=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gitee/neuray/security/wb/ribs/vo/QtVo.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java index 3c5066e..9e0f9b6 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java @@ -18,19 +18,19 @@ public class QtVo extends BaseEntity { private String bxdh; @Column(name = "STAFF_ID") private String staffId; - @Column(name = "BXDH") + @Column(name = "DEPT_CODE") private String deptCode; - @Column(name = "BXDH") + @Column(name = "SY") private String sy; - @Column(name = "BXDH") + @Column(name = "JE") private String je; - @Column(name = "BXDH") + @Column(name = "BZ") private String bz; - @Column(name = "BXDH") + @Column(name = "BCZT") private String bczt; - @Column(name = "BXDH") + @Column(name = "ZDSY") private String zdsy; - @Column(name = "fssj") + @Column(name = "FSSJ") private Date fssj; -- Gitee From 2db977381412f287659090fcc349dd53287b9a1b Mon Sep 17 00:00:00 2001 From: leewand <1005070037@qq.com> Date: Fri, 24 Jul 2020 13:33:27 +0800 Subject: [PATCH 3/3] wb --- .../com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java | 2 +- .../neuray/security/wb/ribs/controller/RibsController.java | 2 +- .../main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java index 775f334..0444dd1 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/biz/ApproveRoleBiz.java @@ -263,7 +263,7 @@ public class ApproveRoleBiz extends BaseBiz { // } // // } - String[] arr = { "1","2","3","4"}; + String[] arr = { "1","2","3","5"}; List list = new ArrayList<>(); for(String str:arr){ param.put("bxlx",str); diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java index e094b93..6c327de 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/controller/RibsController.java @@ -399,7 +399,7 @@ public class RibsController { ribsBiz.commitBXD(ribsVo,bxdh,userId); try { - wechatBiz.excelAndSend(wechatInfo,"市内交通费",ribsVo,staffInfo,request); + wechatBiz.excelAndSend(wechatInfo,"其他费用",ribsVo,staffInfo,request); } catch (IOException e) { e.printStackTrace(); } diff --git a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java index 9e0f9b6..0f8df54 100644 --- a/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java +++ b/neuray-pm-provider/neuray-pm-provider-wb/src/main/java/com/gitee/neuray/security/wb/ribs/vo/QtVo.java @@ -28,8 +28,6 @@ public class QtVo extends BaseEntity { private String bz; @Column(name = "BCZT") private String bczt; - @Column(name = "ZDSY") - private String zdsy; @Column(name = "FSSJ") private Date fssj; -- Gitee