add 接收会员系统推送的开票邮寄数据
This commit is contained in:
+1
-1
@@ -107,7 +107,7 @@ public class AuthenticationUtils {
|
||||
* @param requestParam
|
||||
* @param requestBody
|
||||
*/
|
||||
public static void postStandards(String methodName,String requestParam,Object requestBody) {
|
||||
public static void post(String methodName, String requestParam, Object requestBody) {
|
||||
Map<String, String> stringStringMap = encryptByRsaPriKey();
|
||||
String publicKey = stringStringMap.get("publicKey");
|
||||
String token = stringStringMap.get("token");
|
||||
|
||||
+13
-56
@@ -265,67 +265,24 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
|
||||
tbMemberProjectSubitem.setMail(2);
|
||||
tbMemberProjectSubitemService.updateById(tbMemberProjectSubitem);
|
||||
}
|
||||
//推送邮寄数据到会员系统
|
||||
payMailBillService.pushSendToStandards(payMailBill,one.getProjectId());
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 编辑
|
||||
// *
|
||||
// */
|
||||
// @ApiOperation(value="邮寄票据-修改", notes="邮寄票据-修改")
|
||||
// @Transactional
|
||||
// @PostMapping(value = "/edit2")
|
||||
// public Result<?> edit2(@RequestBody PayMailBill payMailBill
|
||||
// ) {
|
||||
// payMailBill.setPostStatus(1);
|
||||
// payMailBillService.updateById(payMailBill);
|
||||
// return Result.OK("编辑成功!");
|
||||
// }
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="邮寄票据-通过id删除", notes="邮寄票据-通过id删除")
|
||||
// @DeleteMapping(value = "/delete")
|
||||
// public Result<?> delete(@RequestParam(name="id") String id) {
|
||||
// payMailBillService.removeById(id);
|
||||
// return Result.OK("删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="邮寄票据-批量删除", notes="邮寄票据-批量删除")
|
||||
// @DeleteMapping(value = "/deleteBatch")
|
||||
// public Result<?> deleteBatch(@RequestParam(name="ids") String ids) {
|
||||
// this.payMailBillService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
// return Result.OK("批量删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="邮寄票据-通过id查询", notes="邮寄票据-通过id查询")
|
||||
// @GetMapping(value = "/queryById")
|
||||
// public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
// PayMailBill payMailBill = payMailBillService.getById(id);
|
||||
// if(payMailBill==null) {
|
||||
// return Result.error("未找到对应数据");
|
||||
// }
|
||||
// return Result.OK(payMailBill);
|
||||
// }
|
||||
/**
|
||||
* 接收会员系统开票邮寄信息
|
||||
*
|
||||
*/
|
||||
@ApiOperation(value="接收会员系统开票邮寄信息", notes="接收会员系统开票邮寄信息")
|
||||
@Transactional
|
||||
@PostMapping(value = "/addFromStandards")
|
||||
public Result<?> addFromStandards(@RequestBody PayMailBill payMailBill) {
|
||||
payMailBillService.addFromStandards(payMailBill);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@@ -104,6 +105,11 @@ public class PayMailBill implements Serializable {
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String remark;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String projectId;
|
||||
/**项目名称*/
|
||||
@Excel(name = "项目名称", width = 15)
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
|
||||
+11
-1
@@ -37,6 +37,16 @@ public interface IPayMailBillService extends IService<PayMailBill> {
|
||||
*/
|
||||
Result<?> addPayBill(PayMailBillVO payMailBill);
|
||||
|
||||
|
||||
/**
|
||||
* 推送邮寄数据到会员系统
|
||||
* @param payMailBill
|
||||
* @param id
|
||||
*/
|
||||
void pushSendToStandards(PayMailBill payMailBill, String id);
|
||||
|
||||
/**
|
||||
* 接收会员系统开票邮寄信息
|
||||
* @param payMailBill
|
||||
*/
|
||||
void addFromStandards(PayMailBill payMailBill);
|
||||
}
|
||||
|
||||
+37
-17
@@ -3,22 +3,16 @@ package com.jero.mail.service.impl;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.AuthenticationUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.contract.common.PayIncomeContractCommon;
|
||||
import com.jero.mail.PayMailBillVO;
|
||||
import com.jero.mail.entity.BillingInfo;
|
||||
import com.jero.mail.entity.PayMailBill;
|
||||
import com.jero.mail.entity.PayMailBillProject;
|
||||
import com.jero.mail.entity.PayMailBillSearch;
|
||||
import com.jero.mail.mapper.PayMailBillMapper;
|
||||
import com.jero.mail.mapper.PayMailBillProjectMapper;
|
||||
import com.jero.mail.service.IPayMailBillProjectService;
|
||||
@@ -26,30 +20,23 @@ import com.jero.mail.service.IPayMailBillService;
|
||||
import com.jero.meeting.entity.PayMeetingSituation;
|
||||
import com.jero.meeting.mapper.PayMeetingSituationMapper;
|
||||
import com.jero.member.entity.PayMemberProjectSubitem;
|
||||
import com.jero.member.entity.TbMemberProject;
|
||||
import com.jero.member.entity.TbMemberProjectSubitem;
|
||||
import com.jero.member.mapper.PayMemberProjectSubitemMapper;
|
||||
import com.jero.member.mapper.TbMemberProjectMapper;
|
||||
import com.jero.member.mapper.TbMemberProjectSubitemMapper;
|
||||
import com.jero.payment.entity.PayPaymentRecord;
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItem;
|
||||
import com.jero.project.mapper.PayCommonProjectMapper;
|
||||
import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -77,6 +64,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
@Resource
|
||||
private TbMemberProjectSubitemMapper tbMemberProjectSubitemMapper;
|
||||
@Resource
|
||||
private TbMemberProjectMapper tbMemberProjectMapper;
|
||||
@Resource
|
||||
private PayMailBillMapper payMailBillMapper;
|
||||
@Resource
|
||||
private PayMailBillProjectMapper payMailBillProjectMapper;
|
||||
@@ -173,7 +162,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
billingInfo.setMemberId(tbMemberProjectSubitem.getMemberId());
|
||||
billingInfo.setBillNo(payMailBill.getBillNo());
|
||||
//调用接口
|
||||
AuthenticationUtils.postStandards("/billingInfo/billingInfo/billFromPayment",null,billingInfo);
|
||||
AuthenticationUtils.post("/billingInfo/billingInfo/billFromPayment",null,billingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,6 +188,37 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
AuthenticationUtils.checkResult(post);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFromStandards(PayMailBill payMailBill) {
|
||||
String projectId = payMailBill.getProjectId();
|
||||
LambdaQueryWrapper<TbMemberProjectSubitem> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TbMemberProjectSubitem::getTbPaymentId,projectId);
|
||||
TbMemberProjectSubitem tbMember = tbMemberProjectSubitemMapper.selectOne(wrapper);
|
||||
BigDecimal amountReceivable = tbMember.getAmountReceivable();
|
||||
tbMember.setMakeInvoice(1);
|
||||
tbMember.setMail(1);
|
||||
tbMember.setInvoiceAmount(amountReceivable);
|
||||
tbMember.setPaidAmount(amountReceivable);
|
||||
tbMemberProjectSubitemMapper.updateById(tbMember);
|
||||
//添加邮寄表
|
||||
String memberProjectId = tbMember.getProjectId();
|
||||
TbMemberProject tbMemberProject = tbMemberProjectMapper.selectById(memberProjectId);
|
||||
payMailBill.setProjectName(tbMemberProject.getProjectName());
|
||||
payMailBill.setChargeCompanyName(tbMember.getCompanyName());
|
||||
payMailBill.setInvoiceAmount(amountReceivable);
|
||||
payMailBill.setPostStatus(1);
|
||||
payMailBill.setMobile(PasswordUtil.decrypt(payMailBill.getMobile()));
|
||||
payMailBill.setBillDate(payMailBill.getSendDate());
|
||||
payMailBillService.save(payMailBill);
|
||||
//添加关联关系
|
||||
PayMailBillProject bmp = new PayMailBillProject();
|
||||
bmp.setBillId(payMailBill.getId());
|
||||
bmp.setProjectId(projectId);
|
||||
bmp.setProjectType(5);
|
||||
bmp.setInvoiceAmount(amountReceivable);
|
||||
payMailBillProjectService.save(bmp);
|
||||
}
|
||||
|
||||
|
||||
//校验不同项目是否属于同一个公司
|
||||
private String checkCompanyProject(List<PayMailBillProject> bmpList) {
|
||||
|
||||
Reference in New Issue
Block a user