update
This commit is contained in:
+3
-2
@@ -2,6 +2,7 @@ package com.cwhelp.admin.business.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cwhelp.admin.business.validator.BssVatInvoiceCheckValid;
|
||||
import com.cwhelp.admin.business.validator.BssVatInvoiceValid;
|
||||
import com.cwhelp.common.api.baidu.BaiduAipOCR;
|
||||
import com.cwhelp.common.api.baidu.entity.vatinvoice.*;
|
||||
import com.cwhelp.common.api.baidu.entity.vatinvoice.enums.VatInvoiceTypeEnum;
|
||||
@@ -118,8 +119,8 @@ public class BssVatInvoiceController {
|
||||
@PostMapping({"/add","/edit"})
|
||||
@RequiresPermissions({"bss:vatInvoice:add","bss:vatInvoice:edit"})
|
||||
@ResponseBody
|
||||
// public ResultVo save(@Validated @RequestBody BssVatInvoiceValid valid, @RequestBody BssVatInvoice bssVatInvoice) {
|
||||
public ResultVo save(@Validated @RequestBody BssVatInvoice bssVatInvoice) {
|
||||
public ResultVo save(@Validated @RequestBody BssVatInvoiceValid valid, @RequestBody BssVatInvoice bssVatInvoice) {
|
||||
// public ResultVo save(@Validated @RequestBody BssVatInvoice bssVatInvoice) {
|
||||
// 复制保留无需修改的数据
|
||||
if (bssVatInvoice.getId() != null) {
|
||||
BssVatInvoice beBssVatInvoice = bssVatInvoiceService.getById(bssVatInvoice.getId());
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.cwhelp.admin.business.validator;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
@@ -14,8 +16,8 @@ import java.io.Serializable;
|
||||
public class BssVatInvoiceValid implements Serializable {
|
||||
@NotEmpty(message = "发票代码不能为空")
|
||||
private String invoiceCode;
|
||||
@NotEmpty(message = "发票类型不能为空")
|
||||
private String invoiceType;
|
||||
@NotNull(message = "发票类型不能为空")
|
||||
private Integer invoiceType;
|
||||
@NotEmpty(message = "发票号码不能为空")
|
||||
private String invoiceNo;
|
||||
@NotEmpty(message = "发票日期不能为空")
|
||||
@@ -23,12 +25,13 @@ public class BssVatInvoiceValid implements Serializable {
|
||||
private String invoiceDate;
|
||||
@NotEmpty(message = "校验码不能为空")
|
||||
private String checkCode;
|
||||
@NotEmpty(message = "发票金额不能为空")
|
||||
private String invoiceMoney;
|
||||
@NotEmpty(message = "税额不能为空")
|
||||
private String taxAmount;
|
||||
@NotEmpty(message = "总金额不能为空")
|
||||
private String totalAmount;
|
||||
@NotNull(message = "发票金额不能为空")
|
||||
private BigDecimal invoiceMoney;
|
||||
@NotNull(message = "税额不能为空")
|
||||
private BigDecimal taxAmount;
|
||||
@NotNull(message = "总金额不能为空")
|
||||
private BigDecimal totalAmount;
|
||||
@NotEmpty(message = "总金额(大写)不能为空")
|
||||
private String totalAmountCn;
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.cwhelp.common.vo.ResultVo;
|
||||
import com.cwhelp.component.actionLog.action.UserAction;
|
||||
import com.cwhelp.component.actionLog.annotation.ActionLog;
|
||||
import com.cwhelp.devtools.generate.utils.jAngel.utils.StringUtil;
|
||||
import com.cwhelp.modules.business.domain.BssEmployee;
|
||||
import com.cwhelp.modules.system.domain.Role;
|
||||
import com.cwhelp.modules.system.domain.User;
|
||||
import com.cwhelp.modules.system.service.ApiUserService;
|
||||
@@ -64,6 +65,27 @@ public class ApiLoginController {
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/biz/modifyPwd")
|
||||
@ResponseBody
|
||||
// @ActionLog(key = UserAction.API_USER_LOGIN, action = UserAction.class)
|
||||
public ResultVo modifyPwd(@RequestParam("telephone") String telephone,
|
||||
@RequestParam("oldPassword") String oldPassword,
|
||||
@RequestParam("newPassword") String newPassword){
|
||||
|
||||
if(StringUtil.isBlank(telephone) || StringUtil.isBlank(oldPassword) || StringUtil.isBlank(newPassword)){
|
||||
return new ResultVo(ApiConst.API_PARAM_BLANK_CODE, ApiConst.API_PARAM_BLANK_MSG);
|
||||
}
|
||||
|
||||
BssEmployee user = apiUserService.getUserByPhoneNum(telephone);
|
||||
if(user == null){
|
||||
return new ResultVo(ApiConst.API_SYS_ERR_CODE, ApiConst.API_SYS_ERR_MSG);
|
||||
}else {
|
||||
// user.setPassword(newPassword);
|
||||
apiUserService.save(user);
|
||||
return new ResultVo(ApiConst.API_OPT_SUCCESS_CODE, ApiConst.API_OPT_SUCCESS_MSG);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String tel = "16621001775";
|
||||
|
||||
|
||||
@@ -134,27 +134,25 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
|
||||
var url = form.attr("action");
|
||||
var serializeArray = form.serializeArray();
|
||||
var _newData = null;
|
||||
var from = false; // from = true 代表增值税页面请求,用设置content-type的请求
|
||||
console.info("本次请求的url是---", url);
|
||||
if(url == '/bss/vatInvoice/add'){//增值税add页面请求
|
||||
from = true;
|
||||
_newData = trans.serialize( serializeArray );
|
||||
var goods = createGoodsParams();
|
||||
_newData.bssGoods = goods;
|
||||
delete _newData.name;
|
||||
delete _newData.specification;
|
||||
delete _newData.unit;
|
||||
delete _newData.num;
|
||||
delete _newData.unitPrice;
|
||||
delete _newData.detailAmount;
|
||||
delete _newData.taxRate;
|
||||
delete _newData.goodTaxAmount;
|
||||
}else if(url == '/bss/vatInvoice/edit'){//增值税edit页面请求
|
||||
from = true;
|
||||
var fromFlag = false; // from = true 代表增值税页面请求,用设置content-type的请求
|
||||
if(url == '/bss/vatInvoice/add' || url == '/bss/vatInvoice/edit'){//增值税add/edit页面请求
|
||||
fromFlag = true;
|
||||
_newData = trans.serialize( serializeArray );
|
||||
if(url == '/bss/vatInvoice/add'){
|
||||
var goods = createGoodsParams();
|
||||
_newData.bssGoods = goods;
|
||||
delete _newData.name;
|
||||
delete _newData.specification;
|
||||
delete _newData.unit;
|
||||
delete _newData.num;
|
||||
delete _newData.unitPrice;
|
||||
delete _newData.detailAmount;
|
||||
delete _newData.taxRate;
|
||||
delete _newData.goodTaxAmount;
|
||||
}
|
||||
}
|
||||
|
||||
if(from){
|
||||
if(fromFlag){
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user