添加客户类型表、客户类型管理、客户分类树

dev
lisai17@sina.com 2021-07-26 17:37:07 +08:00
parent 01344e1a52
commit 3923de4ccf
21 changed files with 496 additions and 158 deletions

View File

@ -2,4 +2,6 @@
##浠水县后端服务
1. ssjygl-xs-common 本地和云端后端服务公用代码
2. ssjygl-xs-local 本地后端服务
3. ssjygl-xs-service 云端后端服务
3. ssjygl-xs-service 云端后端服务
2021年7月改版开发分支

View File

@ -0,0 +1,14 @@
package com.cowr.model;
import com.cowr.model.base.BaseCustomerType;
/**
* Generated by COWR Mon Jul 26 16:28:20 CST 2021
* TableName: customer_type
* Remarks: -
* PrimaryKey: id
*/
@SuppressWarnings("serial")
public class CustomerType extends BaseCustomerType<CustomerType> {
public static final CustomerType dao = new CustomerType().dao();
}

View File

@ -3,7 +3,7 @@ package com.cowr.model;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
/**
* Generated by COWR Fri Feb 26 16:03:22 CST 2021
* Generated by COWR Mon Jul 26 16:28:20 CST 2021
* <pre>
* Example:
* public void configPlugin(Plugins me) {
@ -14,7 +14,7 @@ import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
* </pre>
*/
public class _MappingKit {
public static void mapping(ActiveRecordPlugin arp) {
arp.addMapping("auth_license", "truck_license", AuthLicense.class);
arp.addMapping("transport", "id", Transport.class);
@ -39,6 +39,7 @@ public class _MappingKit {
arp.addMapping("purchase", "id", Purchase.class);
arp.addMapping("supermarket", "id", Supermarket.class);
arp.addMapping("customer", "id", Customer.class);
arp.addMapping("customer_type", "id", CustomerType.class);
arp.addMapping("customer_receiver", "id", CustomerReceiver.class);
arp.addMapping("customer_register", "id", CustomerRegister.class);
arp.addMapping("customer_contact", "id", CustomerContact.class);

View File

@ -5,7 +5,7 @@ import com.jfinal.plugin.activerecord.IBean;
import com.alibaba.fastjson.annotation.JSONField;
/**
* Generated by COWR Thu Aug 20 11:16:08 CST 2020
* Generated by COWR Mon Jul 26 16:28:20 CST 2021
* TableName: customer
* Remarks: -
* PrimaryKey: id
@ -15,8 +15,8 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
public static final String tablename = "customer";
@JSONField(serialize = false)
public String getTablename() {
@JSONField(serialize=false)
public String getTablename(){
return tablename;
}
@ -25,20 +25,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: INT(10)
* isNullable: NO
* isPrimaryKey: YES
* defaultValue:
*
* @param id
* defaultValue:
* @param id
*/
@JSONField(name = "id")
@JSONField(name="id")
public void setId(Integer id) {
set("id", id);
}
/**
* @return id
* @return id
*/
@JSONField(name = "id")
@JSONField(name="id")
public Integer getId() {
return getInt("id");
}
@ -48,20 +47,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(128)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
*
* @param name
* defaultValue:
* @param name
*/
@JSONField(name = "name")
@JSONField(name="name")
public void setName(String name) {
set("name", name);
}
/**
* @return name
* @return name
*/
@JSONField(name = "name")
@JSONField(name="name")
public String getName() {
return getStr("name");
}
@ -71,20 +69,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(256)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* defaultValue:
* @param address
*/
@JSONField(name = "address")
@JSONField(name="address")
public void setAddress(String address) {
set("address", address);
}
/**
* @return address
*/
@JSONField(name = "address")
@JSONField(name="address")
public String getAddress() {
return getStr("address");
}
@ -94,20 +91,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(20)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* defaultValue:
* @param phone
*/
@JSONField(name = "phone")
@JSONField(name="phone")
public void setPhone(String phone) {
set("phone", phone);
}
/**
* @return phone
*/
@JSONField(name = "phone")
@JSONField(name="phone")
public String getPhone() {
return getStr("phone");
}
@ -117,20 +113,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(255)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* defaultValue:
* @param texpayerName
*/
@JSONField(name = "texpayer_name")
@JSONField(name="texpayer_name")
public void setTexpayerName(String texpayerName) {
set("texpayer_name", texpayerName);
}
/**
* @return texpayer_name
*/
@JSONField(name = "texpayer_name")
@JSONField(name="texpayer_name")
public String getTexpayerName() {
return getStr("texpayer_name");
}
@ -140,20 +135,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(20)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* defaultValue:
* @param texpayerNum
*/
@JSONField(name = "texpayer_num")
@JSONField(name="texpayer_num")
public void setTexpayerNum(String texpayerNum) {
set("texpayer_num", texpayerNum);
}
/**
* @return texpayer_num
*/
@JSONField(name = "texpayer_num")
@JSONField(name="texpayer_num")
public String getTexpayerNum() {
return getStr("texpayer_num");
}
@ -163,43 +157,41 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(128)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* defaultValue:
* @param bankName
*/
@JSONField(name = "bank_name")
@JSONField(name="bank_name")
public void setBankName(String bankName) {
set("bank_name", bankName);
}
/**
* @return bank_name
*/
@JSONField(name = "bank_name")
@JSONField(name="bank_name")
public String getBankName() {
return getStr("bank_name");
}
/**
* name: bank_account
* type: VARCHAR(20)
* type: VARCHAR(128)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* defaultValue:
* @param bankAccount
*/
@JSONField(name = "bank_account")
@JSONField(name="bank_account")
public void setBankAccount(String bankAccount) {
set("bank_account", bankAccount);
}
/**
* @return bank_account
*/
@JSONField(name = "bank_account")
@JSONField(name="bank_account")
public String getBankAccount() {
return getStr("bank_account");
}
@ -209,20 +201,19 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* type: VARCHAR(256)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
*
* @param memo
* defaultValue:
* @param memo
*/
@JSONField(name = "memo")
@JSONField(name="memo")
public void setMemo(String memo) {
set("memo", memo);
}
/**
* @return memo
* @return memo
*/
@JSONField(name = "memo")
@JSONField(name="memo")
public String getMemo() {
return getStr("memo");
}
@ -233,19 +224,18 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 0
*
* @param del
* @param del
*/
@JSONField(name = "del")
@JSONField(name="del")
public void setDel(Integer del) {
set("del", del);
}
/**
* @return del
* @return del
*/
@JSONField(name = "del")
@JSONField(name="del")
public Integer getDel() {
return getInt("del");
}
@ -256,19 +246,18 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 0
*
* @param type 0.1.
*/
@JSONField(name = "type")
@JSONField(name="type")
public void setType(Integer type) {
set("type", type);
}
/**
* @return type 0.1.
*/
@JSONField(name = "type")
@JSONField(name="type")
public Integer getType() {
return getInt("type");
}
@ -279,22 +268,65 @@ public abstract class BaseCustomer<M extends BaseCustomer<M>> extends BaseModel<
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 1
*
* @param invoiceType 1.2.
*/
@JSONField(name = "invoice_type")
@JSONField(name="invoice_type")
public void setInvoiceType(Integer invoiceType) {
set("invoice_type", invoiceType);
}
/**
* @return invoice_type 1.2.
*/
@JSONField(name = "invoice_type")
@JSONField(name="invoice_type")
public Integer getInvoiceType() {
return getInt("invoice_type");
}
/**
* name: weight_discount
* type: DECIMAL(6,4)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 1.0000
* @param weightDiscount
*/
@JSONField(name="weight_discount")
public void setWeightDiscount(java.math.BigDecimal weightDiscount) {
set("weight_discount", weightDiscount);
}
/**
* @return weight_discount
*/
@JSONField(name="weight_discount")
public java.math.BigDecimal getWeightDiscount() {
return get("weight_discount");
}
/**
* name: customer_type_id
* type: INT(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 0
* @param customerTypeId id
*/
@JSONField(name="customer_type_id")
public void setCustomerTypeId(Integer customerTypeId) {
set("customer_type_id", customerTypeId);
}
/**
* @return customer_type_id id
*/
@JSONField(name="customer_type_id")
public Integer getCustomerTypeId() {
return getInt("customer_type_id");
}
}

View File

@ -0,0 +1,90 @@
package com.cowr.model.base;
import com.cowr.common.base.BaseModel;
import com.jfinal.plugin.activerecord.IBean;
import com.alibaba.fastjson.annotation.JSONField;
/**
* Generated by COWR Mon Jul 26 16:28:20 CST 2021
* TableName: customer_type
* Remarks: -
* PrimaryKey: id
*/
@SuppressWarnings("serial")
public abstract class BaseCustomerType<M extends BaseCustomerType<M>> extends BaseModel<M> implements IBean {
public static final String tablename = "customer_type";
@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: name
* type: VARCHAR(255)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
* @param name
*/
@JSONField(name="name")
public void setName(String name) {
set("name", name);
}
/**
* @return name
*/
@JSONField(name="name")
public String getName() {
return getStr("name");
}
/**
* name: desc
* type: VARCHAR(255)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
* @param desc
*/
@JSONField(name="desc")
public void setDesc(String desc) {
set("desc", desc);
}
/**
* @return desc
*/
@JSONField(name="desc")
public String getDesc() {
return getStr("desc");
}
}

View File

@ -0,0 +1,24 @@
package com.cowr.ssjygl.customer.type;
import com.cowr.common.view.Result;
import com.jfinal.core.Controller;
/**
* Generated by COWR Mon Jul 26 16:28:29 CST 2021
* TableName: customer_type
* Remarks: -
* PrimaryKey: id
*/
public class CustomerTypeController extends Controller {
/**
* customer_type -
*/
public void list() {
renderJson(Result.object(CustomerTypeService.me.list()));
}
public void treedata() {
renderJson(Result.object(CustomerTypeService.me.treedata()));
}
}

View File

@ -0,0 +1,25 @@
package com.cowr.ssjygl.customer.type;
import com.cowr.common.validator.CrudParamValidator;
import com.cowr.common.view.Result;
import com.cowr.model.CustomerType;
import com.jfinal.core.Controller;
/**
* Generated by COWR Mon Jul 26 16:28:30 CST 2021
* TableName: customer_type
* Remarks: -
* PrimaryKey: id
*/
public class CustomerTypePKValidator 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()));
}
}

View File

@ -0,0 +1,52 @@
package com.cowr.ssjygl.customer.type;
import com.cowr.common.base.BaseService;
import com.cowr.common.utils.DataUtil;
import com.cowr.model.CustomerType;
import com.jfinal.log.Log;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
/**
* Generated by COWR Mon Jul 26 16:28:30 CST 2021
* TableName: customer_type
* Remarks: -
* PrimaryKey: id
*/
public class CustomerTypeService extends BaseService {
private static final Log log = Log.getLog(CustomerTypeService.class);
public static final CustomerTypeService me = new CustomerTypeService();
public List<Record> treedata() {
List<Record> list = Db.find("select id, name, -1 pid from customer_type ");
List<Record> cus = Db.find("select concat('customer_id_', id) id, name, customer_type_id pid, id customer_id from customer ");
list.addAll(cus);
List<Record> out = DataUtil.transformToTreeFormat(list);
out.sort(new Comparator<Record>() {
@Override
public int compare(Record o1, Record o2) {
if (o1.getInt("id") == 0 || o2.getInt("id") == 0) {
return -1;
} else {
return o1.getInt("id") - o2.getInt("id");
}
}
});
List<Record> root = new ArrayList<>();
root.add(new Record().set("id", -1).set("name", "全部").set("children", out));
return root;
}
public List<CustomerType> list() {
return CustomerType.dao.find("select * from customer_type");
}
}

View File

@ -0,0 +1,38 @@
package com.cowr.ssjygl.customer.type;
import com.cowr.common.validator.CrudParamValidator;
import com.cowr.common.view.Result;
import com.cowr.model.CustomerType;
import com.jfinal.core.Controller;
/**
* Generated by COWR Mon Jul 26 16:28:30 CST 2021
* TableName: customer_type
* Remarks: -
* PrimaryKey: id
*/
public class CustomerTypeValidator extends CrudParamValidator {
@Override
protected void validate(Controller c) {
// 默认新增时,前端不需要传主键。若需要前端传主键,需要去掉这个判断
if (!"save".equals(getActionMethodName())) {
validateRequired("id", "id", "id 必填");
validateInteger("id", 1, 2147483647, "id", "id 范围 1~2147483647");
}
validateString("name", 1, 255, "name", "name 长度 0~255");
validateString("desc", 0, 255, "desc", "desc 长度 0~255");
// 使用 model 更新时model 不能只有主键有值
// 这里用 getActionMethodName 写死,判断是 update 时,才做验证
// 如果确实是需要将主键外的字段置为 null可以在代码生成后删掉这段
if ("edit".equals(getActionMethodName())) {
validateUpdateModel(CustomerType.class, "", true); // 忽略不在model中的字段
}
}
protected void handleError(Controller c) {
c.renderJson(Result.failed(getErrmsg()));
}
}

View File

@ -83,6 +83,7 @@ public class Main {
"ticket_invalid_verify",
"ticket_log",
"ticket_receive",
"customer_type",
};
PropKit.use("db.properties");

View File

@ -20,7 +20,7 @@ public class Printer {
return;
}
lock.lock();
try {
try (FileInputStream fis = new FileInputStream(file)) {
Socket socket = new Socket();
socket.setOOBInline(false);
socket.setTcpNoDelay(true);
@ -30,45 +30,49 @@ public class Printer {
socket.setSoTimeout(15000);
socket.connect(new InetSocketAddress(ip, port), 5000);
FileInputStream fis = new FileInputStream(file);
OutputStream out = socket.getOutputStream();
int l1 = (int) (file.length() >> 56);
int l2 = (int) (file.length() >> 48);
int l3 = (int) (file.length() >> 40);
int l4 = (int) (file.length() >> 32);
int l5 = (int) (file.length() >> 24);
int l6 = (int) (file.length() >> 16);
int l7 = (int) (file.length() >> 8);
int l8 = (int) file.length();
out.write(l1);
out.write(l2);
out.write(l3);
out.write(l4);
out.write(l5);
out.write(l6);
out.write(l7);
out.write(l8);
out.flush();
byte[] buf = new byte[1024];
try (OutputStream out = socket.getOutputStream()) {
int l1 = (int) (file.length() >> 56);
int l2 = (int) (file.length() >> 48);
int l3 = (int) (file.length() >> 40);
int l4 = (int) (file.length() >> 32);
int l5 = (int) (file.length() >> 24);
int l6 = (int) (file.length() >> 16);
int l7 = (int) (file.length() >> 8);
int l8 = (int) file.length();
while (true) {
int read = fis.read(buf);
if (read == -1) {
break;
}
out.write(buf, 0, read);
out.write(l1);
out.write(l2);
out.write(l3);
out.write(l4);
out.write(l5);
out.write(l6);
out.write(l7);
out.write(l8);
out.flush();
}
fis.close();
byte[] buf = new byte[1024];
InputStream in = socket.getInputStream();
while (true) {
int i = in.read();
if (i != 0) {
break;
while (true) {
int read = fis.read(buf);
if (read == -1) {
break;
}
out.write(buf, 0, read);
out.flush();
}
InputStream in = socket.getInputStream();
while (true) {
int i = in.read();
if (i != 0) {
break;
}
}
socket.close();
} catch (Exception e) {
throw e;
}
socket.close();
} catch (Exception e) {
throw e;
} finally {
lock.unlock();
}

View File

@ -1,15 +1,15 @@
package com.cowr.local.ssjygl.devicectrl.printer;
import com.jfinal.log.Log;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellAddress;
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbookFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@ -20,14 +20,11 @@ public class ExcelHelper {
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
public static Workbook genExcel(Map<String, Object> model, File tplFile) {
FileInputStream is = null;
try {
try (FileInputStream is = new FileInputStream(tplFile)) {
long st = System.currentTimeMillis();
Map<String, CellAddress> addrMap;
CellAddress datetimePrint;
is = new FileInputStream(tplFile);
Workbook workbook = XSSFWorkbookFactory.create(is);
log.debug("读取模板耗时:" + (System.currentTimeMillis() - st));
Sheet sheet = workbook.getSheetAt(0);
@ -70,15 +67,6 @@ public class ExcelHelper {
return workbook;
} catch (Exception e) {
log.error(e.getMessage(), e);
} finally {
if (is != null) {
try {
is.close();
is = null;
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
return null;

View File

@ -0,0 +1,69 @@
package com.cowr.local.ssjygl.jobs;
import com.cowr.local.ssjygl.devicectrl.common.Const;
import com.cowr.local.ssjygl.main.Config;
import com.jfinal.log.Log;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.io.File;
public class ClearTempFileJob implements Job {
private static Log log = Log.getLog(ClearTempFileJob.class);
private void clearImg() {
long now = System.currentTimeMillis();
String dir = Config.getRootPath() + File.separator + Const.LicenseImgTmpFolder;
File baseDir = new File(dir);
File[] files = baseDir.listFiles();
for (int i = 0; i < files.length; i++) {
File img = files[i];
long st = img.lastModified();
// 缩略图 名称带 _ 原图名称带 - 超过2天后都删掉
if (img.getName().contains("_") || img.getName().contains("-")) {
if (now - st > 2 * 24 * 60 * 60 * 1000) {
img.delete();
}
}
}
}
private void clearXlsx() {
long now = System.currentTimeMillis();
String dir = Config.getRootPath() + File.separator + Const.PringExcelTmpFolder;
File baseDir = new File(dir);
File[] files = baseDir.listFiles();
for (int i = 0; i < files.length; i++) {
File xlsx = files[i];
long st = xlsx.lastModified();
if (now - st > 2 * 24 * 60 * 60 * 1000) {
xlsx.delete();
}
}
}
public void clear() {
try {
clearImg();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
try {
clearXlsx();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
clear();
}
}

View File

@ -24,6 +24,7 @@ import com.cowr.local.ssjygl.driver.DriverController;
import com.cowr.local.ssjygl.invoice.invalidverify.InvoiceInvalidVerifyController;
import com.cowr.local.ssjygl.invoice.log.InvoiceLogController;
import com.cowr.local.ssjygl.invoice.receive.InvoiceReceiveController;
import com.cowr.local.ssjygl.jobs.ClearTempFileJob;
import com.cowr.local.ssjygl.netty.NettyClient;
import com.cowr.local.ssjygl.netty.SocketIOService;
import com.cowr.local.ssjygl.order.invalidverify.OrderInvalidVerifyController;
@ -64,14 +65,10 @@ import com.cowr.model._MappingKit;
import com.cowr.ssjygl.CacheData;
import com.cowr.ssjygl.actioncmdlog.ActionCmdLogController;
import com.cowr.ssjygl.cctv.CctvController;
import com.cowr.local.ssjygl.prepay.PrepayController;
import com.cowr.local.ssjygl.overall.OverallController;
import com.cowr.ssjygl.modifylog.ModifyLogController;
import com.cowr.ssjygl.stat.invoice.InvoiceUseController;
import com.cowr.ssjygl.stat.purchase.OrderPurchaseStatController;
import com.cowr.local.ssjygl.stat.sale.OrderStatController;
import com.cowr.ssjygl.stat.transfer.OrderTransferStatController;
import com.cowr.local.ssjygl.system.sysuser.SysuserController;
import com.cowr.ssjygl.transportcompany.TransportCompanyService;
import com.cowr.ssjygl.transprice.TransPriceService;
import com.jfinal.config.*;
@ -88,10 +85,6 @@ import com.jfinal.plugin.druid.DruidPlugin;
import com.jfinal.plugin.druid.DruidStatViewHandler;
import com.jfinal.plugin.redis.RedisPlugin;
import com.jfinal.template.Engine;
import com.cowr.common.Interceptor.ReporterInterceptor;
import com.cowr.common.handler.GlobalHandler;
import com.cowr.common.view.JsonRenderFactory;
import com.cowr.model._MappingKit;
import java.io.File;
import java.sql.Connection;
@ -409,6 +402,8 @@ public class Config extends JFinalConfig {
} catch (Exception e) {
log.error(e.getMessage(), e);
}
new ClearTempFileJob().clear();
} catch (Exception e) {
log.error(e.getMessage(), e);
}

View File

@ -465,9 +465,7 @@ public class LocalOrderService {
return null;
}
FileOutputStream output = null;
Workbook wb = null;
Workbook wb = null;
try {
Object invoice_type = data.get("invoice_type"); // 可能是 null
@ -491,27 +489,21 @@ public class LocalOrderService {
System.currentTimeMillis()
));
output = new FileOutputStream(out);
wb.write(output);
try (FileOutputStream output = new FileOutputStream(out)) {
wb.write(output);
log.debug("生成票据打印文件: %s", out.getAbsolutePath());
log.debug("生成文件耗时2%s", System.currentTimeMillis() - st);
log.debug("生成票据打印文件: %s", out.getAbsolutePath());
log.debug("生成文件耗时2%s", System.currentTimeMillis() - st);
return out;
return out;
} catch (Exception e) {
log.error(e.getMessage(), e);
return null;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
return null;
} finally {
if (output != null) {
try {
output.flush();
output.close();
output = null;
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (wb != null) {
try {
wb.close();

View File

@ -6,4 +6,9 @@ synctask.enable=true
# 在零点检查前一天未完成的集团订单,将开始执行的置为已完成,将未开始的置为取消
checkundonordercluster.job=com.cowr.local.ssjygl.jobs.CheckUndonOrderclusterJob
checkundonordercluster.cron= 1 0 0 * * ?
checkundonordercluster.enable=true
checkundonordercluster.enable=true
# 删除超过2天的无用图片、打印生成的 excel
cleartempfile.job=com.cowr.local.ssjygl.jobs.ClearTempFileJob
cleartempfile.cron= 1 0 1 * * ?
cleartempfile.enable=true

View File

@ -24,7 +24,7 @@ default_scale_wait_time=8000
weigh.max=49
#集团订单剩余量在结算时的剩余量预警值
surplus.threshold=30
surplus.threshold=125
#打印用到的配置信息
print.vendor=浠水县长投环保有限公司

View File

@ -61,6 +61,7 @@ import com.cowr.service.ssjygl.truck.TruckController;
import com.cowr.ssjygl.CacheData;
import com.cowr.ssjygl.actioncmdlog.ActionCmdLogController;
import com.cowr.ssjygl.cctv.CctvController;
import com.cowr.ssjygl.customer.type.CustomerTypeController;
import com.cowr.ssjygl.modifylog.ModifyLogController;
import com.cowr.ssjygl.stat.invoice.InvoiceUseController;
import com.cowr.ssjygl.stat.purchase.OrderPurchaseStatController;
@ -184,6 +185,7 @@ public class Config extends JFinalConfig {
me.add("/customer/register", CustomerRegisterController.class);
me.add("/customer/pact", CustomerPactController.class);
me.add("/customer/csp", CustomerSupermarketProductController.class);
me.add("/customer/type", CustomerTypeController.class);
// -- 预付费
me.add("/prepay", PrepayController.class);

View File

@ -52,8 +52,6 @@ public class PrepayController extends BaseController {
}
Integer supermarket_id = getInt("supermarket_id");
Integer invoice_type = getInt("invoice_type");
String stm = get("stm");
String etm = get("etm");
String truck_license = get("truck_license");

View File

@ -7,7 +7,6 @@ import com.cowr.common.view.Result;
import com.cowr.model.Customer;
import com.cowr.model.CustomerReceiver;
import com.cowr.model.Sysuser;
import com.cowr.service.ssjygl.customer.register.CustomerRegisterService;
import com.cowr.service.ssjygl.main.AuthInterceptor;
import com.cowr.ssjygl.system.sysuser.SysuserPKValidator;
import com.cowr.ssjygl.system.sysuser.SysuserValidator;
@ -71,8 +70,9 @@ public class SysuserController extends Controller {
String receiver_phone = get("receiver_phone");
String receiver_address = get("receiver_address");
Integer invoice_type = getInt("invoice_type", 1);
Integer customer_type_id = getInt("customer_type_id", 1);
renderJson(SysuserSyncService.me.saveCustomer(model, texpayer_name, receiver_name, receiver_phone, receiver_address, invoice_type, tokenuser));
renderJson(SysuserSyncService.me.saveCustomer(model, texpayer_name, receiver_name, receiver_phone, receiver_address, invoice_type, customer_type_id, tokenuser));
}
/**
@ -137,9 +137,10 @@ public class SysuserController extends Controller {
String receiver_phone = get("receiver_phone");
String receiver_address = get("receiver_address");
Integer invoice_type = getInt("invoice_type", 1);
Integer customer_type_id = getInt("customer_type_id", 0);
Sysuser model = getModel(Sysuser.class, "", true); // 忽略不在model中的字段
renderJson(SysuserSyncService.me.updateCustomer(model, texpayer_name, receiver_name, receiver_phone, receiver_address, invoice_type, tokenuser));
renderJson(SysuserSyncService.me.updateCustomer(model, texpayer_name, receiver_name, receiver_phone, receiver_address, invoice_type, customer_type_id, tokenuser));
}
/**

View File

@ -139,10 +139,11 @@ public class SysuserSyncService extends BaseSyncService {
/**
*
* 退
*
* @param roleid
* @return
*/
public boolean isFinanceManager(Integer roleid){
public boolean isFinanceManager(Integer roleid) {
if (roleid == null) return false;
return roleid.equals(RoleEnum.FINANCEMANAGER.getRoleid());
}
@ -369,6 +370,7 @@ public class SysuserSyncService extends BaseSyncService {
String receiver_phone,
String receiver_address,
Integer invoice_type,
Integer customer_type_id,
Sysuser tokenuser
) {
try {
@ -385,6 +387,7 @@ public class SysuserSyncService extends BaseSyncService {
customer.setName(texpayer_name);
customer.setTexpayerName(texpayer_name);
customer.setInvoiceType(invoice_type);
customer.setCustomerTypeId(customer_type_id);
if (customer.checkDuplicate("name")) {
return Result.failed(false, "名称已存在");
@ -464,6 +467,7 @@ public class SysuserSyncService extends BaseSyncService {
String receiver_phone,
String receiver_address,
Integer invoice_type,
Integer customer_type_id,
Sysuser tokenuser
) {
try {
@ -504,6 +508,7 @@ public class SysuserSyncService extends BaseSyncService {
customer.setName(texpayer_name);
customer.setTexpayerName(texpayer_name);
customer.setInvoiceType(invoice_type);
customer.setCustomerTypeId(customer_type_id);
chkobj.setName(model.getName());
chkobj.setPhone(model.getPhone());