准备发票管理
parent
6633375cee
commit
100f1c13f0
|
|
@ -31,7 +31,9 @@ public enum RoleEnum {
|
|||
|
||||
PRESIDENT(500),
|
||||
TREASURER(501),
|
||||
PRESIDENTVIEW(502)
|
||||
PRESIDENTVIEW(502),
|
||||
|
||||
CHAISHA(600)
|
||||
;
|
||||
|
||||
private Integer roleid;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ public enum UserTypeEnum {
|
|||
TRANSCO(2),
|
||||
CUSTOMER(3),
|
||||
DRIVER(4),
|
||||
LEAD(5); // 砂石公司领导
|
||||
LEAD(5), // 砂石公司领导
|
||||
CHAISHA(6) // 采砂局
|
||||
;
|
||||
|
||||
private Integer typeid;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseBocomm;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri May 29 10:27:06 CST 2020
|
||||
* TableName: bocomm
|
||||
* Remarks: 支付相关 - 交行支付记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Bocomm extends BaseBocomm<Bocomm> {
|
||||
public static final Bocomm dao = new Bocomm().dao();
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseBocommRequest;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri May 29 11:23:08 CST 2020
|
||||
* TableName: bocomm_request
|
||||
* Remarks: 支付相关 - 交行请求(提交到交行的)报文
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BocommRequest extends BaseBocommRequest<BocommRequest> {
|
||||
public static final BocommRequest dao = new BocommRequest().dao();
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseBocommResponse;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri May 29 11:23:08 CST 2020
|
||||
* TableName: bocomm_response
|
||||
* Remarks: 支付相关 - 交行响应(推送过来的)报文
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BocommResponse extends BaseBocommResponse<BocommResponse> {
|
||||
public static final BocommResponse dao = new BocommResponse().dao();
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseCustomerRegister;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 11:37:53 CST 2020
|
||||
* TableName: customer_register
|
||||
* Remarks: 客户相关 - 客户注册
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CustomerRegister extends BaseCustomerRegister<CustomerRegister> {
|
||||
public static final CustomerRegister dao = new CustomerRegister().dao();
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseInvoiceLog;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 22:45:03 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvoiceLog extends BaseInvoiceLog<InvoiceLog> {
|
||||
public static final InvoiceLog dao = new InvoiceLog().dao();
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseInvoiceReceive;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 22:45:03 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvoiceReceive extends BaseInvoiceReceive<InvoiceReceive> {
|
||||
public static final InvoiceReceive dao = new InvoiceReceive().dao();
|
||||
}
|
||||
|
|
@ -17,11 +17,10 @@ public class _MappingKit {
|
|||
|
||||
public static void mapping(ActiveRecordPlugin arp) {
|
||||
arp.addMapping("auth_license", "truck_license", AuthLicense.class);
|
||||
// arp.addMapping("bocomm", "id", Bocomm.class);
|
||||
// arp.addMapping("bocomm_request", "id", BocommRequest.class);
|
||||
// arp.addMapping("bocomm_response", "id", BocommResponse.class);
|
||||
arp.addMapping("transport", "id", Transport.class);
|
||||
arp.addMapping("device_config", "supermarket_id", DeviceConfig.class);
|
||||
arp.addMapping("invoice_log", "id", InvoiceLog.class);
|
||||
arp.addMapping("invoice_receive", "id", InvoiceReceive.class);
|
||||
arp.addMapping("driver", "id", Driver.class);
|
||||
arp.addMapping("product", "id", Product.class);
|
||||
// Composite Primary Key order: supermarket_id,customer_receiver_id
|
||||
|
|
@ -38,6 +37,7 @@ public class _MappingKit {
|
|||
arp.addMapping("supermarket", "id", Supermarket.class);
|
||||
arp.addMapping("customer", "id", Customer.class);
|
||||
arp.addMapping("customer_receiver", "id", CustomerReceiver.class);
|
||||
arp.addMapping("customer_register", "id", CustomerRegister.class);
|
||||
arp.addMapping("customer_contact", "id", CustomerContact.class);
|
||||
arp.addMapping("prepay_detail", "id", PrepayDetail.class);
|
||||
arp.addMapping("prepay_detail_state_history", "id", PrepayDetailStateHistory.class);
|
||||
|
|
|
|||
|
|
@ -1,592 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Jun 24 01:50:19 CST 2020
|
||||
* TableName: bocomm
|
||||
* Remarks: 支付相关 - 交行支付记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseBocomm<M extends BaseBocomm<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "bocomm";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: CHAR(32)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id uuid
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(String id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id uuid
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public String getId() {
|
||||
return getStr("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: uuid
|
||||
* type: CHAR(32)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param uuid 前端提供uuid,避免重复提交
|
||||
*/
|
||||
@JSONField(name="uuid")
|
||||
public void setUuid(String uuid) {
|
||||
set("uuid", uuid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return uuid 前端提供uuid,避免重复提交
|
||||
*/
|
||||
@JSONField(name="uuid")
|
||||
public String getUuid() {
|
||||
return getStr("uuid");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: order_sn
|
||||
* type: CHAR(16)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param orderSn 系统订单号, xml 中用 PayMerTranNo
|
||||
*/
|
||||
@JSONField(name="order_sn")
|
||||
public void setOrderSn(String orderSn) {
|
||||
set("order_sn", orderSn);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return order_sn 系统订单号, xml 中用 PayMerTranNo
|
||||
*/
|
||||
@JSONField(name="order_sn")
|
||||
public String getOrderSn() {
|
||||
return getStr("order_sn");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: type
|
||||
* type: SMALLINT(5)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param type 订单类型 1销售订单,3临时订单
|
||||
*/
|
||||
@JSONField(name="type")
|
||||
public void setType(Integer type) {
|
||||
set("type", type);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return type 订单类型 1销售订单,3临时订单
|
||||
*/
|
||||
@JSONField(name="type")
|
||||
public Integer getType() {
|
||||
return getInt("type");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: paymertranno
|
||||
* type: VARCHAR(32)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param paymertranno 给银行的订单号, order_sn + HHmmssSSS
|
||||
*/
|
||||
@JSONField(name="paymertranno")
|
||||
public void setPaymertranno(String paymertranno) {
|
||||
set("paymertranno", paymertranno);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return paymertranno 给银行的订单号, order_sn + HHmmssSSS
|
||||
*/
|
||||
@JSONField(name="paymertranno")
|
||||
public String getPaymertranno() {
|
||||
return getStr("paymertranno");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: amount
|
||||
* type: DECIMAL(12,2)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param amount 支付金额
|
||||
*/
|
||||
@JSONField(name="amount")
|
||||
public void setAmount(java.math.BigDecimal amount) {
|
||||
set("amount", amount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return amount 支付金额
|
||||
*/
|
||||
@JSONField(name="amount")
|
||||
public java.math.BigDecimal getAmount() {
|
||||
return get("amount");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: transcene
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param transcene 支付场景
|
||||
B2C-JSAPI-ALIPAY 支付宝内置浏览器
|
||||
B2C-JSAPI-WECHAT 微信内置浏览器
|
||||
*/
|
||||
@JSONField(name="transcene")
|
||||
public void setTranscene(String transcene) {
|
||||
set("transcene", transcene);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return transcene 支付场景
|
||||
B2C-JSAPI-ALIPAY 支付宝内置浏览器
|
||||
B2C-JSAPI-WECHAT 微信内置浏览器
|
||||
*/
|
||||
@JSONField(name="transcene")
|
||||
public String getTranscene() {
|
||||
return getStr("transcene");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: validperiod
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param validperiod 非空,日期时间14位
|
||||
*/
|
||||
@JSONField(name="validperiod")
|
||||
public void setValidperiod(java.util.Date validperiod) {
|
||||
set("validperiod", validperiod);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return validperiod 非空,日期时间14位
|
||||
*/
|
||||
@JSONField(name="validperiod")
|
||||
public java.util.Date getValidperiod() {
|
||||
return get("validperiod");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: state
|
||||
* type: SMALLINT(5)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 1
|
||||
* @param state 1.创建记录,返回关联的加签信息给前台,最后不一定使用
|
||||
2.提交跳转,前端提交跳转操作,同时跳转到交行支付连接
|
||||
3.收到通知,不是成功的通知
|
||||
5.收到支付成功的通知
|
||||
9.作废,超时或者其他情况作废
|
||||
*/
|
||||
@JSONField(name="state")
|
||||
public void setState(Integer state) {
|
||||
set("state", state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return state 1.创建记录,返回关联的加签信息给前台,最后不一定使用
|
||||
2.提交跳转,前端提交跳转操作,同时跳转到交行支付连接
|
||||
3.收到通知,不是成功的通知
|
||||
5.收到支付成功的通知
|
||||
9.作废,超时或者其他情况作废
|
||||
*/
|
||||
@JSONField(name="state")
|
||||
public Integer getState() {
|
||||
return getInt("state");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: transtate
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param transtate INITIAL:订单创建
|
||||
PROCESS:处理中
|
||||
SUCCESS:交易成功
|
||||
FAILURE 交易失败
|
||||
*/
|
||||
@JSONField(name="transtate")
|
||||
public void setTranstate(String transtate) {
|
||||
set("transtate", transtate);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return transtate INITIAL:订单创建
|
||||
PROCESS:处理中
|
||||
SUCCESS:交易成功
|
||||
FAILURE 交易失败
|
||||
*/
|
||||
@JSONField(name="transtate")
|
||||
public String getTranstate() {
|
||||
return getStr("transtate");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: transtatecode
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param transtatecode 交易失败原因错误码
|
||||
*/
|
||||
@JSONField(name="transtatecode")
|
||||
public void setTranstatecode(String transtatecode) {
|
||||
set("transtatecode", transtatecode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return transtatecode 交易失败原因错误码
|
||||
*/
|
||||
@JSONField(name="transtatecode")
|
||||
public String getTranstatecode() {
|
||||
return getStr("transtatecode");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: transtatemsg
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param transtatemsg 交易失败原因说明
|
||||
*/
|
||||
@JSONField(name="transtatemsg")
|
||||
public void setTranstatemsg(String transtatemsg) {
|
||||
set("transtatemsg", transtatemsg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return transtatemsg 交易失败原因说明
|
||||
*/
|
||||
@JSONField(name="transtatemsg")
|
||||
public String getTranstatemsg() {
|
||||
return getStr("transtatemsg");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: batchno
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param batchno 交行批次号,交易所属交行批次,交易成功的交易才有该字段。
|
||||
*/
|
||||
@JSONField(name="batchno")
|
||||
public void setBatchno(String batchno) {
|
||||
set("batchno", batchno);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return batchno 交行批次号,交易所属交行批次,交易成功的交易才有该字段。
|
||||
*/
|
||||
@JSONField(name="batchno")
|
||||
public String getBatchno() {
|
||||
return getStr("batchno");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: finaltime
|
||||
* type: DATETIME(19)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param finaltime 最终变成成功或失败的时间
|
||||
*/
|
||||
@JSONField(name="finaltime")
|
||||
public void setFinaltime(java.util.Date finaltime) {
|
||||
set("finaltime", finaltime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return finaltime 最终变成成功或失败的时间
|
||||
*/
|
||||
@JSONField(name="finaltime")
|
||||
public java.util.Date getFinaltime() {
|
||||
return get("finaltime");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: trancontent
|
||||
* type: VARCHAR(500)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param trancontent 交易内容,展示给客户,可查询
|
||||
*/
|
||||
@JSONField(name="trancontent")
|
||||
public void setTrancontent(String trancontent) {
|
||||
set("trancontent", trancontent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trancontent 交易内容,展示给客户,可查询
|
||||
*/
|
||||
@JSONField(name="trancontent")
|
||||
public String getTrancontent() {
|
||||
return getStr("trancontent");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: mermemo
|
||||
* type: VARCHAR(200)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param mermemo 商户内部备注,不展示给客户,可查询
|
||||
*/
|
||||
@JSONField(name="mermemo")
|
||||
public void setMermemo(String mermemo) {
|
||||
set("mermemo", mermemo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mermemo 商户内部备注,不展示给客户,可查询
|
||||
*/
|
||||
@JSONField(name="mermemo")
|
||||
public String getMermemo() {
|
||||
return getStr("mermemo");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: subopenid
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param subopenid
|
||||
*/
|
||||
@JSONField(name="subopenid")
|
||||
public void setSubopenid(String subopenid) {
|
||||
set("subopenid", subopenid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return subopenid
|
||||
*/
|
||||
@JSONField(name="subopenid")
|
||||
public String getSubopenid() {
|
||||
return getStr("subopenid");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: banktranno
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param banktranno
|
||||
*/
|
||||
@JSONField(name="banktranno")
|
||||
public void setBanktranno(String banktranno) {
|
||||
set("banktranno", banktranno);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return banktranno
|
||||
*/
|
||||
@JSONField(name="banktranno")
|
||||
public String getBanktranno() {
|
||||
return getStr("banktranno");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: thirdparty
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param thirdparty
|
||||
*/
|
||||
@JSONField(name="thirdparty")
|
||||
public void setThirdparty(String thirdparty) {
|
||||
set("thirdparty", thirdparty);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return thirdparty
|
||||
*/
|
||||
@JSONField(name="thirdparty")
|
||||
public String getThirdparty() {
|
||||
return getStr("thirdparty");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: thirdpartytranno
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param thirdpartytranno
|
||||
*/
|
||||
@JSONField(name="thirdpartytranno")
|
||||
public void setThirdpartytranno(String thirdpartytranno) {
|
||||
set("thirdpartytranno", thirdpartytranno);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return thirdpartytranno
|
||||
*/
|
||||
@JSONField(name="thirdpartytranno")
|
||||
public String getThirdpartytranno() {
|
||||
return getStr("thirdpartytranno");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: create_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param createTime
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
set("create_time", createTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_time
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public java.util.Date getCreateTime() {
|
||||
return get("create_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: change_time
|
||||
* type: TIMESTAMP(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param changeTime 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public void setChangeTime(java.util.Date changeTime) {
|
||||
set("change_time", changeTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return change_time 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public java.util.Date getChangeTime() {
|
||||
return get("change_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: payacctno
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param payacctno 付款人账号
|
||||
*/
|
||||
@JSONField(name="payacctno")
|
||||
public void setPayacctno(String payacctno) {
|
||||
set("payacctno", payacctno);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return payacctno 付款人账号
|
||||
*/
|
||||
@JSONField(name="payacctno")
|
||||
public String getPayacctno() {
|
||||
return getStr("payacctno");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: payacctname
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param payacctname 付款人姓名
|
||||
*/
|
||||
@JSONField(name="payacctname")
|
||||
public void setPayacctname(String payacctname) {
|
||||
set("payacctname", payacctname);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return payacctname 付款人姓名
|
||||
*/
|
||||
@JSONField(name="payacctname")
|
||||
public String getPayacctname() {
|
||||
return getStr("payacctname");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: submerptcid
|
||||
* type: VARCHAR(100)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param submerptcid SubMerPtcId
|
||||
*/
|
||||
@JSONField(name="submerptcid")
|
||||
public void setSubmerptcid(String submerptcid) {
|
||||
set("submerptcid", submerptcid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return submerptcid SubMerPtcId
|
||||
*/
|
||||
@JSONField(name="submerptcid")
|
||||
public String getSubmerptcid() {
|
||||
return getStr("submerptcid");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri May 29 11:23:08 CST 2020
|
||||
* TableName: bocomm_request
|
||||
* Remarks: 支付相关 - 交行请求(提交到交行的)报文
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseBocommRequest<M extends BaseBocommRequest<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "bocomm_request";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: CHAR(32)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id uuid
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(String id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id uuid
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public String getId() {
|
||||
return getStr("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: bocomm_id
|
||||
* type: CHAR(32)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param bocommId bocomm 表id
|
||||
*/
|
||||
@JSONField(name="bocomm_id")
|
||||
public void setBocommId(String bocommId) {
|
||||
set("bocomm_id", bocommId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bocomm_id bocomm 表id
|
||||
*/
|
||||
@JSONField(name="bocomm_id")
|
||||
public String getBocommId() {
|
||||
return getStr("bocomm_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: trancode
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param trancode 交易码
|
||||
*/
|
||||
@JSONField(name="trancode")
|
||||
public void setTrancode(String trancode) {
|
||||
set("trancode", trancode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trancode 交易码
|
||||
*/
|
||||
@JSONField(name="trancode")
|
||||
public String getTrancode() {
|
||||
return getStr("trancode");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: xml
|
||||
* type: VARCHAR(1000)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param xml 请求xml
|
||||
*/
|
||||
@JSONField(name="xml")
|
||||
public void setXml(String xml) {
|
||||
set("xml", xml);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return xml 请求xml
|
||||
*/
|
||||
@JSONField(name="xml")
|
||||
public String getXml() {
|
||||
return getStr("xml");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri May 29 11:23:08 CST 2020
|
||||
* TableName: bocomm_response
|
||||
* Remarks: 支付相关 - 交行响应(推送过来的)报文
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseBocommResponse<M extends BaseBocommResponse<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "bocomm_response";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: CHAR(32)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id uuid
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(String id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id uuid
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public String getId() {
|
||||
return getStr("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: bocomm_id
|
||||
* type: CHAR(32)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param bocommId bocomm 表id
|
||||
*/
|
||||
@JSONField(name="bocomm_id")
|
||||
public void setBocommId(String bocommId) {
|
||||
set("bocomm_id", bocommId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bocomm_id bocomm 表id
|
||||
*/
|
||||
@JSONField(name="bocomm_id")
|
||||
public String getBocommId() {
|
||||
return getStr("bocomm_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: trancode
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param trancode 交易码
|
||||
*/
|
||||
@JSONField(name="trancode")
|
||||
public void setTrancode(String trancode) {
|
||||
set("trancode", trancode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trancode 交易码
|
||||
*/
|
||||
@JSONField(name="trancode")
|
||||
public String getTrancode() {
|
||||
return getStr("trancode");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: xml
|
||||
* type: VARCHAR(1000)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param xml 响应xml
|
||||
*/
|
||||
@JSONField(name="xml")
|
||||
public void setXml(String xml) {
|
||||
set("xml", xml);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return xml 响应xml
|
||||
*/
|
||||
@JSONField(name="xml")
|
||||
public String getXml() {
|
||||
return getStr("xml");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,464 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 14:01:10 CST 2020
|
||||
* TableName: customer_register
|
||||
* Remarks: 客户相关 - 客户注册
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseCustomerRegister<M extends BaseCustomerRegister<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "customer_register";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: BIGINT(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(Long id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public Long getId() {
|
||||
return getLong("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: sysuser_phone
|
||||
* type: CHAR(11)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param sysuserPhone 电话
|
||||
*/
|
||||
@JSONField(name="sysuser_phone")
|
||||
public void setSysuserPhone(String sysuserPhone) {
|
||||
set("sysuser_phone", sysuserPhone);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return sysuser_phone 电话
|
||||
*/
|
||||
@JSONField(name="sysuser_phone")
|
||||
public String getSysuserPhone() {
|
||||
return getStr("sysuser_phone");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: sysuser_password
|
||||
* type: VARCHAR(64)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param sysuserPassword 密码
|
||||
*/
|
||||
@JSONField(name="sysuser_password")
|
||||
public void setSysuserPassword(String sysuserPassword) {
|
||||
set("sysuser_password", sysuserPassword);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return sysuser_password 密码
|
||||
*/
|
||||
@JSONField(name="sysuser_password")
|
||||
public String getSysuserPassword() {
|
||||
return getStr("sysuser_password");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: sysuser_name
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param sysuserName 姓名
|
||||
*/
|
||||
@JSONField(name="sysuser_name")
|
||||
public void setSysuserName(String sysuserName) {
|
||||
set("sysuser_name", sysuserName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return sysuser_name 姓名
|
||||
*/
|
||||
@JSONField(name="sysuser_name")
|
||||
public String getSysuserName() {
|
||||
return getStr("sysuser_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: customer_address
|
||||
* type: VARCHAR(256)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param customerAddress 开票地址
|
||||
*/
|
||||
@JSONField(name="customer_address")
|
||||
public void setCustomerAddress(String customerAddress) {
|
||||
set("customer_address", customerAddress);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_address 开票地址
|
||||
*/
|
||||
@JSONField(name="customer_address")
|
||||
public String getCustomerAddress() {
|
||||
return getStr("customer_address");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: customer_phone
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param customerPhone 开票电话(可以是座机)
|
||||
*/
|
||||
@JSONField(name="customer_phone")
|
||||
public void setCustomerPhone(String customerPhone) {
|
||||
set("customer_phone", customerPhone);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_phone 开票电话(可以是座机)
|
||||
*/
|
||||
@JSONField(name="customer_phone")
|
||||
public String getCustomerPhone() {
|
||||
return getStr("customer_phone");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: customer_texpayer_name
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param customerTexpayerName 开票公司名称
|
||||
*/
|
||||
@JSONField(name="customer_texpayer_name")
|
||||
public void setCustomerTexpayerName(String customerTexpayerName) {
|
||||
set("customer_texpayer_name", customerTexpayerName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_texpayer_name 开票公司名称
|
||||
*/
|
||||
@JSONField(name="customer_texpayer_name")
|
||||
public String getCustomerTexpayerName() {
|
||||
return getStr("customer_texpayer_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: customer_texpayer_num
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param customerTexpayerNum 税号
|
||||
*/
|
||||
@JSONField(name="customer_texpayer_num")
|
||||
public void setCustomerTexpayerNum(String customerTexpayerNum) {
|
||||
set("customer_texpayer_num", customerTexpayerNum);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_texpayer_num 税号
|
||||
*/
|
||||
@JSONField(name="customer_texpayer_num")
|
||||
public String getCustomerTexpayerNum() {
|
||||
return getStr("customer_texpayer_num");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: customer_bank_name
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param customerBankName 开户行名称
|
||||
*/
|
||||
@JSONField(name="customer_bank_name")
|
||||
public void setCustomerBankName(String customerBankName) {
|
||||
set("customer_bank_name", customerBankName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_bank_name 开户行名称
|
||||
*/
|
||||
@JSONField(name="customer_bank_name")
|
||||
public String getCustomerBankName() {
|
||||
return getStr("customer_bank_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: customer_bank_account
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param customerBankAccount 开户行账号
|
||||
*/
|
||||
@JSONField(name="customer_bank_account")
|
||||
public void setCustomerBankAccount(String customerBankAccount) {
|
||||
set("customer_bank_account", customerBankAccount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_bank_account 开户行账号
|
||||
*/
|
||||
@JSONField(name="customer_bank_account")
|
||||
public String getCustomerBankAccount() {
|
||||
return getStr("customer_bank_account");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: receiver_name
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param receiverName 收货人姓名
|
||||
*/
|
||||
@JSONField(name="receiver_name")
|
||||
public void setReceiverName(String receiverName) {
|
||||
set("receiver_name", receiverName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return receiver_name 收货人姓名
|
||||
*/
|
||||
@JSONField(name="receiver_name")
|
||||
public String getReceiverName() {
|
||||
return getStr("receiver_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: receiver_phone
|
||||
* type: CHAR(11)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param receiverPhone 收货人电话
|
||||
*/
|
||||
@JSONField(name="receiver_phone")
|
||||
public void setReceiverPhone(String receiverPhone) {
|
||||
set("receiver_phone", receiverPhone);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return receiver_phone 收货人电话
|
||||
*/
|
||||
@JSONField(name="receiver_phone")
|
||||
public String getReceiverPhone() {
|
||||
return getStr("receiver_phone");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: receiver_address
|
||||
* type: VARCHAR(256)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param receiverAddress 收货地址
|
||||
*/
|
||||
@JSONField(name="receiver_address")
|
||||
public void setReceiverAddress(String receiverAddress) {
|
||||
set("receiver_address", receiverAddress);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return receiver_address 收货地址
|
||||
*/
|
||||
@JSONField(name="receiver_address")
|
||||
public String getReceiverAddress() {
|
||||
return getStr("receiver_address");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: state
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param state 1 新申请,5 审核通过,9 审核未通过或过期
|
||||
*/
|
||||
@JSONField(name="state")
|
||||
public void setState(Integer state) {
|
||||
set("state", state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return state 1 新申请,5 审核通过,9 审核未通过或过期
|
||||
*/
|
||||
@JSONField(name="state")
|
||||
public Integer getState() {
|
||||
return getInt("state");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: create_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param createTime 创建时间
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
set("create_time", createTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_time 创建时间
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public java.util.Date getCreateTime() {
|
||||
return get("create_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: change_time
|
||||
* type: TIMESTAMP(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param changeTime 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public void setChangeTime(java.util.Date changeTime) {
|
||||
set("change_time", changeTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return change_time 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public java.util.Date getChangeTime() {
|
||||
return get("change_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: verify_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param verifyTime 审核时间,不论审核是否通过都更新
|
||||
*/
|
||||
@JSONField(name="verify_time")
|
||||
public void setVerifyTime(java.util.Date verifyTime) {
|
||||
set("verify_time", verifyTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return verify_time 审核时间,不论审核是否通过都更新
|
||||
*/
|
||||
@JSONField(name="verify_time")
|
||||
public java.util.Date getVerifyTime() {
|
||||
return get("verify_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: verify_user_id
|
||||
* type: INT(10)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param verifyUserId 审核用户id
|
||||
*/
|
||||
@JSONField(name="verify_user_id")
|
||||
public void setVerifyUserId(Integer verifyUserId) {
|
||||
set("verify_user_id", verifyUserId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return verify_user_id 审核用户id
|
||||
*/
|
||||
@JSONField(name="verify_user_id")
|
||||
public Integer getVerifyUserId() {
|
||||
return getInt("verify_user_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: verify_user_name
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param verifyUserName 审核用户姓名
|
||||
*/
|
||||
@JSONField(name="verify_user_name")
|
||||
public void setVerifyUserName(String verifyUserName) {
|
||||
set("verify_user_name", verifyUserName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return verify_user_name 审核用户姓名
|
||||
*/
|
||||
@JSONField(name="verify_user_name")
|
||||
public String getVerifyUserName() {
|
||||
return getStr("verify_user_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: verify_memo
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param verifyMemo 审核说明
|
||||
*/
|
||||
@JSONField(name="verify_memo")
|
||||
public void setVerifyMemo(String verifyMemo) {
|
||||
set("verify_memo", verifyMemo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return verify_memo 审核说明
|
||||
*/
|
||||
@JSONField(name="verify_memo")
|
||||
public String getVerifyMemo() {
|
||||
return getStr("verify_memo");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 23:05:38 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseInvoiceLog<M extends BaseInvoiceLog<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "invoice_log";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(Integer id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public Integer getId() {
|
||||
return getInt("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: invoice_receive_id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param invoiceReceiveId 领用记录id
|
||||
*/
|
||||
@JSONField(name="invoice_receive_id")
|
||||
public void setInvoiceReceiveId(Integer invoiceReceiveId) {
|
||||
set("invoice_receive_id", invoiceReceiveId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return invoice_receive_id 领用记录id
|
||||
*/
|
||||
@JSONField(name="invoice_receive_id")
|
||||
public Integer getInvoiceReceiveId() {
|
||||
return getInt("invoice_receive_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: code
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param code 发票代码
|
||||
*/
|
||||
@JSONField(name="code")
|
||||
public void setCode(String code) {
|
||||
set("code", code);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return code 发票代码
|
||||
*/
|
||||
@JSONField(name="code")
|
||||
public String getCode() {
|
||||
return getStr("code");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: create_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param createTime 创建时间
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
set("create_time", createTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_time 创建时间
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public java.util.Date getCreateTime() {
|
||||
return get("create_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: change_time
|
||||
* type: TIMESTAMP(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param changeTime 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public void setChangeTime(java.util.Date changeTime) {
|
||||
set("change_time", changeTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return change_time 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public java.util.Date getChangeTime() {
|
||||
return get("change_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: state
|
||||
* type: SMALLINT(5)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 1
|
||||
* @param state 1 新领取、未使用,5 已使用,9 作废
|
||||
*/
|
||||
@JSONField(name="state")
|
||||
public void setState(Integer state) {
|
||||
set("state", state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return state 1 新领取、未使用,5 已使用,9 作废
|
||||
*/
|
||||
@JSONField(name="state")
|
||||
public Integer getState() {
|
||||
return getInt("state");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: settlement_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param settlementTime 结算时间
|
||||
*/
|
||||
@JSONField(name="settlement_time")
|
||||
public void setSettlementTime(java.util.Date settlementTime) {
|
||||
set("settlement_time", settlementTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return settlement_time 结算时间
|
||||
*/
|
||||
@JSONField(name="settlement_time")
|
||||
public java.util.Date getSettlementTime() {
|
||||
return get("settlement_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: settlement_user_id
|
||||
* type: INT(10)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param settlementUserId 结算用户id
|
||||
*/
|
||||
@JSONField(name="settlement_user_id")
|
||||
public void setSettlementUserId(Integer settlementUserId) {
|
||||
set("settlement_user_id", settlementUserId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return settlement_user_id 结算用户id
|
||||
*/
|
||||
@JSONField(name="settlement_user_id")
|
||||
public Integer getSettlementUserId() {
|
||||
return getInt("settlement_user_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: settlement_user_name
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param settlementUserName 结算用户姓名
|
||||
*/
|
||||
@JSONField(name="settlement_user_name")
|
||||
public void setSettlementUserName(String settlementUserName) {
|
||||
set("settlement_user_name", settlementUserName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return settlement_user_name 结算用户姓名
|
||||
*/
|
||||
@JSONField(name="settlement_user_name")
|
||||
public String getSettlementUserName() {
|
||||
return getStr("settlement_user_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: invalid_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param invalidTime 作废时间
|
||||
*/
|
||||
@JSONField(name="invalid_time")
|
||||
public void setInvalidTime(java.util.Date invalidTime) {
|
||||
set("invalid_time", invalidTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return invalid_time 作废时间
|
||||
*/
|
||||
@JSONField(name="invalid_time")
|
||||
public java.util.Date getInvalidTime() {
|
||||
return get("invalid_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: invalid_user_id
|
||||
* type: INT(10)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param invalidUserId 作废用户id
|
||||
*/
|
||||
@JSONField(name="invalid_user_id")
|
||||
public void setInvalidUserId(Integer invalidUserId) {
|
||||
set("invalid_user_id", invalidUserId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return invalid_user_id 作废用户id
|
||||
*/
|
||||
@JSONField(name="invalid_user_id")
|
||||
public Integer getInvalidUserId() {
|
||||
return getInt("invalid_user_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: invalid_user_name
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param invalidUserName 作废用户姓名
|
||||
*/
|
||||
@JSONField(name="invalid_user_name")
|
||||
public void setInvalidUserName(String invalidUserName) {
|
||||
set("invalid_user_name", invalidUserName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return invalid_user_name 作废用户姓名
|
||||
*/
|
||||
@JSONField(name="invalid_user_name")
|
||||
public String getInvalidUserName() {
|
||||
return getStr("invalid_user_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: invalid_memo
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param invalidMemo 作废说明
|
||||
*/
|
||||
@JSONField(name="invalid_memo")
|
||||
public void setInvalidMemo(String invalidMemo) {
|
||||
set("invalid_memo", invalidMemo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return invalid_memo 作废说明
|
||||
*/
|
||||
@JSONField(name="invalid_memo")
|
||||
public String getInvalidMemo() {
|
||||
return getStr("invalid_memo");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: order_sn
|
||||
* type: CHAR(16)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param orderSn 关联订单号,方便查询
|
||||
*/
|
||||
@JSONField(name="order_sn")
|
||||
public void setOrderSn(String orderSn) {
|
||||
set("order_sn", orderSn);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return order_sn 关联订单号,方便查询
|
||||
*/
|
||||
@JSONField(name="order_sn")
|
||||
public String getOrderSn() {
|
||||
return getStr("order_sn");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: type
|
||||
* type: SMALLINT(5)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param type 1、2、3、4、5
|
||||
*/
|
||||
@JSONField(name="type")
|
||||
public void setType(Integer type) {
|
||||
set("type", type);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return type 1、2、3、4、5
|
||||
*/
|
||||
@JSONField(name="type")
|
||||
public Integer getType() {
|
||||
return getInt("type");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri Aug 14 00:06:21 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseInvoiceReceive<M extends BaseInvoiceReceive<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "invoice_receive";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(Integer id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public Integer getId() {
|
||||
return getInt("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: num
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param num 领取数量
|
||||
*/
|
||||
@JSONField(name="num")
|
||||
public void setNum(Integer num) {
|
||||
set("num", num);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return num 领取数量
|
||||
*/
|
||||
@JSONField(name="num")
|
||||
public Integer getNum() {
|
||||
return getInt("num");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: start_code
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param startCode 发票起始号码
|
||||
*/
|
||||
@JSONField(name="start_code")
|
||||
public void setStartCode(String startCode) {
|
||||
set("start_code", startCode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return start_code 发票起始号码
|
||||
*/
|
||||
@JSONField(name="start_code")
|
||||
public String getStartCode() {
|
||||
return getStr("start_code");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: current_code
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param currentCode 当前使用到的发票号码
|
||||
*/
|
||||
@JSONField(name="current_code")
|
||||
public void setCurrentCode(String currentCode) {
|
||||
set("current_code", currentCode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return current_code 当前使用到的发票号码
|
||||
*/
|
||||
@JSONField(name="current_code")
|
||||
public String getCurrentCode() {
|
||||
return getStr("current_code");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: create_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param createTime 创建时间
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
set("create_time", createTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_time 创建时间
|
||||
*/
|
||||
@JSONField(name="create_time")
|
||||
public java.util.Date getCreateTime() {
|
||||
return get("create_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: change_time
|
||||
* type: TIMESTAMP(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param changeTime 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public void setChangeTime(java.util.Date changeTime) {
|
||||
set("change_time", changeTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return change_time 最后修改时间
|
||||
*/
|
||||
@JSONField(name="change_time")
|
||||
public java.util.Date getChangeTime() {
|
||||
return get("change_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: receive_user_id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param receiveUserId 领取用户id
|
||||
*/
|
||||
@JSONField(name="receive_user_id")
|
||||
public void setReceiveUserId(Integer receiveUserId) {
|
||||
set("receive_user_id", receiveUserId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return receive_user_id 领取用户id
|
||||
*/
|
||||
@JSONField(name="receive_user_id")
|
||||
public Integer getReceiveUserId() {
|
||||
return getInt("receive_user_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: receive_user_name
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param receiveUserName 领取用户姓名
|
||||
*/
|
||||
@JSONField(name="receive_user_name")
|
||||
public void setReceiveUserName(String receiveUserName) {
|
||||
set("receive_user_name", receiveUserName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return receive_user_name 领取用户姓名
|
||||
*/
|
||||
@JSONField(name="receive_user_name")
|
||||
public String getReceiveUserName() {
|
||||
return getStr("receive_user_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: supermarket_id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param supermarketId 领取超市id
|
||||
*/
|
||||
@JSONField(name="supermarket_id")
|
||||
public void setSupermarketId(Integer supermarketId) {
|
||||
set("supermarket_id", supermarketId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return supermarket_id 领取超市id
|
||||
*/
|
||||
@JSONField(name="supermarket_id")
|
||||
public Integer getSupermarketId() {
|
||||
return getInt("supermarket_id");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.cowr.ssjygl.invoice.log;
|
||||
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceLog;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 22:45:08 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceLogPKValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.cowr.ssjygl.invoice.log;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.model.InvoiceLog;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 22:45:08 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceLogService extends BaseService {
|
||||
public static final InvoiceLogService me = new InvoiceLogService();
|
||||
|
||||
public Page<Record> find(PageParam pp) {
|
||||
String selectsql = "select * ";
|
||||
String fromsql = "from invoice_log t where 1=1 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && InvoiceLog.dao.hasColunm(pp.getSort_field())) {
|
||||
findSql += " order by t." + pp.getSort_field() + " is null, t." + pp.getSort_field();
|
||||
|
||||
if (Const.ORDER_BY_ASC.equals(pp.getSort_order())) {
|
||||
findSql += " " + Const.ORDER_BY_ASC;
|
||||
} else {
|
||||
findSql += " " + Const.ORDER_BY_DESC;
|
||||
}
|
||||
} else {
|
||||
findSql += " order by t.create_time desc";
|
||||
}
|
||||
|
||||
return Db.paginateByFullSql(pp.getPage(), pp.getSize(), totalRowSql, findSql, paraList.toArray());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.cowr.ssjygl.invoice.log;
|
||||
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceLog;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 23:09:29 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceLogValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
// 默认新增时,前端不需要传主键。若需要前端传主键,需要去掉这个判断
|
||||
if (!"save".equals(getActionMethodName())) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
|
||||
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
validateInteger("invoice_receive_id", 1, 2147483647, "invoice_receive_id", "invoice_receive_id 范围 1~2147483647");
|
||||
|
||||
|
||||
validateString("code", 1, 20, "code", "code 长度 1~20");
|
||||
|
||||
|
||||
validateString("create_time", 0, 19, "create_time", "create_time 长度 0~19");
|
||||
|
||||
|
||||
validateString("change_time", 0, 19, "change_time", "change_time 长度 0~19");
|
||||
|
||||
|
||||
validateInteger("state", -999999, 999999, "state", "state 范围 -999999~999999");
|
||||
|
||||
|
||||
validateString("settlement_time", 0, 19, "settlement_time", "settlement_time 长度 0~19");
|
||||
|
||||
validateDate("settlement_time", "yyyy-MM-dd HH:mm:ss", false, "settlement_time", "settlement_time 格式 yyyy-MM-dd HH:mm:ss"); // 默认时间时间字符串格式,生成后根据情况调整
|
||||
if (StrKit.notBlank(c.get("settlement_user_id"))) { // 可为空字段,当传入值时,才做验证
|
||||
validateInteger("settlement_user_id", 1, 2147483647, "settlement_user_id", "settlement_user_id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
validateString("settlement_user_name", 0, 255, "settlement_user_name", "settlement_user_name 长度 0~255");
|
||||
|
||||
|
||||
validateString("invalid_time", 0, 19, "invalid_time", "invalid_time 长度 0~19");
|
||||
|
||||
validateDate("invalid_time", "yyyy-MM-dd HH:mm:ss", false, "invalid_time", "invalid_time 格式 yyyy-MM-dd HH:mm:ss"); // 默认时间时间字符串格式,生成后根据情况调整
|
||||
if (StrKit.notBlank(c.get("invalid_user_id"))) { // 可为空字段,当传入值时,才做验证
|
||||
validateInteger("invalid_user_id", 1, 2147483647, "invalid_user_id", "invalid_user_id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
validateString("invalid_user_name", 0, 255, "invalid_user_name", "invalid_user_name 长度 0~255");
|
||||
|
||||
|
||||
validateString("invalid_memo", 0, 255, "invalid_memo", "invalid_memo 长度 0~255");
|
||||
|
||||
|
||||
validateString("order_sn", 0, 16, "order_sn", "order_sn 长度 0~16");
|
||||
|
||||
if (StrKit.notBlank(c.get("type"))) { // 可为空字段,当传入值时,才做验证
|
||||
validateInteger("type", -999999, 999999, "type", "type 范围 -999999~999999");
|
||||
}
|
||||
|
||||
// 使用 model 更新时,model 不能只有主键有值
|
||||
// 这里用 getActionMethodName 写死,判断是 update 时,才做验证
|
||||
// 如果确实是需要将主键外的字段置为 null,可以在代码生成后删掉这段
|
||||
if ("edit".equals(getActionMethodName())) {
|
||||
validateUpdateModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.cowr.ssjygl.invoice.receive;
|
||||
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 22:45:08 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceReceivePKValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.cowr.ssjygl.invoice.receive;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.model.InvoiceReceive;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 22:45:08 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceReceiveService extends BaseService {
|
||||
public static final InvoiceReceiveService me = new InvoiceReceiveService();
|
||||
|
||||
public Page<Record> find(PageParam pp) {
|
||||
String selectsql = "select * ";
|
||||
String fromsql = "from invoice_receive t where 1=1 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && InvoiceReceive.dao.hasColunm(pp.getSort_field())) {
|
||||
findSql += " order by t." + pp.getSort_field() + " is null, t." + pp.getSort_field();
|
||||
|
||||
if (Const.ORDER_BY_ASC.equals(pp.getSort_order())) {
|
||||
findSql += " " + Const.ORDER_BY_ASC;
|
||||
} else {
|
||||
findSql += " " + Const.ORDER_BY_DESC;
|
||||
}
|
||||
} else {
|
||||
findSql += " order by t.create_time desc";
|
||||
}
|
||||
|
||||
return Db.paginateByFullSql(pp.getPage(), pp.getSize(), totalRowSql, findSql, paraList.toArray());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.cowr.ssjygl.invoice.receive;
|
||||
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceReceive;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri Aug 14 00:06:27 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceReceiveValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
// 默认新增时,前端不需要传主键。若需要前端传主键,需要去掉这个判断
|
||||
if (!"save".equals(getActionMethodName())) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
|
||||
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
validateInteger("num", -2147483647, 2147483647, "num", "num 范围 -2147483647~2147483647");
|
||||
|
||||
|
||||
validateString("start_code", 1, 20, "start_code", "start_code 长度 1~20");
|
||||
|
||||
|
||||
validateString("current_code", 0, 20, "current_code", "current_code 长度 0~20");
|
||||
|
||||
|
||||
validateString("create_time", 0, 19, "create_time", "create_time 长度 0~19");
|
||||
|
||||
|
||||
validateString("change_time", 0, 19, "change_time", "change_time 长度 0~19");
|
||||
|
||||
|
||||
validateInteger("receive_user_id", 1, 2147483647, "receive_user_id", "receive_user_id 范围 1~2147483647");
|
||||
|
||||
|
||||
validateString("receive_user_name", 1, 255, "receive_user_name", "receive_user_name 长度 1~255");
|
||||
|
||||
|
||||
validateInteger("supermarket_id", 1, 2147483647, "supermarket_id", "supermarket_id 范围 1~2147483647");
|
||||
|
||||
|
||||
// 使用 model 更新时,model 不能只有主键有值
|
||||
// 这里用 getActionMethodName 写死,判断是 update 时,才做验证
|
||||
// 如果确实是需要将主键外的字段置为 null,可以在代码生成后删掉这段
|
||||
if ("edit".equals(getActionMethodName())) {
|
||||
validateUpdateModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -64,9 +64,12 @@ public class Main {
|
|||
"order_seq",
|
||||
"auth_license",
|
||||
"device_config",
|
||||
"bocomm",
|
||||
"bocomm_request",
|
||||
"bocomm_response",
|
||||
// "bocomm",
|
||||
// "bocomm_request",
|
||||
// "bocomm_response",
|
||||
"customer_register",
|
||||
"invoice_receive",
|
||||
"invoice_log",
|
||||
};
|
||||
|
||||
PropKit.use("db.properties");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
package com.cowr.local.ssjygl.invoice.log;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceLog;
|
||||
import com.cowr.ssjygl.invoice.log.InvoiceLogPKValidator;
|
||||
import com.cowr.ssjygl.invoice.log.InvoiceLogService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 23:09:29 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceLogController extends Controller {
|
||||
|
||||
/**
|
||||
* 按主键检查对象是否存在
|
||||
* 返回 code = 200
|
||||
* 存在时 data = true
|
||||
* 不存在 data = false
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void checkExistsByPk(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogService.me.checkExistsByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
public void find(){
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
renderJson(Result.object(InvoiceLogService.me.find(pp)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void findByPk(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void get(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogService.me.findByPk(model));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.cowr.local.ssjygl.invoice.receive;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceReceive;
|
||||
import com.cowr.ssjygl.invoice.receive.InvoiceReceivePKValidator;
|
||||
import com.cowr.ssjygl.invoice.receive.InvoiceReceiveService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 23:09:29 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceReceiveController extends Controller {
|
||||
|
||||
/**
|
||||
* 按主键检查对象是否存在
|
||||
* 返回 code = 200
|
||||
* 存在时 data = true
|
||||
* 不存在 data = false
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void checkExistsByPk(){
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.checkExistsByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
public void find(){
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
renderJson(Result.object(InvoiceReceiveService.me.find(pp)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void findByPk(){
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void get(){
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.findByPk(model));
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,8 @@ import com.cowr.local.ssjygl.devicectrl.common.Const;
|
|||
import com.cowr.local.ssjygl.devicectrl.common.DeviceThread;
|
||||
import com.cowr.local.ssjygl.devicectrl.device.CameraController;
|
||||
import com.cowr.local.ssjygl.driver.DriverController;
|
||||
import com.cowr.local.ssjygl.invoice.log.InvoiceLogController;
|
||||
import com.cowr.local.ssjygl.invoice.receive.InvoiceReceiveController;
|
||||
import com.cowr.local.ssjygl.netty.NettyClient;
|
||||
import com.cowr.local.ssjygl.netty.SocketIOService;
|
||||
import com.cowr.local.ssjygl.order.ordercluster.OrderclusterController;
|
||||
|
|
@ -158,9 +160,6 @@ public class Config extends JFinalConfig {
|
|||
me.add("/camera", CameraController.class);
|
||||
me.add("/supcctv", CctvController.class);
|
||||
|
||||
// -- 交行支付相关(接收回调通知)
|
||||
// me.add("/bocomm", BocommController.class);
|
||||
|
||||
// -- 权限系统
|
||||
me.add("/sysuser", SysuserController.class);
|
||||
|
||||
|
|
@ -207,6 +206,10 @@ public class Config extends JFinalConfig {
|
|||
me.add("/stat/sale", OrderStatController.class);
|
||||
me.add("/stat/transfer", OrderTransferStatController.class);
|
||||
me.add("/stat/purchase", OrderPurchaseStatController.class);
|
||||
|
||||
// -- 发票管理
|
||||
me.add("/invoice/log", InvoiceLogController.class);
|
||||
me.add("/invoice/receive", InvoiceReceiveController.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ devMode=true
|
|||
#本地服务 和 云端服务 socket 通信
|
||||
socketserver.enable=true
|
||||
#socketserver.host=47.112.109.118
|
||||
socketserver.host=120.77.59.235
|
||||
socketserver.host=localhost
|
||||
socketserver.port=21002
|
||||
|
||||
#和 web 端的 socket.io 通信端口
|
||||
|
|
@ -24,4 +24,4 @@ weight.distinguish=0.5
|
|||
start.trans.distance=5
|
||||
|
||||
#二维码根url
|
||||
base.url=http://47.112.109.118:10001
|
||||
base.url=http://localhost:10002
|
||||
|
|
@ -4,7 +4,7 @@ jdbcUrl=jdbc:mysql://rm-wz9wa070076b2uge2ro.mysql.rds.aliyuncs.com:3306/ssjy_xsx
|
|||
user=ssjy_xsx
|
||||
password=Ssjy_xs_890
|
||||
|
||||
#jdbcUrl=jdbc:mysql://192.168.1.119:3306/ssjy_xsx_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
#jdbcUrl=jdbc:mysql://localhost:3306/ssjy_xsx_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
#user=root
|
||||
#password=Local_1
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package com.cowr.service.ssjygl.customer.register;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 11:37:59 CST 2020
|
||||
* TableName: customer_register
|
||||
* Remarks: 客户相关 - 客户注册
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerRegisterController extends Controller {
|
||||
|
||||
@Before(CustomerRegisterVerifyValidator.class)
|
||||
public void verify(){
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
long id = getLong("id");
|
||||
int state = getInt("state");
|
||||
String verify_memo = get("verify_memo");
|
||||
renderJson(CustomerRegisterService.me.verify(id, state, verify_memo, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 customer_register 客户相关 - 客户注册
|
||||
*/
|
||||
public void find() {
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
Integer state = getInt("state");
|
||||
String sysuser_name = get("sysuser_name");
|
||||
String sysuser_phone = get("sysuser_phone");
|
||||
String customer_texpayer_name = get("customer_texpayer_name");
|
||||
String receiver_name = get("receiver_name");
|
||||
String receiver_phone = get("receiver_phone");
|
||||
String receiver_address = get("receiver_address");
|
||||
renderJson(Result.object(CustomerRegisterService.me.find(pp, state, sysuser_name, sysuser_phone, customer_texpayer_name, receiver_name, receiver_phone, receiver_address)));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,277 @@
|
|||
package com.cowr.service.ssjygl.customer.register;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.enums.Enums;
|
||||
import com.cowr.common.enums.RoleEnum;
|
||||
import com.cowr.common.enums.UserTypeEnum;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.*;
|
||||
import com.cowr.service.ssjygl.synctask.SyncTaskService;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.cowr.ssjygl.modifylog.ModifyLogService;
|
||||
import com.jfinal.i18n.Res;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.IAtom;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 11:37:59 CST 2020
|
||||
* TableName: customer_register
|
||||
* Remarks: 客户相关 - 客户注册
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerRegisterService extends BaseService {
|
||||
private static Log log = Log.getLog(CustomerRegisterService.class);
|
||||
public static CustomerRegisterService me = new CustomerRegisterService();
|
||||
|
||||
public Result save(Sysuser sysuser, Customer customer, CustomerReceiver receiver) {
|
||||
if (customer.checkDuplicate("name")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (customer.checkDuplicate("texpayer_name")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (customer.checkDuplicate("texpayer_num")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (customer.checkDuplicate("bank_account")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (sysuser.checkDuplicate("phone")) {
|
||||
return Result.failedstr("用户手机号 %s 已存在,不能再注册", sysuser.getPhone());
|
||||
}
|
||||
|
||||
CustomerRegister register = new CustomerRegister();
|
||||
|
||||
register.setSysuserName(sysuser.getName());
|
||||
register.setSysuserPassword(sysuser.getPassword());
|
||||
register.setSysuserPhone(sysuser.getPhone());
|
||||
|
||||
register.setCustomerAddress(customer.getAddress());
|
||||
register.setCustomerPhone(customer.getPhone());
|
||||
register.setCustomerTexpayerName(customer.getTexpayerName());
|
||||
register.setCustomerTexpayerNum(customer.getTexpayerNum());
|
||||
register.setCustomerBankName(customer.getBankName());
|
||||
register.setCustomerBankAccount(customer.getBankAccount());
|
||||
|
||||
register.setReceiverName(receiver.getName());
|
||||
register.setReceiverPhone(receiver.getPhone());
|
||||
register.setReceiverAddress(receiver.getAddress());
|
||||
|
||||
boolean ret = register.save();
|
||||
|
||||
return ret ? Result.success("注册申请提交成功") : Result.failed("注册失败");
|
||||
}
|
||||
|
||||
public Result checkRegister(String sysuser_phone) {
|
||||
int cnt = Db.queryInt("select count(*) from customer_register where sysuser_phone = ? and state = 5 ", sysuser_phone);
|
||||
|
||||
return Result.success(cnt > 0 ? "审核通过" : "审核未通过,或未提交申请");
|
||||
}
|
||||
|
||||
public Result verify(long id, int state, String verify_memo, Sysuser user) {
|
||||
CustomerRegister register = CustomerRegister.dao.findById(id);
|
||||
|
||||
if (register == null) {
|
||||
return Result.failed("未找到注册信息");
|
||||
}
|
||||
|
||||
if (register.getState() == 5) {
|
||||
return Result.failed("已审核通过");
|
||||
}
|
||||
|
||||
if (register.getState() == 9) {
|
||||
return Result.failed("已标记未未通过,不能修改");
|
||||
}
|
||||
|
||||
if (state != 5 && state != 9) {
|
||||
return Result.failed("状态类型错误");
|
||||
}
|
||||
|
||||
CustomerRegister old = register.clone();
|
||||
|
||||
register.setState(state);
|
||||
register.setVerifyMemo(verify_memo);
|
||||
|
||||
if (state == 9) { // 未通过
|
||||
boolean ret = Db.tx(new IAtom() {
|
||||
@Override
|
||||
public boolean run() {
|
||||
try {
|
||||
return register.update() && ModifyLogService.me.save(register, old, Enums.DataOpType.UPDATE.getId(), user);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return ret ? Result.success() : Result.failed("修改失败");
|
||||
} else {
|
||||
// 通过
|
||||
Customer customer = new Customer();
|
||||
customer.setName(register.getCustomerTexpayerName());
|
||||
customer.setAddress(register.getCustomerAddress());
|
||||
customer.setPhone(register.getCustomerPhone());
|
||||
customer.setTexpayerName(register.getCustomerTexpayerName());
|
||||
customer.setTexpayerNum(register.getCustomerTexpayerNum());
|
||||
customer.setBankName(register.getCustomerBankName());
|
||||
customer.setBankAccount(register.getCustomerBankAccount());
|
||||
|
||||
if (customer.checkDuplicate("name")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (customer.checkDuplicate("texpayer_name")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (customer.checkDuplicate("texpayer_num")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
if (customer.checkDuplicate("bank_account")) {
|
||||
return Result.failed("用户已存在,不能再注册");
|
||||
}
|
||||
|
||||
Sysuser sysuser = new Sysuser();
|
||||
sysuser.setName(register.getSysuserName());
|
||||
sysuser.setPhone(register.getSysuserPhone());
|
||||
sysuser.setType(UserTypeEnum.CUSTOMER.getTypeid());
|
||||
sysuser.setPassword(SysuserSyncService.me.getPwdMD5(sysuser.getPhone(), register.getSysuserPassword()));
|
||||
sysuser.setRole(RoleEnum.CUSTOMER.getRoleid());
|
||||
|
||||
if (sysuser.checkDuplicate("phone")) {
|
||||
return Result.failedstr("用户手机号 %s 已存在,不能再注册", sysuser.getPhone());
|
||||
}
|
||||
|
||||
CustomerReceiver receiver = new CustomerReceiver();
|
||||
receiver.setName(register.getReceiverName());
|
||||
receiver.setPhone(register.getReceiverPhone());
|
||||
receiver.setAddress(register.getReceiverAddress());
|
||||
|
||||
boolean ret = Db.tx(new IAtom() {
|
||||
@Override
|
||||
public boolean run() {
|
||||
try {
|
||||
boolean ret = register.update();
|
||||
|
||||
if (!ret) {
|
||||
log.debug("register.update() 失败");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = customer.save();
|
||||
|
||||
if (!ret) {
|
||||
log.debug("customer.save() 失败");
|
||||
return ret;
|
||||
}
|
||||
|
||||
sysuser.setEntityId(customer.getId());
|
||||
receiver.setCustomerId(customer.getId());
|
||||
|
||||
ret = sysuser.save() && receiver.save();
|
||||
|
||||
if (!ret) {
|
||||
log.debug("用户或者收获信息保存失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
SyncTask synctask = new SyncTask();
|
||||
synctask.addSaveData(sysuser);
|
||||
synctask.addSaveData(customer);
|
||||
synctask.addSaveData(receiver);
|
||||
|
||||
return SyncTaskService.me.save(synctask) && ModifyLogService.me.save(register, old, Enums.DataOpType.UPDATE.getId(), user);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return ret ? Result.success() : Result.failed("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
public Page<Record> find(PageParam pp,
|
||||
Integer state,
|
||||
String sysuser_name,
|
||||
String sysuser_phone,
|
||||
String customer_texpayer_name,
|
||||
String receiver_name,
|
||||
String receiver_phone,
|
||||
String receiver_address
|
||||
) {
|
||||
String selectsql = "select * ";
|
||||
String fromsql = "from customer_register t where 1=1 \n";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
if (state != null) {
|
||||
fromsql += " and t.state = ? \n";
|
||||
paraList.add(state);
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(sysuser_name)) {
|
||||
fromsql += " and t.sysuser_name like ? \n";
|
||||
paraList.add("%" + sysuser_name + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(sysuser_phone)) {
|
||||
fromsql += " and t.sysuser_phone like ? \n";
|
||||
paraList.add("%" + sysuser_phone + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(customer_texpayer_name)) {
|
||||
fromsql += " and t.customer_texpayer_name like ? \n";
|
||||
paraList.add("%" + customer_texpayer_name + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(receiver_name)) {
|
||||
fromsql += " and t.receiver_name like ? \n";
|
||||
paraList.add("%" + receiver_name + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(receiver_phone)) {
|
||||
fromsql += " and t.receiver_phone like ? \n";
|
||||
paraList.add("%" + receiver_phone + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(receiver_address)) {
|
||||
fromsql += " and t.receiver_address like ? \n";
|
||||
paraList.add("%" + receiver_address + "%");
|
||||
}
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && CustomerRegister.dao.hasColunm(pp.getSort_field())) {
|
||||
findSql += " order by t." + pp.getSort_field() + " is null, t." + pp.getSort_field();
|
||||
|
||||
if (Const.ORDER_BY_ASC.equals(pp.getSort_order())) {
|
||||
findSql += " " + Const.ORDER_BY_ASC;
|
||||
} else {
|
||||
findSql += " " + Const.ORDER_BY_DESC;
|
||||
}
|
||||
} else {
|
||||
findSql += " order by t.create_time desc ";
|
||||
}
|
||||
|
||||
return Db.paginateByFullSql(pp.getPage(), pp.getSize(), totalRowSql, findSql, paraList.toArray());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.cowr.service.ssjygl.customer.register;
|
||||
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Feb 10 12:11:03 CST 2020
|
||||
* TableName: prepay_detail
|
||||
* Remarks: 预付费客户付费详情
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerRegisterVerifyValidator extends CrudParamValidator {
|
||||
private static List<Integer> chkstate = new ArrayList<Integer>(){{
|
||||
add(5);
|
||||
add(9);
|
||||
}};
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
validateLong("id", 1, 9223372036854775807L, "id", "id 范围 1~9223372036854775807L");
|
||||
validateInIntegerArray("state", chkstate, "state", "state 可选值 5、9");
|
||||
validateString("verify_memo", 0, 255, "memo", "verify_memo 长度 0~255");
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.cowr.service.ssjygl.invoice.log;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceLog;
|
||||
import com.cowr.ssjygl.invoice.log.InvoiceLogPKValidator;
|
||||
import com.cowr.ssjygl.invoice.log.InvoiceLogService;
|
||||
import com.cowr.ssjygl.invoice.log.InvoiceLogValidator;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 23:09:29 CST 2020
|
||||
* TableName: invoice_log
|
||||
* Remarks: 发票管理 - 发票使用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceLogController extends Controller {
|
||||
|
||||
/**
|
||||
* 按主键检查对象是否存在
|
||||
* 返回 code = 200
|
||||
* 存在时 data = true
|
||||
* 不存在 data = false
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void checkExistsByPk(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogService.me.checkExistsByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogValidator.class)
|
||||
public void save(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogSyncService.me.save(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void del(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogSyncService.me.delete(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void restore(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogSyncService.me.restore(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogValidator.class)
|
||||
public void edit(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogSyncService.me.update(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
public void find(){
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
renderJson(Result.object(InvoiceLogService.me.find(pp)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void findByPk(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_log 发票管理 - 发票使用记录
|
||||
*/
|
||||
@Before(InvoiceLogPKValidator.class)
|
||||
public void get(){
|
||||
InvoiceLog model = getModel(InvoiceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceLogService.me.findByPk(model));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.cowr.service.ssjygl.invoice.log;
|
||||
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
import com.jfinal.log.Log;
|
||||
|
||||
public class InvoiceLogSyncService extends BaseSyncService {
|
||||
private static Log log = Log.getLog(InvoiceLogSyncService.class);
|
||||
public static InvoiceLogSyncService me = new InvoiceLogSyncService();
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.cowr.service.ssjygl.invoice.receive;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceReceive;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.cowr.ssjygl.invoice.receive.InvoiceReceivePKValidator;
|
||||
import com.cowr.ssjygl.invoice.receive.InvoiceReceiveService;
|
||||
import com.cowr.ssjygl.invoice.receive.InvoiceReceiveValidator;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Thu Aug 13 23:09:29 CST 2020
|
||||
* TableName: invoice_receive
|
||||
* Remarks: 发票管理 - 领用记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class InvoiceReceiveController extends Controller {
|
||||
|
||||
/**
|
||||
* 按主键检查对象是否存在
|
||||
* 返回 code = 200
|
||||
* 存在时 data = true
|
||||
* 不存在 data = false
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void checkExistsByPk(){
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.checkExistsByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceiveValidator.class)
|
||||
public void save(){
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveSyncService.me.save(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void del(){
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveSyncService.me.delete(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void restore(){
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveSyncService.me.restore(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceiveValidator.class)
|
||||
public void edit(){
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveSyncService.me.update(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
public void find(){
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
renderJson(Result.object(InvoiceReceiveService.me.find(pp)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void findByPk(){
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 invoice_receive 发票管理 - 领用记录
|
||||
*/
|
||||
@Before(InvoiceReceivePKValidator.class)
|
||||
public void get(){
|
||||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.findByPk(model));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cowr.service.ssjygl.invoice.receive;
|
||||
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.InvoiceReceive;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
import com.jfinal.log.Log;
|
||||
|
||||
public class InvoiceReceiveSyncService extends BaseSyncService {
|
||||
private static Log log = Log.getLog(InvoiceReceiveSyncService.class);
|
||||
public static InvoiceReceiveSyncService me = new InvoiceReceiveSyncService();
|
||||
|
||||
public Result save(InvoiceReceive receive, Sysuser user){
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,9 @@ import com.jfinal.aop.Invocation;
|
|||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.log.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AuthInterceptor implements Interceptor {
|
||||
private static Log log = Log.getLog(AuthInterceptor.class);
|
||||
private String ENV;
|
||||
|
|
@ -46,6 +49,9 @@ public class AuthInterceptor implements Interceptor {
|
|||
return;
|
||||
}
|
||||
|
||||
// 有有效的 token 了,还要验证当前的 token 可不可以访问当前的 url
|
||||
System.out.println("inv.getController().getRequest().getRequestURI():" + inv.getController().getRequest().getRequestURI());
|
||||
|
||||
inv.invoke();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ import com.cowr.service.ssjygl.cache.CacheController;
|
|||
import com.cowr.service.ssjygl.customer.CustomerController;
|
||||
import com.cowr.service.ssjygl.customer.contact.CustomerContactController;
|
||||
import com.cowr.service.ssjygl.customer.receiver.CustomerReceiverController;
|
||||
import com.cowr.service.ssjygl.customer.register.CustomerRegisterController;
|
||||
import com.cowr.service.ssjygl.driver.DriverController;
|
||||
import com.cowr.service.ssjygl.invoice.log.InvoiceLogController;
|
||||
import com.cowr.service.ssjygl.invoice.receive.InvoiceReceiveController;
|
||||
import com.cowr.service.ssjygl.netty.NettyServer;
|
||||
import com.cowr.service.ssjygl.order.ordercluster.OrderclusterController;
|
||||
import com.cowr.service.ssjygl.order.orderpurchase.OrderPurchaseController;
|
||||
|
|
@ -149,6 +152,7 @@ public class Config extends JFinalConfig {
|
|||
me.add("/customer", CustomerController.class);
|
||||
me.add("/customer/contact", CustomerContactController.class);
|
||||
me.add("/customer/receiver", CustomerReceiverController.class);
|
||||
me.add("/customer/register", CustomerRegisterController.class);
|
||||
|
||||
// -- 预付费
|
||||
me.add("/prepay", PrepayController.class);
|
||||
|
|
@ -168,6 +172,10 @@ public class Config extends JFinalConfig {
|
|||
me.add("/stat/sale", OrderStatController.class);
|
||||
me.add("/stat/transfer", OrderTransferStatController.class);
|
||||
me.add("/stat/purchase", OrderPurchaseStatController.class);
|
||||
|
||||
// -- 发票管理
|
||||
me.add("/invoice/log", InvoiceLogController.class);
|
||||
me.add("/invoice/receive", InvoiceReceiveController.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -34,16 +34,18 @@ public class SyncTaskService {
|
|||
/**
|
||||
* 创建同步日志,并且发送下发数据包
|
||||
*
|
||||
* @param synctask 的 SyncTask
|
||||
* @param model 的 SyncTask
|
||||
* @return
|
||||
*/
|
||||
public boolean save(SyncTask synctask) {
|
||||
public boolean save(SyncTask model) {
|
||||
if(!isEnable()){
|
||||
return true;
|
||||
}
|
||||
|
||||
List<SyncTask> list = new ArrayList<>();
|
||||
|
||||
model.setJson(); // 使用逐步加入的数据设置数据
|
||||
|
||||
for (Map.Entry<Integer, Supermarket> entry : SvrCacheData.SUP_CACHE.entrySet()) {
|
||||
Supermarket supermarket = entry.getValue();
|
||||
|
||||
|
|
@ -52,7 +54,7 @@ public class SyncTaskService {
|
|||
continue;
|
||||
}
|
||||
|
||||
synctask.setJson(); // 使用逐步加入的数据设置数据
|
||||
SyncTask synctask = model.clone();
|
||||
|
||||
synctask.setId(StrKit.getRandomUUID());
|
||||
synctask.setSupermarketId(entry.getKey());
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.cowr.common.view.Result;
|
|||
import com.cowr.model.Customer;
|
||||
import com.cowr.model.CustomerReceiver;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.customer.register.CustomerRegisterService;
|
||||
import com.cowr.service.ssjygl.main.AuthInterceptor;
|
||||
import com.cowr.ssjygl.system.sysuser.SysuserPKValidator;
|
||||
import com.cowr.ssjygl.system.sysuser.SysuserValidator;
|
||||
|
|
@ -120,8 +121,22 @@ public class SysuserController extends Controller {
|
|||
renderJson(SysuserSyncService.me.findByPk(model));
|
||||
}
|
||||
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void testlogin() {
|
||||
String name = get("name", "").trim();
|
||||
String phone = get("phone", "").trim();
|
||||
String password = get("password", "");
|
||||
|
||||
renderJson(SysuserSyncService.me.login(name, phone, password));
|
||||
}
|
||||
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void login() {
|
||||
if (!validateCaptcha("captcha")) {
|
||||
renderJson(Result.failed("验证码输入错误"));
|
||||
return;
|
||||
}
|
||||
|
||||
String name = get("name", "").trim();
|
||||
String phone = get("phone", "").trim();
|
||||
String password = get("password", "");
|
||||
|
|
@ -170,17 +185,34 @@ public class SysuserController extends Controller {
|
|||
renderJson(SysuserSyncService.me.resetPassword(model, tokenuser));
|
||||
}
|
||||
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void captcha() {
|
||||
renderCaptcha();
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户注册
|
||||
*/
|
||||
@Clear(AuthInterceptor.class)
|
||||
@Before(RegisterUserValidator.class)
|
||||
public void register() {
|
||||
if (!validateCaptcha("captcha")) {
|
||||
renderJson(Result.failed("验证码输入错误"));
|
||||
return;
|
||||
}
|
||||
|
||||
// 两个密码前端验证,提交一个就可以了
|
||||
Sysuser sysuser = getModel(Sysuser.class, "sysuser", true); // 忽略不在model中的字段
|
||||
Customer customer = getModel(Customer.class, "customer", true);
|
||||
CustomerReceiver receiver = getModel(CustomerReceiver.class, "receiver", true);
|
||||
|
||||
renderJson(SysuserSyncService.me.register(sysuser, customer, receiver));
|
||||
renderJson(CustomerRegisterService.me.save(sysuser, customer, receiver));
|
||||
}
|
||||
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void checkRegister() {
|
||||
String sysuser_phone = get("sysuser_phone", "");
|
||||
|
||||
renderJson(CustomerRegisterService.me.checkRegister(sysuser_phone));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.cowr.common.view.PageParam;
|
|||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.*;
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
import com.cowr.service.ssjygl.customer.register.CustomerRegisterService;
|
||||
import com.cowr.service.ssjygl.main.Config;
|
||||
import com.cowr.service.ssjygl.synctask.SyncTaskService;
|
||||
import com.cowr.ssjygl.modifylog.ModifyLogService;
|
||||
|
|
@ -85,6 +86,16 @@ public class SysuserSyncService extends BaseSyncService {
|
|||
return rolepattern.matcher(rolestr).matches() && "1".equals(rolestr.substring(0, 1)) && "2".equals(rolestr.substring(2, 3));
|
||||
}
|
||||
|
||||
public boolean isCustomer(Integer roleid) {
|
||||
if (roleid == null) return false;
|
||||
return roleid.equals(RoleEnum.CUSTOMER.getRoleid());
|
||||
}
|
||||
|
||||
public boolean isChaisha(Integer roleid) {
|
||||
if (roleid == null) return false;
|
||||
return roleid.equals(RoleEnum.CHAISHA.getRoleid());
|
||||
}
|
||||
|
||||
/**
|
||||
* 2020-03-7 财务和总经理,必须选超市管理员?
|
||||
* 是否是财务人员
|
||||
|
|
@ -221,8 +232,12 @@ public class SysuserSyncService extends BaseSyncService {
|
|||
return Result.failed(false, "不能直接在账号内添加司机");
|
||||
}
|
||||
|
||||
if (!isTreasurer(model.getRole()) && !isPresident(model.getRole()) && !isConfigAdmin(model.getRole())) {
|
||||
// 不是财务、经理的时候,按照原来的规则检查
|
||||
if (!isTreasurer(model.getRole())
|
||||
&& !isPresident(model.getRole())
|
||||
&& !isConfigAdmin(model.getRole())
|
||||
&& !isChaisha(model.getRole())
|
||||
) {
|
||||
// 不是财务、经理、采砂局的时候,按照原来的规则检查
|
||||
if (checkEntityId(model) == null) {
|
||||
return Result.failed(false, "entity_id 未找到对应值");
|
||||
}
|
||||
|
|
@ -534,6 +549,8 @@ public class SysuserSyncService extends BaseSyncService {
|
|||
&& !isPresident(sysuser.getRole())
|
||||
&& !isPresidentView(sysuser.getRole())
|
||||
&& !isTreasurer(sysuser.getRole())
|
||||
&& !isCustomer(sysuser.getRole())
|
||||
&& !isChaisha(sysuser.getRole())
|
||||
) {
|
||||
return Result.permissionDenied();
|
||||
}
|
||||
|
|
@ -617,58 +634,4 @@ public class SysuserSyncService extends BaseSyncService {
|
|||
|
||||
return Db.paginate(pp.getPage(), pp.getSize(), "select * ", sqlbuf.toString(), paraList.toArray());
|
||||
}
|
||||
|
||||
public Result register(Sysuser sysuser, Customer customer, CustomerReceiver receiver){
|
||||
if(sysuser.checkDuplicate("phone")){
|
||||
return Result.failedstr("手机号 %s 已存在", sysuser.getPhone());
|
||||
}
|
||||
|
||||
if(customer.checkDuplicate("name", "texpayer_name", "texpayer_num", "bank_account")){
|
||||
return Result.failed("用户已存在");
|
||||
}
|
||||
|
||||
sysuser.setType(UserTypeEnum.CUSTOMER.getTypeid());
|
||||
sysuser.setPassword(getPwdMD5(sysuser.getPhone(), sysuser.getPassword()));
|
||||
|
||||
customer.setName(customer.getTexpayerName());
|
||||
|
||||
boolean ret = Db.tx(new IAtom() {
|
||||
@Override
|
||||
public boolean run() {
|
||||
try{
|
||||
boolean ret = customer.save();
|
||||
|
||||
if(!ret){
|
||||
log.debug("客户信息保存失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
sysuser.setEntityId(customer.getId());
|
||||
sysuser.setRole(RoleEnum.CUSTOMER.getRoleid());
|
||||
|
||||
receiver.setCustomerId(customer.getId());
|
||||
|
||||
ret = sysuser.save() && receiver.save();
|
||||
|
||||
if(!ret){
|
||||
log.debug("用户或者收获信息保存失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
SyncTask synctask = new SyncTask();
|
||||
synctask.addSaveData(sysuser);
|
||||
synctask.addSaveData(customer);
|
||||
synctask.addSaveData(receiver);
|
||||
|
||||
return SyncTaskService.me.save(synctask);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return ret ? Result.success("注册成功") : Result.failed("注册失败");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue