Commit 369bc32d authored by 徐州's avatar 徐州

非税通知书-自动缴销需求提交

parent 4bea66da
......@@ -9,6 +9,10 @@
{
window.location.href="${ctx}/jsp/accountBank/downloadFile.action?attachId="+id;
}
function viewFs(fsId) {
createSimpleWindow("win_fstzs","打印非税通知书","${ctx}/jsp/fstzs/winPrintFstzs.action?id=" + fsId,900,700);
}
</script>
</head>
<body>
......@@ -30,14 +34,29 @@
<td width="35%" >${accountBank.remark}</td>
</tr>
<c:if test="${accountBank.hasInvoice == 0}">
<c:forEach var="c" items="${attach}" varStatus="status">
<tr>
<th width="15%">附件${status.count}</th>
<td colspan="4" style="text-align: left;">
<a href="javascript:opendoc('${c.id}')"><font style="color:blue">${c.attachname}</font></a> </br>
</td>
</tr>
</c:forEach>
<c:choose>
<c:when test="${not empty accountBank.fsId}">
<tr>
<th width="15%">附件</th>
<td colspan="4" style="text-align: left;">
<a href="#" class="btn_01" onclick=viewFs('${accountBank.fsId}');>查看<b></b></a>
</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="c" items="${attach}" varStatus="status">
<tr>
<th width="15%">附件${status.count}</th>
<td colspan="4" style="text-align: left;">
<a href="javascript:opendoc('${c.id}')"><font style="color:blue">${c.attachname}</font></a> </br>
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</c:if>
<tr>
</tr>
......
......@@ -123,7 +123,7 @@
<tr>
<th width="15">应缴总面积(平方米)</th>
<td width="35%">
<input id="csmj" name="fstzsXm.paymentItemPending.csmj" style="width:90%" value="${fstzsXm.paymentItemPending.csmj}" disabled/>
<input id="csmj" name="fstzsXm.xmxxb.csmj" style="width:90%" value="${fstzsXm.xmxxb.csmj}" disabled/>
</td>
<th width="15">收费标准(元)</th>
......@@ -396,12 +396,11 @@
}else if (typeof(num) === 'number' && isNaN(num)) {
$.messager.alert('提示', '请输入正确的数字!');
} else {
//计算应缴面积
var yjmjNums = numb / 150
var x = String(yjmjNums).indexOf(".")+1;//得到小数点的位置
var y = String(yjmjNums).length - x;//小数点的位数
if(y > 2) {
if(x != 0 && y > 2) {
$.messager.alert('提示', '请输入正确的应缴金额!');
$(this).parent().prev().text('');
return false;
......
......@@ -53,10 +53,10 @@
}
}},
{field:'zyjje',title:'项目总应缴金额',width:150,formatter: function (value, row, index){
return (parseFloat(row.paymentItemPending.zyjje).toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');
return (parseFloat(row.xmxxb.yjje).toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');
}},
{field:'jzmj',title:'总建筑面积',width:150,formatter: function (value, row, index){
return row.paymentItemPending.csmj;
return row.xmxxb.csmj;
}}
]]
}));
......
......@@ -121,7 +121,7 @@
<tr>
<th width="15">应缴总面积(平方米)</th>
<td width="35%">
<input id="csmj" name="fstzsXm.paymentItemPending.csmj" style="width:90%" value="${fstzsXm.paymentItemPending.csmj}" disabled/>
<input id="csmj" name="fstzsXm.xmxxb.csmj" style="width:90%" value="${fstzsXm.xmxxb.csmj}" disabled/>
</td>
<th width="15">收费标准(元)</th>
......
......@@ -46,7 +46,6 @@
function dayin(id){
var dt=new Date();
createSimpleWindow("win_fstzs","打印非税通知书","${ctx}/jsp/fstzs/winPrintFstzs.action?id=" + id,900,700);
}
function reloadDate(){
......
......@@ -120,10 +120,10 @@
}
}},
{field:'zyjje',title:'项目总应缴金额',width:150,formatter: function (value, row, index){
return (parseFloat(row.paymentItemPending.zyjje).toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');
return (parseFloat(row.xmxxb.yjje).toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');
}},
{field:'jzmj',title:'总建筑面积',width:100,formatter: function (value, row, index){
return row.paymentItemPending.csmj;
return row.xmxxb.csmj;
}},
{field:'status',title:'是否复核',width:80,formatter: function (value, row, index){
if (value == 1) return "待复核";
......
......@@ -92,6 +92,11 @@ public class AccountBank extends BaseModel
* 子系统类型
*/
private String sysType;
/**
* 如果是由非税查询状态时,自动插入的数据,则存一下fs记录的id
*/
private String fsId;
public AccountBank(){
}
......@@ -235,4 +240,12 @@ public class AccountBank extends BaseModel
public void setSysType(String sysType) {
this.sysType = sysType;
}
public String getFsId() {
return fsId;
}
public void setFsId(String fsId) {
this.fsId = fsId;
}
}
......@@ -276,7 +276,7 @@ public class AccountBankServiceImpl extends BaseServiceImpl implements AccountBa
String ECN = "PZ"+xmxxb.getBllb()+xmxxb.getDwdm().toUpperCase()+genericManager.getSN("dzpz");
paymentItemHis.setECN(ECN);
//转入已缴款项目
paymentItemHisDao.save(paymentItemHis);
paymentItemHisDao.save(paymentItemHis);//???
//清除待缴款项目
paymentItemPendingDao.delete(paymentItemPending.getId());
//若是催缴项目,则需要清除催缴记录
......
......@@ -136,6 +136,12 @@ public class Fstzs extends BaseModel {
*/
private String jkqd;
/**
* 缴款渠道
* 11柜面缴款和13网上缴款
*/
private String jkqdCode;
/**
* 操作激活的时间
*/
......@@ -416,4 +422,12 @@ public class Fstzs extends BaseModel {
public void setYjjeQfw(String yjjeQfw) {
this.yjjeQfw = yjjeQfw;
}
public String getJkqdCode() {
return jkqdCode;
}
public void setJkqdCode(String jkqdCode) {
this.jkqdCode = jkqdCode;
}
}
......@@ -101,10 +101,8 @@ public class FstzsXm extends BaseModel
*/
private String fhyj;
/**
* 对应项目信息主键
*/
private PaymentItemPending paymentItemPending;
private Xmxxb xmxxb;
/**
* 对应的收款人
......@@ -118,6 +116,11 @@ public class FstzsXm extends BaseModel
*/
private String jhjd;
/**
* 项目是否缴销
*/
private Integer isJx;
public Integer getStatus() {
return status;
......@@ -215,14 +218,14 @@ public class FstzsXm extends BaseModel
this.yjjedx = yjjedx;
}
@ManyToOne(fetch = FetchType.EAGER, targetEntity=PaymentItemPending.class)
@JoinColumn(name = "PENDING_ZJ",updatable=false,insertable=true)
public PaymentItemPending getPaymentItemPending() {
return paymentItemPending;
@ManyToOne(fetch = FetchType.EAGER, targetEntity=Xmxxb.class)
@JoinColumn(name = "XMXXB_ZJ",updatable=false,insertable=true)
public Xmxxb getXmxxb() {
return xmxxb;
}
public void setPaymentItemPending(PaymentItemPending paymentItemPending) {
this.paymentItemPending = paymentItemPending;
public void setXmxxb(Xmxxb xmxxb) {
this.xmxxb = xmxxb;
}
@ManyToOne(fetch = FetchType.EAGER, targetEntity=Kpsjgl.class)
......@@ -261,4 +264,11 @@ public class FstzsXm extends BaseModel
this.jkrlx = jkrlx;
}
public Integer getIsJx() {
return isJx;
}
public void setIsJx(Integer isJx) {
this.isJx = isJx;
}
}
......@@ -14,11 +14,17 @@ public class JkztResp {
public String confirmDate;
/**
* 缴款渠道(代码)
* 缴款渠道
*/
@SerializedName("payment_channel")
public String paymentChannel;
/**
* 缴款渠道(代码)
*/
@SerializedName("payment_channel_code")
public String paymentChannelCode;
/**
* 缴款银行
*/
......
......@@ -2,6 +2,17 @@ package com.jshx.fstzs.web;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jshx.account.accountBank.entity.AccountBank;
import com.jshx.account.accountBank.service.AccountBankService;
import com.jshx.account.paymentVoucher.service.PaymentVoucherService;
import com.jshx.account.paymentVoucherHis.entity.PaymentVoucherHis;
import com.jshx.account.paymentVoucherHis.service.PaymentVoucherHisService;
import com.jshx.billManager.entity.BillManager;
import com.jshx.billManager.entity.Indeticur;
import com.jshx.billManager.service.BillManagerService;
import com.jshx.billlq.entity.Billlq;
import com.jshx.billlq.service.BilllqService;
import com.jshx.common.utils.Constant;
import com.jshx.common.utils.NumberToCN;
import com.jshx.core.base.action.BaseAction;
import com.jshx.core.base.vo.Pagination;
......@@ -17,10 +28,20 @@ import com.jshx.fstzs.fsutil.bean.KpResp;
import com.jshx.fstzs.service.FstzsService;
import com.jshx.fstzs.service.FstzsXmService;
import com.jshx.fstzs.fsutil.FsRequest;
import com.jshx.jtqd.entity.Jtqd;
import com.jshx.jtqd.service.JtqdService;
import com.jshx.kpsjgl.service.KpsjglService;
import com.jshx.module.admin.service.UserRoleService;
import com.jshx.paymentItemDelay.entity.PaymentItemDelay;
import com.jshx.paymentItemDelay.service.PaymentItemDelayService;
import com.jshx.paymentItemHis.entity.PaymentItemHis;
import com.jshx.paymentItemHis.service.PaymentItemHisService;
import com.jshx.pjjx.entity.Pjjx;
import com.jshx.pjjx.service.PjjxService;
import com.jshx.xmxxb.entity.Xmxxb;
import com.jshx.xmxxb.service.XmxxbService;
import com.neusoft.egov.utils.TextUtils;
import com.neusoft.egov.utils.billendnumber;
import net.sf.json.JsonConfig;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,6 +66,40 @@ public class FstzsAction extends BaseAction {
@Autowired
KpsjglService kpsjglService;
/**
* 缴费到账入库↓
*/
@Autowired
private UserRoleService userRoleService;
@Autowired
private AccountBankService accountBankService;
/**
* 缴费到账入库↑
*/
/**
* 票据领用缴销↓
*/
@Autowired
private BillManagerService billManagerService;
@Autowired
private PaymentVoucherService paymentVoucherService;
@Autowired
private PaymentVoucherHisService paymentVoucherHisService;
@Autowired
private BilllqService billlqService;
@Autowired
private PjjxService pjjxService;
@Autowired
private PaymentItemDelayService paymentItemDelayService;
@Autowired
private PaymentItemHisService paymentItemHisService;
@Autowired
private JtqdService jtqdService;
/**
* 票据领用缴销↑
*/
/**
* 分页信息
*/
......@@ -231,15 +286,12 @@ public class FstzsAction extends BaseAction {
Fstzs f = new Fstzs();
f.setJkr(fstzsXm.getJsdwmc());
f.setYjje(fstzsXm.getYjje());
f.setYjmj(fstzsXm.getPaymentItemPending().getCsmj());
f.setYjmj(fstzsXm.getXmxxb().getCsmj());
fstzsList.add(f);
}
if(TextUtils.isEmpty(fstzsXm.getMobile())) {
Xmxxb bySlbh = xmxxbService.getBySlbh(fstzsXm.getSlbh());
if(bySlbh != null) {
fstzsXm.setMobile(bySlbh.getPhone());
}
fstzsXm.setMobile(fstzsXm.getXmxxb().getPhone());
}
} catch (Exception e) {}
return VIEW;
......@@ -497,6 +549,7 @@ public class FstzsAction extends BaseAction {
}
this.getResponse().getWriter().println("{\"result\":"+result+",\"message\":\"" + message + "!"+"\"}");
jiaoxiao(xm);
}
......@@ -559,18 +612,206 @@ public class FstzsAction extends BaseAction {
//1,查询全部未激活的信息
List<Fstzs> list = fstzsService.findList(paraMap);
list.stream().map(i-> {
list.stream().map(i -> {
//2,循环接口请求缴费状态
FsResult<JkztResp> jiaokuanzt = FsRequest.jiaokuanzt(i);
if(jiaokuanzt.success) {
if (jiaokuanzt.success) {
i.setStatus(3);//已缴款
i.setIsJk(1);
i.setJkTime(jiaokuanzt.data.confirmDate);
i.setJkqd(jiaokuanzt.data.paymentChannel);
i.setJkqdCode(jiaokuanzt.data.paymentChannelCode);
fstzsService.update(i);
}
return i;
}).forEach(i-> System.out.println("查询缴费状态!"));
}).filter(i-> i.getIsJk() == 1 && "13".equals(i.getJkqdCode()))//筛选出网上缴款的单子
.forEach(i-> {//存入银行到账表
AccountBank accountBank = new AccountBank();
accountBank.setFsId(i.getId());
String sysType = userRoleService.childSysType(getLoginUser());
accountBank.setSysType(sysType);
accountBank.setDelFlag(0);
accountBank.setRemark("线上缴款");
accountBank.setDeptId(this.getLoginUserDepartmentId());
accountBank.setStatus(Constant.AUDIT_STATUS_NO);
accountBank.setDevelopUnit(i.getJkr());
accountBank.setAmount(Double.parseDouble(i.getYjje()));
accountBank.setArrivalTime(new Date());
accountBank.setHasInvoice("0");
accountBankService.save(accountBank,null,null);
});
}
private void jiaoxiao(FstzsXm xm) {
if(xm == null) return;
if(xm.getIsJx() != null && xm.getIsJx() == 1) return;
Map<String, Object> paraMap = new HashMap();
paraMap.put("slbh",new ArrayList<String>(){{
add(xm.getSlbh());
}});
//查询项目的所有缴款人
List<Fstzs> fsList = fstzsService.findList(paraMap);
if(fsList == null || fsList.size() == 0) return;
//筛选出未交款的列表
List<Fstzs> wjk = fsList.stream().filter(i -> i.getIsJk() != 1).collect(Collectors.toList());
if(wjk != null && wjk.size() > 0) return;//有人未交款,不处理
//未开票
List<Fstzs> wkp = fsList.stream().filter(i -> i.getKpState() == null || i.getKpState() == 0).collect(Collectors.toList());
if(wkp != null && wkp.size() > 0) return;//有人开票,不处理
try {
uploadVoucherInfotb(xm,fsList);
xm.setIsJx(1);
fstzsXmService.update(xm);
} catch (Exception e) {
e.printStackTrace();
}
}
public void uploadVoucherInfotb(FstzsXm xm,List<Fstzs> fstzsList) throws Exception{
// String result ="1|成功";
PaymentVoucherHis paymentVoucherHis = new PaymentVoucherHis();
paymentVoucherHis.setXmmc(xm.getGcxmmc());
paymentVoucherHis.setPayerName(xm.getJsdwmc());
paymentVoucherHis.setZsdw(xm.getKpsjgl().getZsdw());
paymentVoucherHis.setZsdwbm(xm.getKpsjgl().getZsdwbm());
paymentVoucherHis.setQhm(xm.getKpsjgl().getQhm());
paymentVoucherHis.setSkrzh(xm.getKpsjgl().getSkrzh());
paymentVoucherHis.setSkrkhh(xm.getKpsjgl().getSkrkhh());
paymentVoucherHis.setSrxmmc(xm.getKpsjgl().getSrxmmc());
paymentVoucherHis.setArea(xm.getXmxxb().getCsmj());
paymentVoucherHis.setPayType("0");
paymentVoucherHis.setPayMethod("1");
// TODO paymentVoucherHis.setVoucherCode(???);凭证编号???
paymentVoucherHis.setDelFlag(0);
paymentVoucherHis.setDeptId(this.getLoginUserDepartmentId());
paymentVoucherHis.setOperator(this.getLoginUser().getDisplayName());
paymentVoucherHis.setPrintDate(new Date());
paymentVoucherHis.setApplyStatus(Constant.VOUCHER_USE_STATUS_0);
paymentVoucherHis.setMessage("上报:成功");
String pjbz="";
pjbz="关联编号:"+paymentVoucherHis.getVoucherCode()+".";
paymentVoucherHis.setDestroyStatus(Constant.VOUCHER_DESTROY_STATUS_1);//TODO 默认已缴销
PaymentItemHis byXmbId = paymentItemHisService.getByXmbId(xm.getXmxxb().getId());
//四位全局校验码
for(Fstzs f : fstzsList) {
BigDecimal areaBd = new BigDecimal(paymentVoucherHis.getArea());
String area = areaBd.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
BigDecimal amountBd = new BigDecimal(paymentVoucherHis.getAmount());
String amount = amountBd.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
paymentVoucherHis.setAmount(f.getYjje());
//模拟票据领取发放功能
List<Indeticur> list = new ArrayList<Indeticur>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startNo =f.getJkm();
String endNo = f.getJkm();
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
String no = f.getJkm();
Indeticur indeticur = new Indeticur();
indeticur.setDelFlag(0);
indeticur.setIsrece(0);
indeticur.setNo(no);
indeticur.setIsprint("0");
indeticur.setState("1");
indeticur.setSort(0);
indeticur.setRkTime(sdf.format(new Date()));
indeticur.setSequenceID(uuid);
indeticur.setIsrece(1);
indeticur.setPerson(this.getLoginUser().getDisplayName());
indeticur.setState("1");
indeticur.setZsdw("市收费处");
list.add(indeticur);
// 批量插入indeticur然后更新billManager
billManagerService.batchupdate(list);
BillManager billManager = new BillManager();
// billManager.setCount("1");
billManager.setDeptId(this.getLoginUser().getDept().getId());
billManager.setDelFlag(0);
billManager.setEndno(endNo);
billManager.setRktime(sdf.format(new Date()));
billManager.setStartno(startNo);
billManager.setSequentID(uuid);
billManagerService.save(billManager);
Billlq billlq = new Billlq();
billlq.setCount("1");
billlq.setPerson(this.getLoginUser().getDisplayName());
billlq.setDeptId(this.getLoginUser().getDept().getId());
billlq.setZsdw(this.getLoginUser().getDept().getDeptName());
billlq.setDelFlag(0);
billlq.setStartno(startNo);
billlq.setEndno(endNo);
billlq.setLqtime(sdf.format(new Date()));
billlqService.save(billlq);
paymentVoucherHis.setVoucherCode(f.getJkm());
paymentVoucherService.addtb(paymentVoucherHis, "1", "0", byXmbId.getId(),pjbz);
PaymentVoucherHis paymentVoucherHis1 = paymentVoucherHisService.getByVoucherCode(f.getJkm());
//缴销
Pjjx pjjx = new Pjjx();
pjjx.setDeptId(this.getLoginUserDepartmentId());
pjjx.setDelFlag(0);
pjjx.setPjbm(paymentVoucherHis1.getVoucherCode());
pjjx.setJbr(paymentVoucherHis1.getOperator());
pjjx.setJkrqc(paymentVoucherHis1.getPayerName());
pjjx.setSalary(paymentVoucherHis1.getAmount());
pjjx.setState(paymentVoucherHis1.getApplyStatus());
pjjx.setRkdate(new SimpleDateFormat("yyyy-MM").format(new Date()));
pjjx.setSlbh(paymentVoucherHis1.getOrderId());
pjjx.setDwdm(paymentVoucherHis1.getDwdm());
pjjx.setPayITEMid(paymentVoucherHis1.getRelateId());
pjjx.setZsdw(paymentVoucherHis1.getZsdw());
pjjx.setZsfw(xm.getXmxxb().getZsfw());
Calendar cal=Calendar.getInstance();
cal.setTime(new Date());
int month = cal.get(Calendar.MONTH)+1;
if(month == 1 || month ==2 || month ==3){
pjjx.setSeason(pjjx.getRkdate().substring(0, 4)+ "年01季度");
}
else if(month == 4 || month ==5 || month ==6){
pjjx.setSeason(pjjx.getRkdate().substring(0, 4)+ "年02季度");
}
else if(month == 7 || month ==8 || month ==9){
pjjx.setSeason(pjjx.getRkdate().substring(0, 4)+ "年03季度");
}
else if(month == 10 || month ==11 || month ==12){
pjjx.setSeason(pjjx.getRkdate().substring(0, 4)+ "年04季度");
}
pjjxService.save(pjjx);
Jtqd tfqd=new Jtqd();
tfqd.setDelFlag(0);
tfqd.setSlbh(pjjx.getSlbh());
tfqd.setSequenceId(com.fr.stable.core.UUID.randomUUID().toString().replaceAll("-", ""));
//.setIszd();
tfqd.setPzlx("0");
tfqd.setSalary(pjjx.getSalary());
tfqd.setXmmc(xm.getXmxxb().getXmmc());
tfqd.setZsdw(xm.getXmxxb().getZsdw());
tfqd.setZsdm(xm.getXmxxb().getDwdm());
tfqd.setRkdate(pjjx.getRkdate());
jtqdService.save(tfqd);
}
}
public Pagination getPagination() {
......@@ -596,7 +837,6 @@ public class FstzsAction extends BaseAction {
public void setFstzsXm(FstzsXm fstzsXm) {
this.fstzsXm = fstzsXm;
}
public Integer getStatus() {
return status;
}
......
......@@ -254,7 +254,7 @@ public class PaymentItemPendingServiceImpl extends BaseServiceImpl implements Pa
this.save(dj);
//保存项目到非税通知书表
FstzsXm xm = new FstzsXm();
xm.setPaymentItemPending(dj);
xm.setXmxxb(xmb);
//获取收款人信息保存到项目中
HashMap<String, Object> param = new HashMap<>();
param.put("gllb","001");
......
......@@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletResponse;
import com.jshx.fstzs.entity.FstzsXm;
import com.jshx.fstzs.service.FstzsXmService;
import com.jshx.xmxxb.service.XmxxbService;
import org.apache.struts2.ServletActionContext;
import org.hibernate.LobHelper;
import org.hibernate.SessionFactory;
......@@ -54,6 +55,9 @@ public class PaymentItemPendingAction extends BaseAction
*/
private PaymentItemPending paymentItemPending = new PaymentItemPending();
@Autowired
private XmxxbService xmxxbService;
/**
* 业务类
*/
......@@ -190,7 +194,7 @@ public class PaymentItemPendingAction extends BaseAction
* 入paymentItemPending表同时,入FstzsXm表
*/
FstzsXm xm = new FstzsXm();
xm.setPaymentItemPending(paymentItemPending);
xm.setXmxxb(xmxxbService.getById(paymentItemPending.getXmbzj()));
xm.setDelFlag(0);
xm.setStatus(0);
......@@ -208,7 +212,7 @@ public class PaymentItemPendingAction extends BaseAction
FstzsXm xm = fstzsXmService.getBySlbh(paymentItemPending.getSlbh());
if(xm == null) {
xm = new FstzsXm();
xm.setPaymentItemPending(paymentItemPending);
xm.setXmxxb(xmxxbService.getById(paymentItemPending.getXmbzj()));
xm.setDelFlag(0);
xm.setStatus(0);
xm.setJsdwmc(paymentItemPending.getDwmc());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment