Compare commits
No commits in common. "6ad0a522609a7ac77f237b746bf81d93260f8789" and "3d3c4f90f05318d7284025b326380cce90b2db96" have entirely different histories.
6ad0a52260
...
3d3c4f90f0
|
|
@ -1,38 +1,38 @@
|
|||
.idea/
|
||||
*.iml
|
||||
/ssjygl-xsct-common/target/
|
||||
/ssjygl-xsct-local/target/
|
||||
/ssjygl-xsct-service/target/
|
||||
/ssjygl-xsct-devicectrl/target/
|
||||
/ssjygl-xsx-common/target/
|
||||
/ssjygl-xsx-local/target/
|
||||
/ssjygl-xsx-service/target/
|
||||
/ssjygl-xsx-devicectrl/target/
|
||||
|
||||
/logs/
|
||||
/ssjygl-xsct-common/logs/
|
||||
/ssjygl-xsct-local/logs/
|
||||
/ssjygl-xsct-service/logs/
|
||||
/ssjygl-xsct-devicectrl/logs/
|
||||
/ssjygl-xsx-common/logs/
|
||||
/ssjygl-xsx-local/logs/
|
||||
/ssjygl-xsx-service/logs/
|
||||
/ssjygl-xsx-devicectrl/logs/
|
||||
|
||||
/ssjygl-xsct-common/out/
|
||||
/ssjygl-xsct-local/out/
|
||||
/ssjygl-xsct-service/out/
|
||||
/ssjygl-xsct-devicectrl/out/
|
||||
/ssjygl-xsx-common/out/
|
||||
/ssjygl-xsx-local/out/
|
||||
/ssjygl-xsx-service/out/
|
||||
/ssjygl-xsx-devicectrl/out/
|
||||
|
||||
/ssjygl-xsct-common/upload/
|
||||
/ssjygl-xsct-local/upload/
|
||||
/ssjygl-xsct-service/upload/
|
||||
/ssjygl-xsct-devicectrl/upload/
|
||||
/ssjygl-xsx-common/upload/
|
||||
/ssjygl-xsx-local/upload/
|
||||
/ssjygl-xsx-service/upload/
|
||||
/ssjygl-xsx-devicectrl/upload/
|
||||
|
||||
/ssjygl-xsct-common/.idea/
|
||||
/ssjygl-xsct-local/.idea/
|
||||
/ssjygl-xsct-service/.idea/
|
||||
/ssjygl-xsct-devicectrl/.idea/
|
||||
/ssjygl-xsx-common/.idea/
|
||||
/ssjygl-xsx-local/.idea/
|
||||
/ssjygl-xsx-service/.idea/
|
||||
/ssjygl-xsx-devicectrl/.idea/
|
||||
|
||||
/gern
|
||||
/ssjygl-xsct-common/imgfile/
|
||||
/ssjygl-xsct-local/imgfile/
|
||||
/ssjygl-xsct-common/xlsfile/
|
||||
/ssjygl-xsct-local/xlsfile/
|
||||
/ssjygl-xsct-common/KHT_Log/
|
||||
/ssjygl-xsct-local/KHT_Log/
|
||||
/ssjygl-xsx-common/imgfile/
|
||||
/ssjygl-xsx-local/imgfile/
|
||||
/ssjygl-xsx-common/xlsfile/
|
||||
/ssjygl-xsx-local/xlsfile/
|
||||
/ssjygl-xsx-common/KHT_Log/
|
||||
/ssjygl-xsx-local/KHT_Log/
|
||||
|
||||
/ssjygl-xsct-local/lib/bocommjava/log
|
||||
/ssjygl-xsct-local/src/main/webapp/upload
|
||||
/ssjygl-xsx-local/lib/bocommjava/log
|
||||
/ssjygl-xsx-local/src/main/webapp/upload
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#砂石经营管理2.0
|
||||
##浠水城投后端服务
|
||||
##浠水县后端服务
|
||||
1. ssjygl-xs-common 本地和云端后端服务公用代码
|
||||
2. ssjygl-xs-local 本地后端服务
|
||||
3. ssjygl-xs-service 云端后端服务
|
||||
|
||||
2021年7月改版开发分支
|
||||
2021年7月改版开发分支
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
cd ../ssjygl-xsct-local
|
||||
cd ../ssjygl-xsx-local
|
||||
start mvn clean package
|
||||
|
||||
cd ../ssjygl-xsct-service
|
||||
cd ../ssjygl-xsx-service
|
||||
start mvn clean package
|
||||
|
||||
cd ..
|
||||
cd ..
|
||||
8
build.sh
8
build.sh
|
|
@ -1,10 +1,10 @@
|
|||
cd ssjygl-xsct-common
|
||||
cd ssjygl-xsx-common
|
||||
mvn clean package install
|
||||
|
||||
cd ../ssjygl-xsct-local
|
||||
cd ../ssjygl-xsx-local
|
||||
mvn clean package
|
||||
|
||||
cd ../ssjygl-xsct-service
|
||||
cd ../ssjygl-xsx-service
|
||||
mvn clean package
|
||||
|
||||
cd ..
|
||||
cd ..
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseCustomerContractSigned;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Nov 17 15:39:45 CST 2021
|
||||
* TableName: customer_contract_signed_log
|
||||
* Remarks:
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CustomerContractSigned extends BaseCustomerContractSigned<CustomerContractSigned> {
|
||||
public static final CustomerContractSigned dao = new CustomerContractSigned().dao();
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseHbrsmsLog;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/10/10.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
public class HbrsmsLog extends BaseHbrsmsLog<HbrsmsLog> {
|
||||
|
||||
public static final HbrsmsLog dao = new HbrsmsLog().dao();
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseSupermarketProductLog;
|
||||
|
||||
/**
|
||||
* Generated by COWR Sun Apr 12 21:56:10 CST 2020
|
||||
* TableName: supermarket_product
|
||||
* Remarks: 基础配置 - 超市单价修改审核表
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SupermarketProductLog extends BaseSupermarketProductLog<SupermarketProductLog> {
|
||||
public static final SupermarketProductLog dao = new SupermarketProductLog().dao();
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.cowr.model;
|
||||
|
||||
import com.cowr.model.base.BaseTransPriceLog;
|
||||
|
||||
/**
|
||||
* Generated by COWR Sun Apr 12 21:56:10 CST 2020
|
||||
* TableName: customer
|
||||
* Remarks: 客户相关 - 客户
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TransPriceLog extends BaseTransPriceLog<TransPriceLog> {
|
||||
public static final TransPriceLog dao = new TransPriceLog().dao();
|
||||
}
|
||||
|
|
@ -1,225 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Nov 17 15:39:45 CST 2021
|
||||
* TableName: customer_contract_signed_log
|
||||
* Remarks:
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseCustomerContractSigned<M extends BaseCustomerContractSigned<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "customer_contract_signed";
|
||||
|
||||
@JSONField(serialize=false)
|
||||
public String getTablename(){
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: INT UNSIGNED(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: create_id
|
||||
* type: INT UNSIGNED(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param createId 用户id
|
||||
*/
|
||||
@JSONField(name="create_id")
|
||||
public void setCreateId(Integer createId) {
|
||||
set("create_id", createId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_id 用户id
|
||||
*/
|
||||
@JSONField(name="create_id")
|
||||
public Integer getCreateId() {
|
||||
return getInt("create_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: create_name
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param createName 用户姓名
|
||||
*/
|
||||
@JSONField(name="create_name")
|
||||
public void setCreateName(String createName) {
|
||||
set("create_name", createName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return user_name 用户姓名
|
||||
*/
|
||||
@JSONField(name="create_name")
|
||||
public String getCreateName() {
|
||||
return getStr("create_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: create_time
|
||||
* type: TIMESTAMP(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: name
|
||||
* type: VARCHAR(200)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param name 姓名
|
||||
*/
|
||||
@JSONField(name="name")
|
||||
public void setName(String name) {
|
||||
set("name", name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return customer_id 用户关联公司id
|
||||
*/
|
||||
@JSONField(name="name")
|
||||
public String getName() {
|
||||
return getStr("name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: attachment
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param attachment 附件
|
||||
*/
|
||||
@JSONField(name="attachment")
|
||||
public void setAttachment(String attachment) {
|
||||
set("attachment", attachment);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return attachment 附件
|
||||
*/
|
||||
@JSONField(name="attachment")
|
||||
public String getAttachment() {
|
||||
return getStr("attachment");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: htmlstr
|
||||
* type: TEXT(65535)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param htmlstr word转成的html字符串
|
||||
*/
|
||||
@JSONField(name="htmlstr")
|
||||
public void setHtmlstr(String htmlstr) {
|
||||
set("htmlstr", htmlstr);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return htmlstr word转成的html字符串
|
||||
*/
|
||||
@JSONField(name="htmlstr")
|
||||
public String getHtmlstr() {
|
||||
return getStr("htmlstr");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: state
|
||||
* type: SMALLINT(5)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 1
|
||||
*
|
||||
* @param state 1,启用;(后台自动设置)
|
||||
* 0,禁用;
|
||||
*/
|
||||
@JSONField(name = "state")
|
||||
public void setState(Integer state) {
|
||||
set("state", state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return state 1,启用;(后台自动设置)
|
||||
* * 0,禁用;
|
||||
*/
|
||||
@JSONField(name = "state")
|
||||
public Integer getState() {
|
||||
return getInt("state");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: del
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 0
|
||||
* @param del 逻辑删除标记位
|
||||
*/
|
||||
@JSONField(name="del")
|
||||
public void setDel(Integer del) {
|
||||
set("del", del);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return del 逻辑删除标记位
|
||||
*/
|
||||
@JSONField(name="del")
|
||||
public Integer getDel() {
|
||||
return getInt("del");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/12/6.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public abstract class BaseHbrsmsLog<M extends BaseHbrsmsLog<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
|
||||
public static final String tablename = "hbrsms_log";
|
||||
|
||||
@JSONField(serialize = false)
|
||||
public String getTablename() {
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: sn
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
*
|
||||
* @param sn sn
|
||||
*/
|
||||
@JSONField(name = "sn")
|
||||
public void setSn(String sn) {
|
||||
set("sn", sn);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name = "sn")
|
||||
public String getSn() {
|
||||
return getStr("sn");
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "createdate")
|
||||
public void setCreatedate(Date createdate) {
|
||||
set("createdate", createdate);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name = "createdate")
|
||||
public Date getCreatedate() {
|
||||
return get("createdate");
|
||||
}
|
||||
|
||||
@JSONField(name = "reqData")
|
||||
public void setReqData(String reqData) {
|
||||
set("reqData", reqData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name = "reqData")
|
||||
public String getReqData() {
|
||||
return getStr("reqData");
|
||||
}
|
||||
|
||||
@JSONField(name = "respData")
|
||||
public void setRespData(String respData) {
|
||||
set("respData", respData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name = "respData")
|
||||
public String getrespData() {
|
||||
return getStr("respData");
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "status")
|
||||
public void setStatus(String status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@JSONField(name = "status")
|
||||
public String getStatus() {
|
||||
return getStr("status");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,320 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri Apr 17 16:59:35 CST 2020
|
||||
* TableName: supermarket_product_log
|
||||
* Remarks: 基础配置 - 超市单价修改审核表
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseSupermarketProductLog<M extends BaseSupermarketProductLog<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "supermarket_product_log";
|
||||
|
||||
@JSONField(serialize = false)
|
||||
public String getTablename() {
|
||||
return tablename;
|
||||
}
|
||||
|
||||
/**
|
||||
* name: id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
* @param id 主键id
|
||||
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public void setId(java.lang.Integer id) {
|
||||
set("id", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id 主键id
|
||||
|
||||
*/
|
||||
@JSONField(name="id")
|
||||
public java.lang.Integer getId() {
|
||||
return getInt("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: supermarket_id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* 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");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: product_id
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: YES
|
||||
* defaultValue:
|
||||
*
|
||||
* @param productId 商品id
|
||||
*/
|
||||
@JSONField(name = "product_id")
|
||||
public void setProductId(Integer productId) {
|
||||
set("product_id", productId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return product_id 商品id
|
||||
*/
|
||||
@JSONField(name = "product_id")
|
||||
public Integer getProductId() {
|
||||
return getInt("product_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: unit_price
|
||||
* type: DECIMAL(12,2)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param unitPrice 修改后单价
|
||||
*/
|
||||
@JSONField(name = "unit_price")
|
||||
public void setUnitPrice(java.math.BigDecimal unitPrice) {
|
||||
set("unit_price", unitPrice);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return unit_price 修改后单价
|
||||
*/
|
||||
@JSONField(name = "unit_price")
|
||||
public java.math.BigDecimal getUnitPrice() {
|
||||
return get("unit_price");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: old_price
|
||||
* type: DECIMAL(12,2)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param oldPrice 修改前单价
|
||||
*/
|
||||
@JSONField(name = "old_price")
|
||||
public void setOldPrice(java.math.BigDecimal oldPrice) {
|
||||
set("old_price", oldPrice);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return unit_price 修改前单价
|
||||
*/
|
||||
@JSONField(name = "old_price")
|
||||
public java.math.BigDecimal getOldPrice() {
|
||||
return get("old_price");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: create_id
|
||||
* type: INT UNSIGNED(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param createId 用户id
|
||||
*/
|
||||
@JSONField(name="create_id")
|
||||
public void setCreateId(Integer createId) {
|
||||
set("create_id", createId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_id 用户id
|
||||
*/
|
||||
@JSONField(name="create_id")
|
||||
public Integer getCreateId() {
|
||||
return getInt("create_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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: auditor_id
|
||||
* type: INT UNSIGNED(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param auditorId 用户id
|
||||
*/
|
||||
@JSONField(name="auditor_id")
|
||||
public void setAuditorId(Integer auditorId) {
|
||||
set("auditor_id", auditorId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return auditor_id 用户id
|
||||
*/
|
||||
@JSONField(name="auditor_id")
|
||||
public Integer getAuditorId() {
|
||||
return getInt("auditor_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: auditor_time
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param auditorTime 创建时间
|
||||
*/
|
||||
@JSONField(name="auditor_time")
|
||||
public void setAuditorTime(java.util.Date auditorTime) {
|
||||
set("auditor_time", auditorTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return auditor_time 创建时间
|
||||
*/
|
||||
@JSONField(name="auditor_time")
|
||||
public java.util.Date getAuditorTime() {
|
||||
return get("auditor_time");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: state
|
||||
* type: SMALLINT(5)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 0
|
||||
*
|
||||
* @param state 审核状态 0:未通过,1:已通过
|
||||
*/
|
||||
@JSONField(name = "state")
|
||||
public void setState(Integer state) {
|
||||
set("state", state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return state 审核状态 0:未通过,1:已通过
|
||||
*/
|
||||
@JSONField(name = "state")
|
||||
public Integer getState() {
|
||||
return getInt("state");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: del
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 0
|
||||
* @param del 逻辑删除标记位
|
||||
*/
|
||||
@JSONField(name="del")
|
||||
public void setDel(Integer del) {
|
||||
set("del", del);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return del 逻辑删除标记位
|
||||
*/
|
||||
@JSONField(name="del")
|
||||
public Integer getDel() {
|
||||
return getInt("del");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: htmlstr
|
||||
* type: TEXT(65535)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param htmlstr word转成的html字符串
|
||||
*/
|
||||
@JSONField(name="htmlstr")
|
||||
public void setHtmlstr(String htmlstr) {
|
||||
set("htmlstr", htmlstr);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return htmlstr word转成的html字符串
|
||||
*/
|
||||
@JSONField(name="htmlstr")
|
||||
public String getHtmlstr() {
|
||||
return getStr("htmlstr");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: attachment
|
||||
* type: VARCHAR(255)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param attachment 附件
|
||||
*/
|
||||
@JSONField(name="attachment")
|
||||
public void setAttachment(String attachment) {
|
||||
set("attachment", attachment);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return attachment 附件
|
||||
*/
|
||||
@JSONField(name="attachment")
|
||||
public String getAttachment() {
|
||||
return getStr("attachment");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,302 +0,0 @@
|
|||
package com.cowr.model.base;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.cowr.common.base.BaseModel;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by COWR Fri Apr 17 16:59:35 CST 2020
|
||||
* TableName: trans_price_log
|
||||
* Remarks: 系统配置 - 运费结算记录
|
||||
* <p>
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseTransPriceLog<M extends BaseTransPriceLog<M>> extends BaseModel<M> implements IBean {
|
||||
|
||||
public static final String tablename = "trans_price_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: trans_co_id
|
||||
* type: INT(10)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param transCoId 物流公司
|
||||
*/
|
||||
@JSONField(name = "trans_co_id")
|
||||
public void setTransCoId(Integer transCoId) {
|
||||
set("trans_co_id", transCoId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trans_co_id 物流公司
|
||||
*/
|
||||
@JSONField(name = "trans_co_id")
|
||||
public Integer getTransCoId() {
|
||||
return getInt("trans_co_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: trans_co_name
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param transCoName
|
||||
*/
|
||||
@JSONField(name = "trans_co_name")
|
||||
public void setTransCoName(String transCoName) {
|
||||
set("trans_co_name", transCoName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trans_co_name
|
||||
*/
|
||||
@JSONField(name = "trans_co_name")
|
||||
public String getTransCoName() {
|
||||
return getStr("trans_co_name");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: trans_name
|
||||
* type: varchar(15)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param transName 联系人姓名
|
||||
*/
|
||||
@JSONField(name = "trans_name")
|
||||
public void setTransName(String transName) {
|
||||
set("trans_name", transName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trans_name 联系人姓名
|
||||
*/
|
||||
@JSONField(name = "trans_name")
|
||||
public String getTransName() {
|
||||
return getStr("trans_name");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: trans_phone
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param transPhone
|
||||
*/
|
||||
@JSONField(name = "trans_phone")
|
||||
public void setTransPhone(String transPhone) {
|
||||
set("trans_phone", transPhone);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trans_co_name
|
||||
*/
|
||||
@JSONField(name = "trans_phone")
|
||||
public String getTransPhone() {
|
||||
return getStr("trans_phone");
|
||||
}
|
||||
|
||||
/**
|
||||
* name: settlement_dates
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param v
|
||||
*/
|
||||
@JSONField(name = "settlement_dates")
|
||||
public void setSettlementDates(String v) {
|
||||
set("settlement_dates", v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return trans_co_name
|
||||
*/
|
||||
@JSONField(name = "settlement_dates")
|
||||
public String getSettlementDates() {
|
||||
return getStr("settlement_dates");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: bank_sn
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 流水号
|
||||
*
|
||||
* @param v
|
||||
*/
|
||||
@JSONField(name = "bank_sn")
|
||||
public void setBankSn(String v) {
|
||||
set("bank_sn", v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bank_sn
|
||||
*/
|
||||
@JSONField(name = "bank_sn")
|
||||
public String getBankSn() {
|
||||
return getStr("bank_sn");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: bank_name
|
||||
* type: VARCHAR(128)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
*
|
||||
* @param v
|
||||
*/
|
||||
@JSONField(name = "bank_name")
|
||||
public void setBankName(String v) {
|
||||
set("bank_name", v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bank_name
|
||||
*/
|
||||
@JSONField(name = "bank_name")
|
||||
public String getBankName() {
|
||||
return getStr("bank_name");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* name: del
|
||||
* type: INT(10)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: 0
|
||||
*
|
||||
* @param del 逻辑删除标志
|
||||
*/
|
||||
@JSONField(name = "del")
|
||||
public void setDel(java.lang.Integer del) {
|
||||
set("del", del);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return del 逻辑删除标志
|
||||
*/
|
||||
@JSONField(name = "del")
|
||||
public java.lang.Integer getDel() {
|
||||
return getInt("del");
|
||||
}
|
||||
/**
|
||||
* name: pay_date
|
||||
* type: DATETIME(19)
|
||||
* isNullable: NO
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue: CURRENT_TIMESTAMP
|
||||
* @param createTime 付款时间
|
||||
*/
|
||||
@JSONField(name="pay_date")
|
||||
public void setPayDate(java.util.Date createTime) {
|
||||
set("pay_date", createTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return create_time 创建时间
|
||||
*/
|
||||
@JSONField(name="pay_date")
|
||||
public java.util.Date getPayDate() {
|
||||
return get("pay_date");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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: memo
|
||||
* type: VARCHAR(20)
|
||||
* isNullable: YES
|
||||
* isPrimaryKey: NO
|
||||
* defaultValue:
|
||||
* @param memo 单位
|
||||
*/
|
||||
@JSONField(name="memo")
|
||||
public void setMemo(String memo) {
|
||||
set("memo", memo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return memo 备注
|
||||
*/
|
||||
@JSONField(name="memo")
|
||||
public String getMemo() {
|
||||
return getStr("memo");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.cowr.ssjygl.supermarket.product;
|
||||
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: transport_company
|
||||
* Remarks: 物流公司
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class SupermarketProductLogPKValidator 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()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
package com.cowr.ssjygl.supermarket.product;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.model.SupermarketProductLog;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
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 Fri Apr 17 16:59:39 CST 2020
|
||||
* TableName: supermarket_product
|
||||
* Remarks: 基础配置 - 砂站关联 product 表
|
||||
* PrimaryKey: supermarket_id,product_id
|
||||
*/
|
||||
public class SupermarketProductLogService extends BaseService {
|
||||
|
||||
private static Log log = Log.getLog(SupermarketProductLogService.class);
|
||||
|
||||
|
||||
public static final SupermarketProductLogService me = new SupermarketProductLogService();
|
||||
|
||||
|
||||
public Page<Record> find(PageParam pp ,String name,String stm,String etm) {
|
||||
String selectsql = "SELECT\n" +
|
||||
" t.*,\n" +
|
||||
" s.`name` supermarket_name,\n" +
|
||||
" p.`name` product_name,\n" +
|
||||
" us.`name` create_name,\n" +
|
||||
" au.`name` auditor_name ";
|
||||
String fromsql = "FROM\n" +
|
||||
" `supermarket_product_log` t\n" +
|
||||
" LEFT JOIN supermarket s ON s.id = t.supermarket_id AND s.del = 0\n" +
|
||||
" LEFT JOIN product p ON t.product_id = p.id AND p.del = 0\n" +
|
||||
" LEFT JOIN sysuser us ON t.create_id = us.id AND us.del = 0\n" +
|
||||
" LEFT JOIN sysuser au ON t.auditor_id = au.id AND us.del = 0 " +
|
||||
" where t.del = 0 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
if (StrKit.notBlank(name)) {
|
||||
fromsql += " and us.`name` like ? \n";
|
||||
paraList.add("%" + name.trim() + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(stm)) {
|
||||
fromsql += " and t.create_time >= ? \n";
|
||||
paraList.add(stm);
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(etm)) {
|
||||
fromsql += " and t.create_time <= ? \n";
|
||||
paraList.add(etm);
|
||||
}
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && SupermarketProductLog.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{
|
||||
fromsql += " order by t.create_time desc \n";
|
||||
|
||||
}
|
||||
|
||||
return Db.paginateByFullSql(pp.getPage(), pp.getSize(), totalRowSql, findSql, paraList.toArray());
|
||||
}
|
||||
|
||||
public List<SupermarketProductLog> list() {
|
||||
return SupermarketProductLog.dao.find("select * from supermarket_product_log where t.del = 0 ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.cowr.ssjygl.supermarket.product;
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.SupermarketProductLog;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: transport_company
|
||||
* Remarks: 物流公司
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class SupermarketProductLogValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
// 默认新增时,前端不需要传主键。若需要前端传主键,需要去掉这个判断
|
||||
if (!"save".equals(getActionMethodName())) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
validateRequired("product_id", "product_id", "product_id 必填");
|
||||
validateInteger("product_id", 1, 2147483647, "product_id", "product_id 范围 1~2147483647");
|
||||
|
||||
validateRequired("supermarket_id", "supermarket_id", "supermarket_id 必填");
|
||||
validateInteger("supermarket_id", 1, 2147483647, "supermarket_id", "supermarket_id 范围 1~2147483647");
|
||||
|
||||
validateRequired("unit_price", "unit_price", "unit_price 必填");
|
||||
validateBigDecimal("unit_price", new java.math.BigDecimal(-9.9999999999E10), new java.math.BigDecimal(9.9999999999E10), "unit_price", "unit_price 范围 -9.9999999999E10~9.9999999999E10");
|
||||
|
||||
validateBigDecimal("old_price", new java.math.BigDecimal(-9.9999999999E10), new java.math.BigDecimal(9.9999999999E10), "old_price", "old_price 范围 -9.9999999999E10~9.9999999999E10");
|
||||
|
||||
|
||||
// 使用 model 更新时,model 不能只有主键有值
|
||||
// 这里用 getActionMethodName 写死,判断是 update 时,才做验证
|
||||
// 如果确实是需要将主键外的字段置为 null,可以在代码生成后删掉这段
|
||||
if ("edit".equals(getActionMethodName())) {
|
||||
validateUpdateModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
package com.cowr.ssjygl.supermarket.sandfarmdistance;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.model.Supermarket;
|
||||
import com.cowr.model.SupermarketSandfarmDistance;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: supermarket_sandfarm_distance
|
||||
* Remarks: 生产点到销售点的距离配置
|
||||
* <p>
|
||||
* PrimaryKey: supermarket_id,sandfarm_id
|
||||
*/
|
||||
public class SupermarketSandfarmDistanceService extends BaseService {
|
||||
public static final SupermarketSandfarmDistanceService me = new SupermarketSandfarmDistanceService();
|
||||
private static Log log = Log.getLog(SupermarketSandfarmDistanceService.class);
|
||||
|
||||
public BigDecimal getDistance(int supermarket_id, int sandfarm_id) {
|
||||
try {
|
||||
return Db.queryBigDecimal("select distance from supermarket_sandfarm_distance where supermarket_id = ? and sandfarm_id = ?", supermarket_id, sandfarm_id);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
public Page<Record> find(PageParam pp, Integer supermarket_id, Integer sandfarm_id) {
|
||||
String selectsql = "select t.*, s1.name supermarket_name, s2.name sandfarm_name ";
|
||||
String fromsql = "from supermarket_sandfarm_distance t \n" +
|
||||
" left join supermarket s1 on s1.id = t.supermarket_id AND s1.type = 0 \n" +
|
||||
" left join supermarket s2 on s2.id = t.sandfarm_id AND s2.type = 1" +
|
||||
" where 1=1 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
if (supermarket_id != null) {
|
||||
fromsql += " and t.supermarket_id = ? \n";
|
||||
paraList.add(supermarket_id);
|
||||
}
|
||||
|
||||
if (sandfarm_id != null) {
|
||||
fromsql += " and t.sandfarm_id = ? \n";
|
||||
paraList.add(sandfarm_id);
|
||||
}
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && SupermarketSandfarmDistance.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;
|
||||
}
|
||||
}
|
||||
|
||||
return Db.paginateByFullSql(pp.getPage(), pp.getSize(), totalRowSql, findSql, paraList.toArray());
|
||||
}
|
||||
|
||||
public List<SupermarketSandfarmDistance> list() {
|
||||
return SupermarketSandfarmDistance.dao.find("select * from supermarket_sandfarm_distance");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列出所砂站到取土场的距离
|
||||
*
|
||||
* @param pp
|
||||
* @param customer_id
|
||||
* @return
|
||||
*/
|
||||
public Record findAllSupermarket(PageParam pp, Integer customer_id, String customer_name) {
|
||||
List<Supermarket> cols = Supermarket.dao.find("select id, name, name2 from supermarket where del = 0 AND TYPE = 0 ");
|
||||
String selectsql = "select t.*, sr.supermarket_id, sr.distance ";
|
||||
String fromsql = " from supermarket t\n" +
|
||||
" left join (\n" +
|
||||
" select a.sandfarm_id, group_concat(a.supermarket_id) supermarket_id, group_concat(a.distance) distance " +
|
||||
" from supermarket_sandfarm_distance a\n" +
|
||||
" group by a.sandfarm_id\n" +
|
||||
" ) sr on sr.sandfarm_id = t.id \n" +
|
||||
" where 1=1 AND t.TYPE = 1 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
if (customer_id != null) {
|
||||
fromsql += " and t.id = ? \n";
|
||||
paraList.add(customer_id);
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(customer_name)) {
|
||||
fromsql += " and t.name like ? \n";
|
||||
paraList.add("%" + customer_name.trim() + "%");
|
||||
}
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
findSql += " order by t.id ";
|
||||
|
||||
Page<Record> page = Db.paginateByFullSql(pp.getPage(), pp.getSize(), totalRowSql, findSql, paraList.toArray());
|
||||
List<Record> list = page.getList();
|
||||
|
||||
for (Record record : list) {
|
||||
if (record.get("supermarket_id") != null) {
|
||||
String supermarket_arr = record.getStr("supermarket_id");
|
||||
String distance_arr = record.getStr("distance");
|
||||
|
||||
String[] sups = supermarket_arr.split(",");
|
||||
String[] diss = distance_arr.split(",");
|
||||
|
||||
if (sups.length != diss.length) {
|
||||
log.error("findAllSupermarket 数据错误");
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < sups.length; i++) {
|
||||
String id = sups[i];
|
||||
record.set("supermarket_id_" + id, diss[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Record out = new Record();
|
||||
out.set("cols", cols);
|
||||
out.set("page", page);
|
||||
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.cowr.ssjygl.transpricelog;
|
||||
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: transport_company
|
||||
* Remarks: 物流公司
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class TransPriceLogPKValidator 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()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package com.cowr.ssjygl.transpricelog;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.model.TransPriceLog;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
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 Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: trans_price_log
|
||||
* Remarks: 物流公司
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class TransPriceLogService extends BaseService {
|
||||
public static final TransPriceLogService me = new TransPriceLogService();
|
||||
private static Log log = Log.getLog(TransPriceLogService.class);
|
||||
|
||||
|
||||
public Page<Record> find(PageParam pp, String name, Integer del, String stm, String etm) {
|
||||
String selectsql = "select t.*";
|
||||
String fromsql = "from trans_price_log t " +
|
||||
" where 1=1 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
if (del != null && (del == Const.LOGIC_DEL_VALID || del == Const.LOGIC_DEL_INVALID)) {
|
||||
fromsql += " and t.del = ? \n";
|
||||
paraList.add(del);
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(name)) {
|
||||
fromsql += " and (t.trans_co_name like ? \n";
|
||||
paraList.add("%" + name.trim() + "%");
|
||||
fromsql += " or t.truck_license like ?) \n";
|
||||
paraList.add("%" + name.trim() + "%");
|
||||
}
|
||||
|
||||
|
||||
if (StrKit.notBlank(stm)) {
|
||||
fromsql += " and t.pay_date >= ?";
|
||||
paraList.add(stm);
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(etm)) {
|
||||
fromsql += " and t.pay_date <= ?";
|
||||
paraList.add(etm);
|
||||
}
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && TransPriceLog.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());
|
||||
}
|
||||
|
||||
public List<TransPriceLog> list() {
|
||||
return TransPriceLog.dao.find("select * from trans_price_log t where t.del = 0");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
package com.cowr.ssjygl.transpricelog;
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.TransportCompany;
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.kit.StrKit;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: trans_price_log
|
||||
* Remarks: 运费结算记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class TransPriceLogValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
// 默认新增时,前端不需要传主键。若需要前端传主键,需要去掉这个判断
|
||||
if (!"save".equals(getActionMethodName())) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
|
||||
if (StrKit.notBlank(c.get("trans_co_name"))) { // 可为空字段,当传入值时,才做验证
|
||||
validateString("trans_co_name", 1, 128, "trans_co_name", "trans_co_name 长度 1~128");
|
||||
validateRequired("trans_name", "trans_name", "trans_name 必填");
|
||||
|
||||
validateString("trans_name", 0, 15, "trans_name", "trans_name 长度 0~15");
|
||||
validateRequired("trans_phone", "trans_phone", "trans_phone 必填");
|
||||
validateString("trans_phone", 0, 20, "trans_phone", "trans_phone 长度 0~20");
|
||||
}
|
||||
if (StrKit.notBlank(c.get("truck_license"))) { // 可为空字段,当传入值时,才做验证
|
||||
validateString("truck_license", 1, 10, "truck_license", "truck_license 长度 1~10");
|
||||
}
|
||||
|
||||
|
||||
validateRequired("trans_price", "trans_price", "trans_price 必填");
|
||||
validateBigDecimal("trans_price", new java.math.BigDecimal(0.01), new java.math.BigDecimal(2147483647.99), "trans_price", "trans_price 长度 -9.9999999999E10~9.9999999999E10");
|
||||
validateRequired("settlement_dates", "settlement_dates", "settlement_dates 必填");
|
||||
validateString("settlement_dates", 0, 256, "settlement_dates", "settlement_dates 长度 0~256");
|
||||
validateRequired("pay_date", "pay_date", "pay_date 必填");
|
||||
validateDate("pay_date", "yyyy-MM-dd HH:mm:ss", "pay_date", "pay_date 格式错误");
|
||||
|
||||
validateRequired("bank_name", "bank_name", "bank_name 必填");
|
||||
validateString("bank_name", 0, 128, "bank_name", "bank_name 长度 0~128");
|
||||
validateString("memo", 0, 256, "memo", "memo 长度 0~256");
|
||||
|
||||
// 使用 model 更新时,model 不能只有主键有值
|
||||
// 这里用 getActionMethodName 写死,判断是 update 时,才做验证
|
||||
// 如果确实是需要将主键外的字段置为 null,可以在代码生成后删掉这段
|
||||
if ("edit".equals(getActionMethodName())) {
|
||||
validateUpdateModel(TransportCompany.class, "", true); // 忽略不在model中的字段
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# mysql
|
||||
#jdbcUrl=jdbc:mysql://rm-wz9wa070076b2uge2ro.mysql.rds.aliyuncs.com:3306/ssjy_xsct_service_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
#user=dev_ssjy_xsct
|
||||
#password=Ssjy_xs_890
|
||||
|
||||
jdbcUrl=jdbc:mysql://127.0.0.1:3306/ssjy_xsct_service_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
user=root
|
||||
password=19999999
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
git pull
|
||||
mvn clean package
|
||||
./target/ssjygl-xsct-local-release/ssjygl-xsct-local/start.sh
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
./target/ssjygl-xsct-local-release/ssjygl-xsct-local/start.sh
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
//package com.cowr.local.ssjygl.hbrsms;
|
||||
//
|
||||
///**
|
||||
// * Description:
|
||||
// * Created by XuSan on 2024/12/6.
|
||||
// *
|
||||
// * @author XuSan
|
||||
// * @version 1.0
|
||||
// */
|
||||
//
|
||||
//import com.alibaba.fastjson.annotation.JSONField;
|
||||
//import com.cowr.common.base.BaseModel;
|
||||
//import com.jfinal.plugin.activerecord.IBean;
|
||||
//
|
||||
//import java.util.Date;
|
||||
//
|
||||
//public abstract class BaseHbrsmsLog<M extends BaseHbrsmsLog<M>> extends BaseModel<M> implements IBean {
|
||||
//
|
||||
//
|
||||
// public static final String tablename = "hbrsms_log";
|
||||
//
|
||||
// @JSONField(serialize = false)
|
||||
// public String getTablename() {
|
||||
// return tablename;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * name: sn
|
||||
// * isNullable: NO
|
||||
// * isPrimaryKey: YES
|
||||
// * defaultValue:
|
||||
// *
|
||||
// * @param sn sn
|
||||
// */
|
||||
// @JSONField(name = "sn")
|
||||
// public void setSn(String sn) {
|
||||
// set("sn", sn);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @return id
|
||||
// */
|
||||
// @JSONField(name = "sn")
|
||||
// public String getSn() {
|
||||
// return getStr("sn");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @JSONField(name = "createdate")
|
||||
// public void setCreatedate(Date createdate) {
|
||||
// set("createdate", createdate);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @return id
|
||||
// */
|
||||
// @JSONField(name = "createdate")
|
||||
// public Date getCreatedate() {
|
||||
// return get("createdate");
|
||||
// }
|
||||
//
|
||||
// @JSONField(name = "reqData")
|
||||
// public void setReqData(String reqData) {
|
||||
// set("reqData", reqData);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @return id
|
||||
// */
|
||||
// @JSONField(name = "reqData")
|
||||
// public String getReqData() {
|
||||
// return getStr("reqData");
|
||||
// }
|
||||
//
|
||||
// @JSONField(name = "respData")
|
||||
// public void setRespData(String respData) {
|
||||
// set("respData", respData);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @return id
|
||||
// */
|
||||
// @JSONField(name = "respData")
|
||||
// public String getrespData() {
|
||||
// return getStr("respData");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @JSONField(name = "status")
|
||||
// public void setStatus(String status) {
|
||||
// set("status", status);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @return id
|
||||
// */
|
||||
// @JSONField(name = "status")
|
||||
// public String getStatus() {
|
||||
// return getStr("status");
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
package com.cowr.local.ssjygl.hbrsms;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/10/10.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
public class Hbrsms {
|
||||
|
||||
// 产品类型 1-砂石,2-卵石
|
||||
private Integer category;
|
||||
|
||||
// 开单员姓名,需要和系统一致
|
||||
private String billerName;
|
||||
|
||||
// 开单地点
|
||||
private String billAddress;
|
||||
|
||||
// 车牌号码
|
||||
private String plateNumber;
|
||||
|
||||
// 实际载运吨
|
||||
private BigDecimal actualLoad;
|
||||
|
||||
// 采区名称,需要和系统一致
|
||||
private String miningAreaName;
|
||||
|
||||
// 装运砂起始时间,格式 yyyy-MM-dd HH:mm:ss
|
||||
private String transportStartTime;
|
||||
|
||||
// 装运砂结束时间,格式 yyyy-MM-dd HH:mm:ss
|
||||
private String transportEndTime;
|
||||
|
||||
// 收货单位
|
||||
private String intendedArrivalHarbour;
|
||||
|
||||
// 图片 Base64 数组,至少三张,最多九张
|
||||
private List<String> documents;
|
||||
|
||||
|
||||
public Integer getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(Integer category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getBillerName() {
|
||||
return billerName;
|
||||
}
|
||||
|
||||
public void setBillerName(String billerName) {
|
||||
this.billerName = billerName;
|
||||
}
|
||||
|
||||
public String getBillAddress() {
|
||||
return billAddress;
|
||||
}
|
||||
|
||||
public void setBillAddress(String billAddress) {
|
||||
this.billAddress = billAddress;
|
||||
}
|
||||
|
||||
public String getPlateNumber() {
|
||||
return plateNumber;
|
||||
}
|
||||
|
||||
public void setPlateNumber(String plateNumber) {
|
||||
this.plateNumber = plateNumber;
|
||||
}
|
||||
|
||||
public BigDecimal getActualLoad() {
|
||||
return actualLoad;
|
||||
}
|
||||
|
||||
public void setActualLoad(BigDecimal actualLoad) {
|
||||
this.actualLoad = actualLoad;
|
||||
}
|
||||
|
||||
public String getMiningAreaName() {
|
||||
return miningAreaName;
|
||||
}
|
||||
|
||||
public void setMiningAreaName(String miningAreaName) {
|
||||
this.miningAreaName = miningAreaName;
|
||||
}
|
||||
|
||||
public String getTransportStartTime() {
|
||||
return transportStartTime;
|
||||
}
|
||||
|
||||
public void setTransportStartTime(String transportStartTime) {
|
||||
this.transportStartTime = transportStartTime;
|
||||
}
|
||||
|
||||
public String getTransportEndTime() {
|
||||
return transportEndTime;
|
||||
}
|
||||
|
||||
public void setTransportEndTime(String transportEndTime) {
|
||||
this.transportEndTime = transportEndTime;
|
||||
}
|
||||
|
||||
public String getIntendedArrivalHarbour() {
|
||||
return intendedArrivalHarbour;
|
||||
}
|
||||
|
||||
public void setIntendedArrivalHarbour(String intendedArrivalHarbour) {
|
||||
this.intendedArrivalHarbour = intendedArrivalHarbour;
|
||||
}
|
||||
|
||||
public List<String> getDocuments() {
|
||||
return documents;
|
||||
}
|
||||
|
||||
public void setDocuments(List<String> documents) {
|
||||
this.documents = documents;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.cowr.local.ssjygl.hbrsms;
|
||||
|
||||
import com.jfinal.log.Log;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
public class HbrsmsJob implements Job {
|
||||
private static Log log = Log.getLog(HbrsmsJob.class);
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) {
|
||||
try {
|
||||
HbrsmsService.me.syncTask(); //定时任务
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
//package com.cowr.local.ssjygl.hbrsms;
|
||||
//
|
||||
//import com.cowr.model.base.BaseHbrsmsLog;
|
||||
//
|
||||
///**
|
||||
// * Description:
|
||||
// * Created by XuSan on 2024/10/10.
|
||||
// *
|
||||
// * @author XuSan
|
||||
// * @version 1.0
|
||||
// */
|
||||
//public class HbrsmsLog extends BaseHbrsmsLog<HbrsmsLog> {
|
||||
//
|
||||
// public static final HbrsmsLog dao = new HbrsmsLog().dao();
|
||||
//
|
||||
//}
|
||||
|
|
@ -1,246 +0,0 @@
|
|||
package com.cowr.local.ssjygl.hbrsms;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.utils.DateTimeUtil;
|
||||
import com.cowr.local.ssjygl.main.Config;
|
||||
import com.cowr.model.HbrsmsLog;
|
||||
import com.cowr.model.OrderTemp;
|
||||
import com.cowr.model.Transport;
|
||||
import com.jfinal.kit.HttpKit;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
import com.jfinal.plugin.redis.Redis;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/10/10.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
public class HbrsmsService {
|
||||
private static Log log = Log.getLog(HbrsmsService.class);
|
||||
public static final HbrsmsService me = new HbrsmsService();
|
||||
private static final String URL = "https://hbrsms.cn:10002/rsms/api/mining-transport-orders/auto";
|
||||
|
||||
public String redisbasekey() {
|
||||
return Config.dbprop.get("redis.basekey") + Const.REDIS_SEPARATE + "hbrsms" + Const.REDIS_SEPARATE;
|
||||
}
|
||||
|
||||
public String rediskey(Object key) {
|
||||
return redisbasekey() + key;
|
||||
}
|
||||
|
||||
|
||||
public void put(OrderTemp order, Transport transport) {
|
||||
|
||||
Hbrsms hbrsms = new Hbrsms();
|
||||
hbrsms.setCategory(0); //0-砂石,1-卵石,2 - 土
|
||||
String billerName = Config.configprop.get("hbrsms.billerName");
|
||||
log.info("开单员:" + billerName);
|
||||
hbrsms.setBillerName(billerName);
|
||||
String billAddress = Config.configprop.get("hbrsms.billAddress");
|
||||
log.info("采区地址:" + billAddress);
|
||||
hbrsms.setBillAddress(billAddress);
|
||||
hbrsms.setPlateNumber(order.getTruckLicense());
|
||||
hbrsms.setActualLoad(order.getWeight());
|
||||
hbrsms.setMiningAreaName(billAddress);
|
||||
hbrsms.setTransportStartTime(DateTimeUtil.convertDateToString(transport.getInTime(), DateTimeUtil.ymdhms));
|
||||
hbrsms.setTransportEndTime(DateTimeUtil.convertDateToString(transport.getOutTime(), DateTimeUtil.ymdhms));
|
||||
hbrsms.setIntendedArrivalHarbour(order.getCustomerTexpayerName());
|
||||
|
||||
log.info("请求参数:" + JSON.toJSONString(hbrsms));
|
||||
|
||||
List<String> imgs = Lists.newArrayList();
|
||||
String firstPic = transport.getFirstPic();
|
||||
String pathname = "/home/a/ssjy_xsct/ssjygl-xsct-local/" + firstPic;
|
||||
String firstPicBase64 = getBase64(new File(pathname));
|
||||
imgs.add(firstPicBase64);
|
||||
// imgs.add(firstPicBase64);
|
||||
String secondPic = transport.getSecondPic();
|
||||
String pathname1 = "/home/a/ssjy_xsct/ssjygl-xsct-local/" + secondPic;
|
||||
String secondPicBase64 = getBase64(new File(pathname1));
|
||||
imgs.add(secondPicBase64);
|
||||
// imgs.add(secondPicBase64);
|
||||
hbrsms.setDocuments(imgs);
|
||||
|
||||
HashMap<String, String> header = new HashMap<>();
|
||||
header.put("Content-Type", "application/json");
|
||||
|
||||
String post = null;
|
||||
try {
|
||||
post = HttpKit.post(URL, JSON.toJSONString(hbrsms), header);
|
||||
|
||||
/*
|
||||
*
|
||||
{
|
||||
"result" : {
|
||||
"status" : "OK",
|
||||
"message" : "单据上传成功"
|
||||
},
|
||||
"status" : 200,
|
||||
"message" : null
|
||||
}
|
||||
* */
|
||||
log.info("响应数据: %s", post);
|
||||
Redis.use().setex("hbrsms:sync:" + order.getSn(), 60 * 60 * 24, post);
|
||||
} catch (Exception e) {
|
||||
log.error("响应错误: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
String status = "NG";
|
||||
if (StrKit.notBlank(post)) {
|
||||
try {
|
||||
status = JSONObject.parseObject(post).getJSONObject("result").getString("status");
|
||||
} catch (Exception e) {
|
||||
log.error("响应错误: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
HbrsmsLog hbrsmsLog = new HbrsmsLog();
|
||||
|
||||
imgs = Lists.newArrayList();
|
||||
imgs.add(pathname);
|
||||
imgs.add(pathname1);
|
||||
hbrsms.setDocuments(imgs);
|
||||
hbrsmsLog.setReqData(JSON.toJSONString(hbrsms));
|
||||
hbrsmsLog.setRespData(post);
|
||||
hbrsmsLog.setSn(order.getSn());
|
||||
hbrsmsLog.setCreatedate(new Date());
|
||||
hbrsmsLog.setStatus(status);
|
||||
boolean save = hbrsmsLog.save();
|
||||
if (!save) {
|
||||
log.error("响应日志保存失败");
|
||||
Redis.use().set("hbrsms:saveError:" + order.getSn(), hbrsmsLog);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 阿里OSS图片文件转成Base64编码
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
private static String getBase64(File file) {
|
||||
if (file == null || file.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
int bytesRead; // 存储读取的字节数
|
||||
byte[] buffer = new byte[1024]; // 设置缓冲区,大小可以根据需要调整
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
try (InputStream inputStream = Files.newInputStream(file.toPath())) {
|
||||
|
||||
// 读取数据
|
||||
try {
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) { // 读取字节
|
||||
byteArrayOutputStream.write(buffer, 0, bytesRead); // 写入 ByteArrayOutputStream
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(); // 处理读取异常
|
||||
}
|
||||
|
||||
return Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray());
|
||||
} catch (IOException e) {
|
||||
// 记录日志或抛出自定义异常
|
||||
log.error("Error reading object content: " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void syncTask() {
|
||||
|
||||
if (!isNetworkAvailable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<HbrsmsLog> hbrsmsLogs = HbrsmsLog
|
||||
.dao
|
||||
.find("SELECT * FROM hbrsms_log WHERE STATUS != 'OK';");
|
||||
for (HbrsmsLog o : hbrsmsLogs) {
|
||||
|
||||
Hbrsms hbrsms = JSONObject.parseObject(o.getReqData()).toJavaObject(Hbrsms.class);
|
||||
List<String> documents = hbrsms.getDocuments();
|
||||
for (int i = 0; i < documents.size(); i++) {
|
||||
String pathname = documents.get(i);
|
||||
documents.add(i,getBase64(new File(pathname)));
|
||||
}
|
||||
|
||||
hbrsms.setDocuments(documents);
|
||||
|
||||
HashMap<String, String> header = new HashMap<>();
|
||||
header.put("Content-Type", "application/json");
|
||||
|
||||
String post = null;
|
||||
try {
|
||||
post = HttpKit.post(URL, JSON.toJSONString(hbrsms), header);
|
||||
|
||||
/*
|
||||
*
|
||||
{
|
||||
"result" : {
|
||||
"status" : "OK",
|
||||
"message" : "单据上传成功"
|
||||
},
|
||||
"status" : 200,
|
||||
"message" : null
|
||||
}
|
||||
* */
|
||||
log.info("响应数据: %s", post);
|
||||
Redis.use().setex("hbrsms:sync:" + o.getSn(), 60 * 60 * 24, post);
|
||||
} catch (Exception e) {
|
||||
log.error("响应错误: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
String status = "NG";
|
||||
if (StrKit.notBlank(post)) {
|
||||
try {
|
||||
status = JSONObject.parseObject(post).getJSONObject("result").getString("status");
|
||||
} catch (Exception e) {
|
||||
log.error("响应错误: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
if ("OK".equals(status)){
|
||||
o.setStatus(status);
|
||||
boolean update = o.update();
|
||||
if (!update) {
|
||||
log.error("响应日志保存失败");
|
||||
Redis.use().set("hbrsms:saveError:" + o.getSn(), o);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isNetworkAvailable() {
|
||||
try {
|
||||
URL url = new URL("http://www.baidu.com");
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
connection.setConnectTimeout(1500); // 设置连接超时时间
|
||||
connection.setReadTimeout(1500); // 设置读取超时时间
|
||||
return (connection.getResponseCode() == HttpURLConnection.HTTP_OK);
|
||||
} catch (Exception e) {
|
||||
System.out.println("网络连接失败");
|
||||
log.error("网络连接失败," + e.getMessage(),e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
## mysql
|
||||
## GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.119' IDENTIFIED BY 'Local_1' WITH GRANT OPTION;
|
||||
#jdbcUrl=jdbc:mysql://127.0.0.1:3306/ssjy_xsct_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
#user=root
|
||||
#password=19999999
|
||||
|
||||
jdbcUrl=jdbc:mysql://192.168.66.83:3306/ssjy_xsct?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
user=root
|
||||
password=Ssjy_xsx_890
|
||||
|
||||
# redis
|
||||
#redis.basekey=ssjcgl_xsct_dev
|
||||
redis.basekey=ssjcgl_xsct
|
||||
redis.port=6379
|
||||
|
||||
#redis.ip=127.0.0.1
|
||||
#redis.pwd=
|
||||
#redis.db=13
|
||||
|
||||
redis.ip=r-wz9168ab2f2f7ec4pd.redis.rds.aliyuncs.com
|
||||
redis.pwd=CoWR1111
|
||||
redis.db=13
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# mysql
|
||||
jdbcUrl=jdbc:mysql://localhost:3306/ssjy_xsct?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
user=root
|
||||
#password=Ssjy_xsct_890
|
||||
password=Ssjy_xsx_890
|
||||
|
||||
# redis
|
||||
redis.basekey=ssjcgl_xsct
|
||||
redis.ip=localhost
|
||||
redis.port=6379
|
||||
redis.pwd=
|
||||
redis.db=
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
git pull
|
||||
mvn clean package
|
||||
./target/ssjygl-xsct-service-release/ssjygl-xsct-service/start.sh
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
./target/ssjygl-xsct-service-release/ssjygl-xsct-service/start.sh
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
package com.cowr.service.ssjygl.Interceptor;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/8/23
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
import com.alibaba.druid.filter.FilterChain;
|
||||
import com.alibaba.druid.filter.FilterEventAdapter;
|
||||
import com.alibaba.druid.proxy.jdbc.ConnectionProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.JdbcParameter;
|
||||
import com.alibaba.druid.proxy.jdbc.PreparedStatementProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.StatementProxy;
|
||||
import com.cowr.common.utils.DataUtil;
|
||||
import com.cowr.common.utils.DateTimeUtil;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class UpdateOnlyListener extends FilterEventAdapter {
|
||||
|
||||
private static Log log = Log.getLog(UpdateOnlyListener.class);
|
||||
|
||||
private static ArrayList<String> tableName = Lists.newArrayList();
|
||||
|
||||
static {
|
||||
tableName.add("order_temp");
|
||||
tableName.add("prepay_customer");
|
||||
tableName.add("order_end");
|
||||
// tableName.add("sync_task");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int preparedStatement_executeUpdate(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
|
||||
String sql = statement.getSql();
|
||||
if(checkSql(sql)){
|
||||
List<String> param = Lists.newArrayList();
|
||||
if(statement.getParametersSize() > 0){
|
||||
for(int i = 0; i < statement.getParametersSize();i++){
|
||||
JdbcParameter jdbcParameter = statement.getParameters().get(i);
|
||||
|
||||
Object value = jdbcParameter.getValue();
|
||||
if (value instanceof Date){
|
||||
value = DateTimeUtil.sdfhms.get().format(value);
|
||||
}
|
||||
param.add(value + "");
|
||||
}
|
||||
// sql = sql + param;
|
||||
}
|
||||
saveSqlLog(statement.getConnectionProxy(),sql,param);
|
||||
}
|
||||
return chain.preparedStatement_executeUpdate(statement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] statement_executeBatch(FilterChain chain, StatementProxy statement) throws SQLException {
|
||||
String sql = statement.getBatchSql();
|
||||
if(checkSql(sql)){
|
||||
List<String> param = Lists.newArrayList();
|
||||
if(statement.getParametersSize() > 0){
|
||||
for(int i = 0; i < statement.getParametersSize();i++){
|
||||
JdbcParameter jdbcParameter = statement.getParameters().get(i);
|
||||
Object value = jdbcParameter.getValue();
|
||||
if (value instanceof Date){
|
||||
value = DateTimeUtil.sdfhms.get().format(value);
|
||||
}
|
||||
param.add(value+ "");
|
||||
}
|
||||
// sql = sql + param;
|
||||
}
|
||||
saveSqlLog(statement.getConnectionProxy(),sql,param);
|
||||
}
|
||||
return chain.statement_executeBatch(statement);
|
||||
}
|
||||
|
||||
|
||||
private Boolean checkSql(String sql){
|
||||
for (String tablename : tableName) {
|
||||
if (sql.contains(tablename)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void saveSqlLog(ConnectionProxy connection, String sql, List<String> param ) {
|
||||
// 这里可以实现你的监控逻辑,例如打印或记录日志
|
||||
// log.info("druid监听到sql:" + sql + " ,参数: " + param);
|
||||
String sqlData = sql.replaceAll("\\?", "%s");
|
||||
String format = DataUtil.formatWithVarargs(sqlData, param.toArray());
|
||||
log.info("druid监听到sql:" + format);
|
||||
String insertSql = "INSERT INTO sql_log (id, sql_content) VALUES (?, ?)";
|
||||
PreparedStatement pstmt = null;
|
||||
try {
|
||||
|
||||
pstmt = connection.prepareStatement(insertSql);
|
||||
pstmt.setString(1, StrKit.getRandomUUID());
|
||||
pstmt.setString(2, format);
|
||||
// pstmt.addBatch();
|
||||
int i = pstmt.executeUpdate();
|
||||
if (i != 1){
|
||||
log.error("sql_log 插入失败");
|
||||
log.error("sql_log: " + format);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 异常处理
|
||||
// log.error(convException(e));
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String convException(Exception e) {
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
StringBuffer buffer = sw.getBuffer();
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
package com.cowr.service.ssjygl.customer.contractsigned;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.CustomerContractSigned;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.customer.contracttemplate.CustomerContractTemplatePKValidator;
|
||||
import com.cowr.service.ssjygl.main.AuthInterceptor;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.aop.Clear;
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.upload.UploadFile;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Nov 17 15:39:50 CST 2021
|
||||
* TableName: customer_contract_signed_
|
||||
* Remarks:
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerContractSignedController extends Controller {
|
||||
|
||||
/**
|
||||
* 新增 customer_contract_signed
|
||||
*/
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void save(){
|
||||
|
||||
UploadFile uploadFile = this.getFile();
|
||||
if (uploadFile == null || !uploadFile.getFile().isFile()) {
|
||||
renderJson(Result.failed("文件不能为空"));
|
||||
return;
|
||||
}
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
CustomerContractSigned model = getModel(CustomerContractSigned.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(CustomerContractSignedService.me.save(model, tokenuser,uploadFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 customer_contract_signed
|
||||
*/
|
||||
@Before(CustomerContractSignedValidator.class)
|
||||
public void edit(){
|
||||
UploadFile uploadFile = this.getFile();
|
||||
|
||||
try {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
CustomerContractSigned model = getModel(CustomerContractSigned.class, "", true); // 忽略不在model中的字段
|
||||
|
||||
renderJson(CustomerContractSignedService.me.update(model, tokenuser,uploadFile));
|
||||
}catch (Exception e){
|
||||
renderJson(Result.failed("修改出错"));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 删除 customer_contract_template
|
||||
*/
|
||||
@Before(CustomerContractTemplatePKValidator.class)
|
||||
public void del(){
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
CustomerContractSigned model = getModel(CustomerContractSigned.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(CustomerContractSignedService.me.delete(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 customer_contract_signed_
|
||||
*/
|
||||
public void find(){
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
String name = get("name");
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
|
||||
renderJson(Result.object(CustomerContractSignedService.me.find(pp, name, stm, etm)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 customer_contract_signed_
|
||||
*/
|
||||
@Before(CustomerContractSignedPKValidator.class)
|
||||
public void get(){
|
||||
CustomerContractSigned model = getModel(CustomerContractSigned.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(CustomerContractSignedService.me.get(model));
|
||||
}
|
||||
/**
|
||||
* 按user_id查找单个对象 customer_contract_signed_
|
||||
* 判断用户是否签订合同
|
||||
*/
|
||||
@Before(CustomerContractSignedPKValidator.class)
|
||||
public void getByUserId(){
|
||||
CustomerContractSigned model = getModel(CustomerContractSigned.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(CustomerContractSignedService.me.getByUserId(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回所有 customer_contract_signed_
|
||||
*/
|
||||
public void list(){
|
||||
renderJson(Result.object(CustomerContractSignedService.me.list()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.cowr.service.ssjygl.customer.contractsigned;
|
||||
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Nov 17 15:39:50 CST 2021
|
||||
* TableName: customer_contract_signed_
|
||||
* Remarks:
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerContractSignedPKValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
validateLong("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
package com.cowr.service.ssjygl.customer.contractsigned;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.common.base.BaseService;
|
||||
import com.cowr.common.enums.Enums;
|
||||
import com.cowr.common.oss.OSSKit;
|
||||
import com.cowr.common.utils.DateTimeUtil;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.CustomerContractSigned;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.customer.contracttemplate.Word2HtmlStr;
|
||||
import com.cowr.ssjygl.modifylog.ModifyLogService;
|
||||
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 com.jfinal.upload.UploadFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Nov 17 15:39:50 CST 2021
|
||||
* TableName: customer_contract_signed
|
||||
* Remarks:
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerContractSignedService extends BaseService {
|
||||
private static final Log log = Log.getLog(CustomerContractSignedService.class);
|
||||
public static final CustomerContractSignedService me = new CustomerContractSignedService();
|
||||
|
||||
public Page<Record> find(PageParam pp, String name, String stm, String etm) {
|
||||
String selectsql = "select t.* ";
|
||||
String fromsql = "from customer_contract_signed t where 1=1 ";
|
||||
List<Object> paraList = new ArrayList<>();
|
||||
|
||||
if (StrKit.notBlank(name)) {
|
||||
fromsql += " and t.name like ? \n";
|
||||
paraList.add("%" + name.trim() + "%");
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(stm)) {
|
||||
fromsql += " and t.create_time >= ? \n";
|
||||
paraList.add(stm);
|
||||
}
|
||||
|
||||
if (StrKit.notBlank(etm)) {
|
||||
fromsql += " and t.create_time <= ? \n";
|
||||
paraList.add(etm);
|
||||
}
|
||||
|
||||
String totalRowSql = "select count(*) " + fromsql;
|
||||
String findSql = selectsql + fromsql;
|
||||
|
||||
// 前端传了排序字段,并且排序字段存在相关表中
|
||||
if (StrKit.notBlank(pp.getSort_field()) && CustomerContractSigned.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());
|
||||
}
|
||||
|
||||
public List<CustomerContractSigned> list() {
|
||||
return CustomerContractSigned.dao.find("select * from customer_contract_signed");
|
||||
}
|
||||
|
||||
public Result save(CustomerContractSigned model, Sysuser sysuser, UploadFile uploadFile) {
|
||||
|
||||
model.setCreateId(sysuser.getId());
|
||||
model.setCreateName(sysuser.getName());
|
||||
model.setCreateTime(new Date());
|
||||
|
||||
Record r = new Record();
|
||||
File file = uploadFile.getFile();
|
||||
String htmlStr = Word2HtmlStr.conver(file);
|
||||
String fileName = "";
|
||||
if (htmlStr == null) {
|
||||
return Result.failed(fileName + "转html字符串失败");
|
||||
}
|
||||
model.setHtmlstr(htmlStr);
|
||||
|
||||
String key = "attachment/" + DateTimeUtil.yMd.get().format(new Date()) + "/" + StrKit.getRandomUUID();
|
||||
fileName = file.getName();
|
||||
String suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
|
||||
|
||||
try {
|
||||
OSSKit.putObject("ssjygl-xsct-statics", key + suffix, file);
|
||||
|
||||
r.set("fileName", fileName);
|
||||
r.set("ossKey", key + suffix);
|
||||
model.setAttachment(r.toJson());
|
||||
|
||||
boolean ret = Db.tx(new IAtom() {
|
||||
@Override
|
||||
public boolean run() {
|
||||
try {
|
||||
boolean ret = model.save();
|
||||
|
||||
if (ret) {
|
||||
ret = ModifyLogService.me.save(model, null, Enums.DataOpType.SAVE.getId(), sysuser);
|
||||
}
|
||||
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return ret ? Result.object(model) : Result.failed(false, "新增失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
if (e.getMessage().contains("PRIMARY")) {
|
||||
return Result.failed(false, "主键冲突");
|
||||
} else {
|
||||
return Result.failed(false, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Result update(CustomerContractSigned model, Sysuser sysuser, UploadFile uploadFile) {
|
||||
|
||||
model.setCreateId(sysuser.getId());
|
||||
model.setCreateName(sysuser.getName());
|
||||
|
||||
Record r = new Record();
|
||||
File file = uploadFile.getFile();
|
||||
String htmlStr = Word2HtmlStr.conver(file);
|
||||
String fileName = "";
|
||||
if (htmlStr == null) {
|
||||
return Result.failed(fileName + "转html字符串失败");
|
||||
}
|
||||
model.setHtmlstr(htmlStr);
|
||||
|
||||
String key = "attachment/" + DateTimeUtil.yMd.get().format(new Date()) + "/" + StrKit.getRandomUUID();
|
||||
fileName = file.getName();
|
||||
String suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
|
||||
|
||||
try {
|
||||
OSSKit.putObject("ssjygl-xsct-statics", key + suffix, file);
|
||||
|
||||
r.set("fileName", fileName);
|
||||
r.set("ossKey", key + suffix);
|
||||
model.setAttachment(r.toJson());
|
||||
|
||||
boolean ret = Db.tx(new IAtom() {
|
||||
@Override
|
||||
public boolean run() {
|
||||
try {
|
||||
boolean ret = model.update();
|
||||
|
||||
if (ret) {
|
||||
ret = ModifyLogService.me.save(model, null, Enums.DataOpType.SAVE.getId(), sysuser);
|
||||
}
|
||||
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return ret ? Result.object(model) : Result.failed(false, "修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
if (e.getMessage().contains("PRIMARY")) {
|
||||
return Result.failed(false, "主键冲突");
|
||||
} else {
|
||||
return Result.failed(false, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Result get(CustomerContractSigned model) {
|
||||
|
||||
Record ret = new Record();
|
||||
return Result.object(model);
|
||||
}
|
||||
|
||||
public Result getByUserId(CustomerContractSigned model) {
|
||||
CustomerContractSigned Signed = CustomerContractSigned.dao.findFirst("select * from customer_contract_signed where create_id = ?", model.getCreateId());
|
||||
if (Signed == null) {
|
||||
return Result.failed(false, "");
|
||||
}
|
||||
Record ret = Signed.toRecord();
|
||||
return Result.object(ret);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.cowr.service.ssjygl.customer.contractsigned;
|
||||
|
||||
import com.cowr.common.validator.CrudParamValidator;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.CustomerContractSigned;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
/**
|
||||
* Generated by COWR Wed Nov 17 15:39:50 CST 2021
|
||||
* TableName: customer_contract_signed_
|
||||
* Remarks:
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class CustomerContractSignedValidator extends CrudParamValidator {
|
||||
@Override
|
||||
protected void validate(Controller c) {
|
||||
// 默认新增时,前端不需要传主键。若需要前端传主键,需要去掉这个判断
|
||||
if (!"save".equals(getActionMethodName())) {
|
||||
validateRequired("id", "id", "id 必填");
|
||||
|
||||
validateLong("id", 1, 2147483647, "id", "id 范围 1~2147483647");
|
||||
}
|
||||
|
||||
|
||||
// 使用 model 更新时,model 不能只有主键有值
|
||||
// 这里用 getActionMethodName 写死,判断是 update 时,才做验证
|
||||
// 如果确实是需要将主键外的字段置为 null,可以在代码生成后删掉这段
|
||||
if ("edit".equals(getActionMethodName())) {
|
||||
validateUpdateModel(CustomerContractSigned.class, "", true); // 忽略不在model中的字段
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleError(Controller c) {
|
||||
c.renderJson(Result.failed(getErrmsg()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package com.cowr.service.ssjygl.jobs;
|
||||
|
||||
import com.cowr.service.ssjygl.overall.OverallCacheService;
|
||||
import com.cowr.ssjygl.overall.OverallService;
|
||||
import com.jfinal.log.Log;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.jfinal.plugin.redis.Redis;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoadStatCacheJob implements Job {
|
||||
private static Log log = Log.getLog(LoadStatCacheJob.class);
|
||||
|
||||
public void load() {
|
||||
try {
|
||||
// String statkey = OverallCacheService.me.overallmapkey("stat");
|
||||
// Record statcachedata = Redis.use().get(statkey);
|
||||
// if (statcachedata == null) {
|
||||
// statcachedata = OverallCacheService.me.stat(null);
|
||||
//
|
||||
// Redis.use().setex(statkey, OverallCacheService.statExpireAt, statcachedata);
|
||||
// }
|
||||
//
|
||||
// String lastOrderkey = OverallCacheService.me.overallmapkey("lastOrder");
|
||||
// List<Record> lastOrdercachedata = Redis.use().get(lastOrderkey);
|
||||
// if (lastOrdercachedata == null) {
|
||||
// lastOrdercachedata = OverallService.me.lastOrder(null);
|
||||
//
|
||||
// Redis.use().setex(lastOrderkey, OverallCacheService.statExpireAt, lastOrdercachedata);
|
||||
// }
|
||||
|
||||
// 直接更新缓存
|
||||
|
||||
// 首页数据统计
|
||||
String statkey = OverallCacheService.me.overallmapkey("stat");
|
||||
Record statcachedata = OverallCacheService.me.stat(null);
|
||||
Redis.use().setex(statkey, OverallCacheService.statExpireAt, statcachedata);
|
||||
|
||||
String lastOrderkey = OverallCacheService.me.overallmapkey("lastOrder");
|
||||
List<Record> lastOrdercachedata = OverallService.me.lastOrder(null);
|
||||
Redis.use().setex(lastOrderkey, OverallCacheService.statExpireAt, lastOrdercachedata);
|
||||
} catch (Exception e) {
|
||||
log.error("更新缓存失败");
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
load();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
package com.cowr.service.ssjygl.prepay.prepaycustomer;
|
||||
|
||||
import com.cowr.common.Const;
|
||||
import com.cowr.model.PrepayCustomer;
|
||||
import com.cowr.model.SyncTask;
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
import com.cowr.service.ssjygl.main.Config;
|
||||
import com.cowr.service.ssjygl.synctask.SyncTaskService;
|
||||
import com.jfinal.log.Log;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.jfinal.plugin.redis.Redis;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PrepayCustomerSyncService extends BaseSyncService {
|
||||
public static PrepayCustomerSyncService me = new PrepayCustomerSyncService();
|
||||
private static Log log = Log.getLog(PrepayCustomerSyncService.class);
|
||||
|
||||
|
||||
public String redisbasekey() {
|
||||
return Config.dbprop.get("redis.basekey") + Const.REDIS_SEPARATE + "prepayCustomer" + Const.REDIS_SEPARATE;
|
||||
}
|
||||
|
||||
|
||||
public void redisClear() {
|
||||
Redis.use().del(redisbasekey() + "*");
|
||||
}
|
||||
|
||||
/**
|
||||
* 将服务端的客户预付费信息推送到客户端
|
||||
*
|
||||
* @param customer_id
|
||||
*/
|
||||
public boolean pushPrepayCustomer(Integer customer_id) {
|
||||
PrepayCustomer prepayCustomer = PrepayCustomer.dao.findFirst("select * from prepay_customer where customer_id = ? ", customer_id);
|
||||
|
||||
if (prepayCustomer == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SyncTask synctask = new SyncTask();
|
||||
synctask.addUpdateData(prepayCustomer);
|
||||
|
||||
return SyncTaskService.me.save(synctask);
|
||||
}
|
||||
|
||||
// 更新所有错误余额的用户
|
||||
public void updatePrepayCustomerSurplus() {
|
||||
List<Record> list = Db.find("SELECT\n" +
|
||||
"\tc.id,\n" +
|
||||
"\tIF(c.id = 225,IFNULL(pd.amount,0) - IFNULL(rd.amount,0) - IFNULL(o.amount,0),\n" +
|
||||
"\tIFNULL(pd.amount,0) - IFNULL(rd.amount,0) - IFNULL(o.amount,0)) amount1\n" +
|
||||
"FROM\n" +
|
||||
"\tprepay_customer pc\n" +
|
||||
"\tLEFT JOIN customer c ON pc.customer_id = c.id AND c.del = 0\n" +
|
||||
"\tLEFT JOIN ( SELECT customer_id, sum( amount ) amount FROM prepay_detail WHERE state = 2 GROUP BY customer_id ) pd ON pd.customer_id = c.id\n" +
|
||||
"\tLEFT JOIN ( SELECT customer_id, sum( amount ) amount FROM refund_detail WHERE state = 3 GROUP BY customer_id ) rd ON rd.customer_id = c.id\n" +
|
||||
"\tLEFT JOIN ( SELECT customer_id, sum( presell_amount ) amount FROM presell_order WHERE del = 0 GROUP BY customer_id ) po ON po.customer_id = c.id\n" +
|
||||
"\tLEFT JOIN ( SELECT customer_id, sum( weight ) weight, sum( total_price ) amount FROM order_temp WHERE state = 5 GROUP BY customer_id ) o ON o.customer_id = c.id \n" +
|
||||
"where (\tpc.surplus - IF(c.id = 225,IFNULL(pd.amount,0) - IFNULL(rd.amount,0) - IFNULL(o.amount,0),\n" +
|
||||
"\tIFNULL(pd.amount,0) - IFNULL(rd.amount,0) - IFNULL(o.amount,0))) != 0\n" +
|
||||
"GROUP BY\n" +
|
||||
"\tc.id,\n" +
|
||||
"\tc.`name`;");
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
for (Record record : list) {
|
||||
PrepayCustomer prepayCustomer = PrepayCustomer.dao.findFirst("select * from prepay_customer where customer_id = ? ", record.getInt("id"));
|
||||
if (prepayCustomer == null){
|
||||
continue;
|
||||
}
|
||||
prepayCustomer.setSurplus(record.getBigDecimal("amount1"));
|
||||
prepayCustomer.update();
|
||||
|
||||
SyncTask synctask = new SyncTask();
|
||||
synctask.addUpdateData(prepayCustomer);
|
||||
|
||||
SyncTaskService.me.save(synctask);
|
||||
|
||||
log.info("修改用户的余额: " + prepayCustomer.getCustomerId() + "_" + prepayCustomer.getSurplus());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// 更新所有用户余额
|
||||
public void updateAllCustomerSurplus() {
|
||||
List<Record> list = Db.find("SELECT id FROM customer WHERE del = 0");
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
for (Record record : list) {
|
||||
PrepayCustomer prepayCustomer = PrepayCustomer.dao.findFirst("select * from prepay_customer where customer_id = ? ", record.getInt("id"));
|
||||
if (prepayCustomer == null){
|
||||
continue;
|
||||
}
|
||||
SyncTask synctask = new SyncTask();
|
||||
synctask.addUpdateData(prepayCustomer);
|
||||
|
||||
SyncTaskService.me.save(synctask);
|
||||
|
||||
log.info("修改用户的余额: " + prepayCustomer.getCustomerId() + "_" + prepayCustomer.getSurplus());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
package com.cowr.service.ssjygl.supermarket.productlog;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.SupermarketProductLog;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.main.AuthInterceptor;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.cowr.ssjygl.supermarket.product.SupermarketProductLogPKValidator;
|
||||
import com.cowr.ssjygl.supermarket.product.SupermarketProductLogService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.aop.Clear;
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.upload.UploadFile;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2025/1/21.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
public class SupermarketProductLogController extends Controller {
|
||||
|
||||
|
||||
/**
|
||||
* 按主键检查对象是否存在
|
||||
* 返回 code = 200
|
||||
* 存在时 data = true
|
||||
* 不存在 data = false
|
||||
*/
|
||||
@Before(SupermarketProductLogPKValidator.class)
|
||||
public void checkExistsByPk() {
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(SupermarketProductLogService.me.checkExistsByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增 supermarket_product_log 超市单价修改审核表
|
||||
*/
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void save() {
|
||||
UploadFile uploadFile = this.getFile();
|
||||
if (uploadFile == null || !uploadFile.getFile().isFile()) {
|
||||
renderJson(Result.failed("文件不能为空"));
|
||||
return;
|
||||
}
|
||||
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
model.setCreateId(tokenuser.getId());
|
||||
|
||||
renderJson(SupermarketProductLogSyncService.me.save(uploadFile,model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除 supermarket_product_log 超市单价修改审核表
|
||||
*/
|
||||
@Before(SupermarketProductLogPKValidator.class)
|
||||
public void del() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(SupermarketProductLogSyncService.me.delete(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核 supermarket_product_log 超市单价修改审核表
|
||||
*/
|
||||
@Before(SupermarketProductLogPKValidator.class)
|
||||
public void audit() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
|
||||
renderJson(SupermarketProductLogSyncService.me.audit(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复 supermarket_product_log 超市单价修改审核表
|
||||
*/
|
||||
@Before(SupermarketProductLogPKValidator.class)
|
||||
public void restore() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(SupermarketProductLogSyncService.me.restore(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 supermarket_product_log 超市单价修改审核表
|
||||
*/
|
||||
@Clear(AuthInterceptor.class)
|
||||
public void edit() {
|
||||
UploadFile uploadFile = this.getFile();
|
||||
if (uploadFile == null || !uploadFile.getFile().isFile()) {
|
||||
renderJson(Result.failed("文件不能为空"));
|
||||
return;
|
||||
}
|
||||
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
model.setState(0);
|
||||
renderJson(SupermarketProductLogSyncService.me.update(uploadFile,model, tokenuser ));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 supermarket_product_log 物流公司
|
||||
*/
|
||||
public void find() {
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
String name = get("name");
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
renderJson(Result.object(SupermarketProductLogService.me.find(pp, name, stm, etm)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 supermarket_product_log 物流公司
|
||||
*/
|
||||
@Before(SupermarketProductLogPKValidator.class)
|
||||
public void findByPk() {
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(SupermarketProductLogService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 supermarket_product_log 物流公司
|
||||
*/
|
||||
@Before(SupermarketProductLogPKValidator.class)
|
||||
public void get() {
|
||||
SupermarketProductLog model = getModel(SupermarketProductLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(SupermarketProductLogService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回所有 supermarket_product_log 物流公司
|
||||
*/
|
||||
public void list() {
|
||||
renderJson(Result.object(SupermarketProductLogService.me.list()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
package com.cowr.service.ssjygl.supermarket.productlog;
|
||||
|
||||
import com.cowr.common.oss.OSSKit;
|
||||
import com.cowr.common.utils.DateTimeUtil;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.ProductPriceModify;
|
||||
import com.cowr.model.SupermarketProductLog;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
import com.cowr.service.ssjygl.customer.contracttemplate.Word2HtmlStr;
|
||||
import com.cowr.service.ssjygl.productpricemodify.ProductPriceModifySyncService;
|
||||
import com.cowr.service.ssjygl.supermarket.SupermarketSyncService;
|
||||
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.Record;
|
||||
import com.jfinal.upload.UploadFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class SupermarketProductLogSyncService extends BaseSyncService {
|
||||
public static SupermarketProductLogSyncService me = new SupermarketProductLogSyncService();
|
||||
|
||||
private static Log log = Log.getLog(SupermarketProductLogSyncService.class);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
* @param model BaseModel
|
||||
* @return Result
|
||||
*/
|
||||
public Result audit(SupermarketProductLog model, Sysuser sysuser) {
|
||||
try {
|
||||
// 注意这里有 !,找到后才做 delete 操作
|
||||
if (!model.checkExistsByPk()) {
|
||||
return Result.failed(false, "按主键未找到对应记录");
|
||||
}
|
||||
|
||||
model.setAuditorId(sysuser.getId());
|
||||
model.setAuditorTime(new Date());
|
||||
SupermarketProductLog byPk = model.findByPk();
|
||||
boolean ret = Db.tx(new IAtom() {
|
||||
@Override
|
||||
public boolean run() {
|
||||
try {
|
||||
boolean ret = model.update();
|
||||
if (ret) {
|
||||
// 判断是否审核通过
|
||||
if (1 == model.getState()) {
|
||||
ProductPriceModify mod = new ProductPriceModify();
|
||||
mod.setProductId(byPk.getProductId());
|
||||
mod.setSupermarketId(byPk.getSupermarketId());
|
||||
mod.setType(1);
|
||||
mod.setUnitPrice(byPk.getUnitPrice());
|
||||
// 修改价格
|
||||
Result save = ProductPriceModifySyncService.me.save(mod, sysuser);
|
||||
String id = ((ProductPriceModify) save.getData()).getId();
|
||||
ProductPriceModifySyncService.me.verify(id, 2, "通过", sysuser);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return Result.object(ret);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.failed(false, "删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
public Result save(UploadFile uploadFile, SupermarketProductLog model, Sysuser sysuser) {
|
||||
List<Record> recordList = Db.find("select * from supermarket_product_log where del = 0 and product_id = ? and supermarket_id = ?", model.getProductId(), model.getSupermarketId());
|
||||
if (!recordList.isEmpty()){
|
||||
return Result.failed(false, "该商品定价已存在");
|
||||
}
|
||||
File file = null;
|
||||
String fileName = "";
|
||||
Record r = new Record();
|
||||
|
||||
try {
|
||||
file = uploadFile.getFile();
|
||||
String htmlStr = Word2HtmlStr.conver(file);
|
||||
if (htmlStr == null) {
|
||||
return Result.failed(fileName + "转html字符串失败");
|
||||
}
|
||||
model.setHtmlstr(htmlStr);
|
||||
String key = "attachment/" + DateTimeUtil.yMd.get().format(new Date()) + "/" + StrKit.getRandomUUID();
|
||||
fileName = file.getName();
|
||||
String suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
|
||||
OSSKit.putObject("ssjygl-xsct-statics", key + suffix, file);
|
||||
|
||||
r.set("fileName", fileName);
|
||||
r.set("ossKey", key + suffix);
|
||||
r.set("tm", DateTimeUtil.sdfhms.get().format(new Date(file.lastModified())));
|
||||
model.setAttachment(r.toJson());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.failed(fileName + "上传失败");
|
||||
}finally {
|
||||
if (file != null) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
model.setCreateTime(new Date());
|
||||
|
||||
Result save = this.save(model, sysuser);
|
||||
SupermarketSyncService.me.addProduct(model.getSupermarketId(), model.getProductId(), model.getUnitPrice().doubleValue(), sysuser);
|
||||
|
||||
return save;
|
||||
}
|
||||
public Result update(UploadFile uploadFile, SupermarketProductLog model, Sysuser sysuser) {
|
||||
List<Record> recordList = Db.find("select * from supermarket_product_log where del = 0 and product_id = ? and supermarket_id = ? and id != ?", model.getProductId(), model.getSupermarketId(),model.getId());
|
||||
if (!recordList.isEmpty()){
|
||||
return Result.failed(false, "该商品定价已存在");
|
||||
}
|
||||
File file = null;
|
||||
String fileName = "";
|
||||
Record r = new Record();
|
||||
|
||||
try {
|
||||
file = uploadFile.getFile();
|
||||
String htmlStr = Word2HtmlStr.conver(file);
|
||||
if (htmlStr == null) {
|
||||
return Result.failed(fileName + "转html字符串失败");
|
||||
}
|
||||
model.setHtmlstr(htmlStr);
|
||||
String key = "attachment/" + DateTimeUtil.yMd.get().format(new Date()) + "/" + StrKit.getRandomUUID();
|
||||
fileName = file.getName();
|
||||
String suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
|
||||
OSSKit.putObject("ssjygl-xsct-statics", key + suffix, file);
|
||||
|
||||
r.set("fileName", fileName);
|
||||
r.set("ossKey", key + suffix);
|
||||
r.set("tm", DateTimeUtil.sdfhms.get().format(new Date(file.lastModified())));
|
||||
model.setAttachment(r.toJson());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.failed(fileName + "上传失败");
|
||||
}finally {
|
||||
if (file != null) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
Result update = this.update(model, sysuser);
|
||||
SupermarketSyncService.me.addProduct(model.getSupermarketId(), model.getProductId(), model.getUnitPrice().doubleValue(), sysuser);
|
||||
return update;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
package com.cowr.service.ssjygl.transpricelog;
|
||||
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.Sysuser;
|
||||
import com.cowr.model.TransPriceLog;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.cowr.ssjygl.transpricelog.TransPriceLogPKValidator;
|
||||
import com.cowr.ssjygl.transpricelog.TransPriceLogService;
|
||||
import com.cowr.ssjygl.transpricelog.TransPriceLogValidator;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Generated by COWR Mon Apr 06 09:50:28 CST 2020
|
||||
* TableName: trans_price_log
|
||||
* Remarks: 运费结算记录
|
||||
* PrimaryKey: id
|
||||
*/
|
||||
public class TransPriceLogController extends Controller {
|
||||
|
||||
/**
|
||||
* 按主键检查对象是否存在
|
||||
* 返回 code = 200
|
||||
* 存在时 data = true
|
||||
* 不存在 data = false
|
||||
*/
|
||||
@Before(TransPriceLogPKValidator.class)
|
||||
public void checkExistsByPk() {
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(TransPriceLogService.me.checkExistsByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增 transport_company 物流公司
|
||||
*/
|
||||
@Before(TransPriceLogValidator.class)
|
||||
public void save() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
model.setCreateTime(new Date());
|
||||
renderJson(TransPriceLogSyncService.me.save(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除 transport_company 物流公司
|
||||
*/
|
||||
@Before(TransPriceLogPKValidator.class)
|
||||
public void del() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(TransPriceLogSyncService.me.delete(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复 transport_company 物流公司
|
||||
*/
|
||||
@Before(TransPriceLogPKValidator.class)
|
||||
public void restore() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(TransPriceLogSyncService.me.restore(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 transport_company 物流公司
|
||||
*/
|
||||
@Before(TransPriceLogValidator.class)
|
||||
public void edit() {
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
}
|
||||
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(TransPriceLogSyncService.me.update(model, tokenuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查找 transport_company 物流公司
|
||||
*/
|
||||
public void find() {
|
||||
PageParam pp = getBean(PageParam.class, "", true);
|
||||
String name = get("name");
|
||||
Integer del = getInt("del",0);
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
renderJson(Result.object(TransPriceLogService.me.find(pp, name, del,stm,etm)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 transport_company 物流公司
|
||||
*/
|
||||
@Before(TransPriceLogPKValidator.class)
|
||||
public void findByPk() {
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(TransPriceLogService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键查找单个对象 transport_company 物流公司
|
||||
*/
|
||||
@Before(TransPriceLogPKValidator.class)
|
||||
public void get() {
|
||||
TransPriceLog model = getModel(TransPriceLog.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(TransPriceLogService.me.findByPk(model));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回所有 transport_company 物流公司
|
||||
*/
|
||||
public void list() {
|
||||
renderJson(Result.object(TransPriceLogService.me.list()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package com.cowr.service.ssjygl.transpricelog;
|
||||
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
|
||||
public class TransPriceLogSyncService extends BaseSyncService {
|
||||
public static TransPriceLogSyncService me = new TransPriceLogSyncService();
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# mysql
|
||||
#jdbcUrl=jdbc:mysql://rm-wz9wa070076b2uge2ro.mysql.rds.aliyuncs.com:3306/ssjy_xsct_service?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
#user=ssjy_xsct
|
||||
#password=Ssjy_xs_890_prod
|
||||
|
||||
|
||||
# mysql
|
||||
#jdbcUrl=jdbc:mysql://127.0.0.1:3306/ssjy_xsct_service_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
#user=root
|
||||
#password=19999999
|
||||
|
||||
jdbcUrl=jdbc:mysql://rm-wz9wa070076b2uge2ro.mysql.rds.aliyuncs.com:3306/ssjy_xsct?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
user=ssjy_xsct
|
||||
password=Ssjy_xsct_890
|
||||
|
||||
# redis
|
||||
#redis.basekey=ssjcgl_xsct_dev
|
||||
redis.basekey=ssjcgl_xsct
|
||||
redis.ip=r-wz9168ab2f2f7ec4pd.redis.rds.aliyuncs.com
|
||||
redis.port=6379
|
||||
redis.pwd=CoWR1111
|
||||
redis.db=13
|
||||
|
|
@ -4,12 +4,12 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.cowr.ssjygl-xsct-common</groupId>
|
||||
<artifactId>ssjygl-xsct-common</artifactId>
|
||||
<groupId>com.cowr.ssjygl-xsx-common</groupId>
|
||||
<artifactId>ssjygl-xsx-common</artifactId>
|
||||
<version>1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>砂石经营管理-浠水城投-公用代码</name>
|
||||
<name>砂石经营管理-浠水县-公用代码</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.1.20</version>
|
||||
<version>1.1.22</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
|
|
@ -146,4 +146,4 @@
|
|||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
|
@ -30,7 +30,6 @@ public class Const {
|
|||
public static final String TEMP_CODE_SURPLUS_WARN = "SMS_208975325"; // 客户余额预警
|
||||
public static final String TEMP_CODE_REFUND_SUCCESS = "SMS_208965364"; // 客户退款成功通知
|
||||
public static final String TEMP_CODE_AGGR_DAY_STAT = "SMS_232891438"; // 累计及日销售汇总(不含预售)
|
||||
public static final String TEMP_CODE_AGGR_DAY_STAT_1 = "SMS_471810248"; // 累计及日销售汇总(含处置砂)
|
||||
public static Map<String, String> SMS_TEMP_MAP;
|
||||
|
||||
static {
|
||||
|
|
@ -45,7 +44,6 @@ public class Const {
|
|||
SMS_TEMP_MAP.put(TEMP_CODE_SURPLUS_WARN, "截至${time}${customer_name}在${vendor}的预存账户余额为${surplus}元。请及时关注。");
|
||||
SMS_TEMP_MAP.put(TEMP_CODE_REFUND_SUCCESS, "${time}${customer_name}在${vendor}的退款${amount}元,合计余额${surplus}元。");
|
||||
SMS_TEMP_MAP.put(TEMP_CODE_AGGR_DAY_STAT, "截至${time1}累计销售黄砂${aggr_weight}吨,共计${aggr_price}元,运输${aggr_cnt}辆次。${time2}当日销售黄砂${total_weight}吨,共计${total_price}元,运输${total_cnt}辆次。");
|
||||
SMS_TEMP_MAP.put(TEMP_CODE_AGGR_DAY_STAT_1, "截至${time1}累计销售黄砂${aggr_weight}吨,共计${aggr_price}元,运输${aggr_cnt}辆次。处置砂${aggr_weight1}吨,共计${aggr_price1}元,运输${aggr_cnt1}辆次。${time2}当日销售黄砂${total_weight}吨,共计${total_price}元,运输${total_cnt}辆次。处置砂${total_weight1}吨,共计${total_price1}元,运输${total_cnt1}辆次。");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -17,8 +17,8 @@ public enum OrderTypeEnum {
|
|||
TEMP(3),
|
||||
TRASH(4),
|
||||
PURCHASE(5),
|
||||
PRESELL(6),
|
||||
ALL(7);
|
||||
PRESELL(6);
|
||||
|
||||
OrderTypeEnum(int typeid) {
|
||||
this.typeid = typeid;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.cowr.common.oss;
|
||||
|
||||
import com.aliyun.oss.OSSClient;
|
||||
import com.aliyun.oss.model.OSSObject;
|
||||
import com.aliyun.oss.model.ObjectListing;
|
||||
import com.aliyun.oss.model.ObjectMetadata;
|
||||
import com.jfinal.kit.StrKit;
|
||||
|
|
@ -11,16 +10,16 @@ import java.io.File;
|
|||
import java.net.URLEncoder;
|
||||
|
||||
public class OSSKit {
|
||||
private static Log log = Log.getLog(OSSKit.class);
|
||||
private static Log log = Log.getLog(OSSKit.class);
|
||||
private static OSSClient _ossClient;
|
||||
private static String bucketName;
|
||||
private static String bucketName;
|
||||
|
||||
private static String endpoint;
|
||||
private static String accessKeyId = "LTAIqQ3TXBgNGBWi";
|
||||
private static String accessKeyId = "LTAIqQ3TXBgNGBWi";
|
||||
private static String accessKeySecret = "CGbPXdfX4xca3uaN2cOmTzjsG4jd6O";
|
||||
|
||||
public static void init(String endpoint, String bucketName) {
|
||||
OSSKit.endpoint = endpoint;
|
||||
OSSKit.endpoint = endpoint;
|
||||
OSSKit.bucketName = bucketName;
|
||||
}
|
||||
|
||||
|
|
@ -73,26 +72,6 @@ public class OSSKit {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static OSSObject getFile(String key) {
|
||||
if (_ossClient == null) {
|
||||
log.error("没有初始化 OSSMgrClient");
|
||||
|
||||
OSSKit.start();
|
||||
|
||||
if (_ossClient == null) {
|
||||
log.error("OSSMgrClient 初始化失败");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!StrKit.notBlank(key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _ossClient.getObject(bucketName, key);
|
||||
|
||||
}
|
||||
|
||||
public static boolean putObject(String bucketName, String key, File file) throws Exception {
|
||||
if (_ossClient == null) {
|
||||
log.error("没有初始化 OSSMgrClient");
|
||||
|
|
@ -134,7 +113,7 @@ public class OSSKit {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static ObjectListing list(String prefix) {
|
||||
public static ObjectListing list(String prefix){
|
||||
if (_ossClient == null) {
|
||||
log.error("没有初始化 OSSMgrClient");
|
||||
return null;
|
||||
|
|
@ -139,11 +139,4 @@ public class DataUtil {
|
|||
|
||||
return obj == null ? 0.0 : obj;
|
||||
}
|
||||
|
||||
public static String formatWithVarargs(String format, Object... objs) {
|
||||
if (null == objs || objs.length == 0){
|
||||
return format;
|
||||
}
|
||||
return String.format(format, objs);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue