代码提交

dev
徐杰盟 2025-03-06 09:34:37 +08:00
parent 8b2539c99f
commit edb417fd62
15 changed files with 219 additions and 70 deletions

View File

@ -222,4 +222,26 @@ public abstract class BaseCustomerContractSigned<M extends BaseCustomerContractS
public Integer getDel() {
return getInt("del");
}
/**
* name: type
* type: INT(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 0
* @param type 0: 1:
*/
@JSONField(name="type")
public void setType(Integer type) {
set("type", type);
}
/**
* @return del 0: 1:
*/
@JSONField(name="type")
public Integer getType() {
return getInt("type");
}
}

View File

@ -7,7 +7,7 @@ import com.alibaba.fastjson.annotation.JSONField;
/**
* Generated by COWR Wed Nov 17 15:39:45 CST 2021
* TableName: customer_contract_signed_log
* Remarks:
* Remarks:
* PrimaryKey: id
*/
@SuppressWarnings("serial")
@ -25,14 +25,14 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: INT UNSIGNED(10)
* isNullable: NO
* isPrimaryKey: YES
* defaultValue:
* defaultValue:
* @param id
*/
@JSONField(name="id")
public void setId(Integer id) {
set("id", id);
}
/**
* @return id
@ -47,14 +47,14 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: INT UNSIGNED(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* defaultValue:
* @param userId id
*/
@JSONField(name="user_id")
public void setUserId(Integer userId) {
set("user_id", userId);
}
/**
* @return user_id id
@ -69,14 +69,14 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: VARCHAR(20)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* defaultValue:
* @param userName
*/
@JSONField(name="user_name")
public void setUserName(String userName) {
set("user_name", userName);
}
/**
* @return user_name
@ -91,14 +91,14 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: INT UNSIGNED(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* defaultValue:
* @param customerId id
*/
@JSONField(name="customer_id")
public void setCustomerId(Integer customerId) {
set("customer_id", customerId);
}
/**
* @return customer_id id
@ -113,14 +113,14 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: VARCHAR(255)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* defaultValue:
* @param customerName
*/
@JSONField(name="customer_name")
public void setCustomerName(String customerName) {
set("customer_name", customerName);
}
/**
* @return customer_name
@ -135,17 +135,17 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: DATETIME(19)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* @param signTime
* defaultValue:
* @param signTime
*/
@JSONField(name="sign_time")
public void setSignTime(java.util.Date signTime) {
set("sign_time", signTime);
}
/**
* @return sign_time
* @return sign_time
*/
@JSONField(name="sign_time")
public java.util.Date getSignTime() {
@ -157,14 +157,57 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: INT UNSIGNED(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* defaultValue:
* @param contractId id
*/
@JSONField(name="contract_id")
public void setContractId(Integer contractId) {
set("contract_id", contractId);
}
/**
* @return company_signed_id id
*/
@JSONField(name="company_signed_id")
public Integer getCompanySignedId() {
return getInt("company_signed_id");
}
/**
* name: company_signed_id
* type: INT UNSIGNED(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* @param company_signed_id id
*/
@JSONField(name="company_signed_id")
public void setCompanySignedId(Integer company_signed_id) {
set("company_signed_id", company_signed_id);
}
/**
* @return client_signed_id id
*/
@JSONField(name="client_signed_id")
public Integer getClientContractId() {
return getInt("client_signed_id");
}
/**
* name: client_signed_id
* type: INT UNSIGNED(10)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue:
* @param client_signed_id id
*/
@JSONField(name="client_signed_id")
public void setClientSignedId(Integer client_signed_id) {
set("client_signed_id", client_signed_id);
}
/**
* @return contract_id id
@ -179,14 +222,14 @@ public abstract class BaseCustomerContractSignedLog<M extends BaseCustomerContra
* type: VARCHAR(255)
* isNullable: YES
* isPrimaryKey: NO
* defaultValue:
* defaultValue:
* @param remark
*/
@JSONField(name="remark")
public void setRemark(String remark) {
set("remark", remark);
}
/**
* @return remark

View File

@ -117,10 +117,36 @@ public class SupermarketService extends BaseService {
}
Record out = supermarket.toRecord();
out.set("products", Db.find("select t.supermarket_id, p.id, p.name, t.unit_price,t.product_id,sp.state,sp.id sp_id from supermarket_product t\n" +
List<Record> value = Db.find("select t.supermarket_id, p.id, p.name, t.unit_price,t.product_id,sp.state,sp.id sp_id from supermarket_product t\n" +
" left join product p on t.product_id = p.id \n" +
" left join supermarket_product_log sp on sp.supermarket_id = t.supermarket_id AND sp.product_id = t.product_id\n" +
" where t.supermarket_id = ? AND p.id > 0 AND sp.del = 0 ", id));
" left join (SELECT\n" +
" spl.* \n" +
" FROM\n" +
" ( SELECT max( auditor_time ) auditor_time FROM supermarket_product_log WHERE del = 0 AND state = 1 GROUP BY supermarket_id, product_id ) sp\n" +
" LEFT JOIN supermarket_product_log spl ON spl.auditor_time = sp.auditor_time) sp" +
" on sp.supermarket_id = t.supermarket_id AND sp.product_id = t.product_id\n" +
" where t.supermarket_id = ? AND p.id > 0 AND sp.del = 0 AND sp.state = 1 ", id);
// List<SupermarketProductLog> list = SupermarketProductLogService.me.list();
// List<Product> product = ProductService.me.list(null);
// if (!list.isEmpty()){
// list.stream()
// .filter(o -> o.getState() == 0)
// .collect(Collectors.groupingBy(o -> o.getSupermarketId() + "_" + o.getProductId() + "_",Collectors.toList())).forEach((o,v) ->{
// if (v.size() == 1) {
// SupermarketProductLog supermarketProductLog = v.get(0);
// Record record = supermarketProductLog.toRecord();
// for (Product product1 : product) {
// if (product1.getId().equals(supermarketProductLog.getProductId())){
// record.set("name",product1.getName());
// record.set("id",product1.getId());
// }
// }
// value.add(record);
//
// }
// });
// }
out.set("products", value);
return Result.success(out);
}

View File

@ -71,7 +71,7 @@ public class SupermarketProductLogService extends BaseService {
findSql += " " + Const.ORDER_BY_DESC;
}
}else{
fromsql += " order by t.create_time desc \n";
findSql += " order by t.create_time desc \n";
}
@ -79,7 +79,7 @@ public class SupermarketProductLogService extends BaseService {
}
public List<SupermarketProductLog> list() {
return SupermarketProductLog.dao.find("select * from supermarket_product_log where t.del = 0 ");
return SupermarketProductLog.dao.find("select * from supermarket_product_log where del = 0 ");
}

View File

@ -38,7 +38,7 @@ public class TruckController extends BaseController {
Integer state = getInt("trans_co_id");
String gps = get("gps");
String sim = get("sim");
Integer del = getInt("trans_co_id");
Integer del = getInt("del",0);
String number = get("number");
renderJson(Result.object(TruckService.me.find(pp, license, trans_co_id, state, gps, sim, del, number)));
}

View File

@ -4,7 +4,7 @@
#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
jdbcUrl=jdbc:mysql://192.168.66.47:3306/ssjy_xsct?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
user=root
password=Ssjy_xsx_890

View File

@ -83,11 +83,13 @@ public class CustomerContractSignedController extends Controller {
*/
public void find(){
PageParam pp = getBean(PageParam.class, "", true);
String name = get("name");
String name = get("name");
String create_id = get("create_id");
String stm = get("stm");
String etm = get("etm");
String type = get("type","0");
renderJson(Result.object(CustomerContractSignedService.me.find(pp, name, stm, etm)));
renderJson(Result.object(CustomerContractSignedService.me.find(pp, name, create_id,type, stm, etm)));
}
/**

View File

@ -34,7 +34,7 @@ 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) {
public Page<Record> find(PageParam pp, String name, String create_id, String type, String stm, String etm) {
String selectsql = "select t.* ";
String fromsql = "from customer_contract_signed t where 1=1 ";
List<Object> paraList = new ArrayList<>();
@ -43,6 +43,15 @@ public class CustomerContractSignedService extends BaseService {
fromsql += " and t.name like ? \n";
paraList.add("%" + name.trim() + "%");
}
if (StrKit.notBlank(create_id)) {
fromsql += " and t.create_id = ? \n";
paraList.add(create_id.trim());
}
if (StrKit.notBlank(type)) {
fromsql += " and t.type = ? \n";
paraList.add(type.trim());
}
if (StrKit.notBlank(stm)) {
fromsql += " and t.create_time >= ? \n";
@ -85,12 +94,13 @@ public class CustomerContractSignedService extends BaseService {
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 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();

View File

@ -37,11 +37,13 @@ public class CustomerContractSignedLogController extends Controller {
*/
public void find(){
PageParam pp = getBean(PageParam.class, "", true);
String userName = get("user_name");
String userName = get("user_name");
String company_name = get("company_name");
String client_name = get("client_name");
String stm = get("stm");
String etm = get("etm");
renderJson(Result.object(CustomerContractSignedLogService.me.find(pp, userName, stm, etm)));
renderJson(Result.object(CustomerContractSignedLogService.me.find(pp, userName, company_name,client_name , stm, etm)));
}
/**

View File

@ -1,7 +1,6 @@
package com.cowr.service.ssjygl.customer.contractsignedlog;
import com.cowr.common.Const;
import com.cowr.common.base.BaseModel;
import com.cowr.common.base.BaseService;
import com.cowr.common.enums.Enums;
import com.cowr.common.view.PageParam;
@ -10,7 +9,6 @@ import com.cowr.model.Customer;
import com.cowr.model.CustomerContractSignedLog;
import com.cowr.model.CustomerContractTemplate;
import com.cowr.model.Sysuser;
import com.cowr.service.ssjygl.customer.contracttemplate.CustomerContractTemplateService;
import com.cowr.ssjygl.modifylog.ModifyLogService;
import com.jfinal.kit.StrKit;
import com.jfinal.log.Log;
@ -26,16 +24,20 @@ import java.util.List;
/**
* Generated by COWR Wed Nov 17 15:39:50 CST 2021
* TableName: customer_contract_signed_log
* Remarks:
* Remarks:
* PrimaryKey: id
*/
public class CustomerContractSignedLogService extends BaseService {
private static final Log log = Log.getLog(CustomerContractSignedLogService.class);
public static final CustomerContractSignedLogService me = new CustomerContractSignedLogService();
public Page<Record> find(PageParam pp, String userName, String stm, String etm) {
String selectsql = "select t.*, c.template_name ";
String fromsql = "from customer_contract_signed_log t left join customer_contract_template c on t.contract_id = c.id where 1=1 ";
public Page<Record> find(PageParam pp, String userName, String company_name, String client_name, String stm, String etm) {
String selectsql = "select t.*, c.template_name, c.name company_name, c.name client_name ";
String fromsql = "from customer_contract_signed_log t" +
" left join customer_contract_template c on t.contract_id = c.id " +
" left join customer_contract_signed s1 on t.company_signed_id = s1.id " +
" left join customer_contract_signed s2 on t.client_signed_id = s2.id " +
"where 1=1 ";
List<Object> paraList = new ArrayList<>();
if (StrKit.notBlank(userName)) {
@ -43,6 +45,16 @@ public class CustomerContractSignedLogService extends BaseService {
paraList.add("%" + userName.trim() + "%");
}
if (StrKit.notBlank(company_name)) {
fromsql += " and s1.name like ? \n";
paraList.add("%" + company_name.trim() + "%");
}
if (StrKit.notBlank(client_name)) {
fromsql += " and s2.name like ? \n";
paraList.add("%" + client_name.trim() + "%");
}
if (StrKit.notBlank(stm)) {
fromsql += " and t.sign_time >= ? \n";
paraList.add(stm);

View File

@ -101,11 +101,21 @@ public class OrderclusterController extends BaseController {
Date start_time = getDate("start_time");
Date cutoff_time = getDate("cutoff_time");
int supermarket_id = getInt("supermarket_id");
int time_interval = getInt("time_interval");
int time_interval = getInt("time_interval",1);
String trucks = get("trucks");
Integer product_id = getInt("product_id",1);
renderJson(OrderclusterSyncService.me.saveTemp2(customer_id,customer_name, req_receipt, total_weight, start_time, cutoff_time, supermarket_id, supermarket_id, trucks, product_id, tokenuser));
renderJson(OrderclusterSyncService.me.saveTemp2(customer_id,
customer_name,
req_receipt,
total_weight,
start_time,
cutoff_time,
supermarket_id,
time_interval,
trucks,
product_id,
tokenuser));
}
/**

View File

@ -448,11 +448,11 @@ public class OrderclusterSyncService extends BaseSyncService {
return Result.failedstr("[%s]取土场还未部署", supermarket.getName());
}
List<Record> undonlist = OrderclusterService.me.undonlist(supermarket_id, customer_name, query_start_time, query_cutoff_time);
if (undonlist != null && !undonlist.isEmpty()) {
return Result.failedstr("运输目的地[%s][%s]至[%s]在取土场[%s]还有未完成的配额", customer_name, query_start_time, query_cutoff_time, SvrCacheData.SUP_CACHE.get(supermarket_id).getName());
}
// List<Record> undonlist = OrderclusterService.me.undonlist(supermarket_id, customer_name, query_start_time, query_cutoff_time);
//
// if (undonlist != null && !undonlist.isEmpty()) {
// return Result.failedstr("运输目的地[%s][%s]至[%s]在取土场[%s]还有未完成的配额", customer_name, query_start_time, query_cutoff_time, SvrCacheData.SUP_CACHE.get(supermarket_id).getName());
// }
Product product = Product.dao.findById(product_id);
if (product == null) {
@ -500,24 +500,41 @@ public class OrderclusterSyncService extends BaseSyncService {
}
ts.add(0, query_start_time + " 00:00:00");
ts.add(0, query_cutoff_time + " 23:59:59");
ts.add(1, query_cutoff_time + " 23:59:59");
ts.add(2, String.valueOf(time_interval));
List<Record> chkduk = Db.find(
"select * from ordercluster_truck t \n" +
" left join ordercluster c on c.id = t.ordercluster_id\n" +
" where c.state < 5 \n" + // OrderStateEnum.RECEIVED.getStateid()
" and c.start_time <= ? \n" +
" and c.cutoff_time >= ? \n" +
" and c.time_interval = ? \n" +
" and t.truck_license in (" + StrKit.join(tsql, ",") + ")", ts.toArray());
if (chkduk != null && !chkduk.isEmpty()) {
List<String> outerr = new ArrayList<>();
String time_intervalStr = null;
switch (time_interval){
case 1:
time_intervalStr = "全天";
break;
case 2:
time_intervalStr = "上午";
break;
case 3:
time_intervalStr = "下午";
break;
default:break;
}
for (Record bl : chkduk) {
outerr.add(String.format(
"[%s]已经在[%s]至[%s]分配给了[%s]",
"[%s]已经在[%s]至[%s][%s]分配给了[%s]",
bl.get("truck_license"),
DateTimeUtil.sdfymd.get().format(bl.get("start_time")),
DateTimeUtil.sdfymd.get().format(bl.get("cutoff_time")),
time_intervalStr,
bl.get("customer_name")
));
}

View File

@ -7,7 +7,6 @@ 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;
@ -55,6 +54,9 @@ public class SupermarketProductLogSyncService extends BaseSyncService {
mod.setSupermarketId(byPk.getSupermarketId());
mod.setType(1);
mod.setUnitPrice(byPk.getUnitPrice());
SupermarketSyncService.me.addProduct(mod.getSupermarketId(), mod.getProductId(), mod.getUnitPrice().doubleValue(), sysuser);
// 修改价格
Result save = ProductPriceModifySyncService.me.save(mod, sysuser);
String id = ((ProductPriceModify) save.getData()).getId();
@ -77,9 +79,10 @@ public class SupermarketProductLogSyncService extends BaseSyncService {
}
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());
model.setId(null);
List<Record> recordList = Db.find("select * from supermarket_product_log where del = 0 and product_id = ? and supermarket_id = ? AND state = 0", model.getProductId(), model.getSupermarketId());
if (!recordList.isEmpty()){
return Result.failed(false, "该商品定价已存在");
return Result.failed(false, "当前测站商品有待审核的定价,请勿重复提交");
}
File file = null;
String fileName = "";
@ -87,11 +90,11 @@ public class SupermarketProductLogSyncService extends BaseSyncService {
try {
file = uploadFile.getFile();
String htmlStr = Word2HtmlStr.conver(file);
if (htmlStr == null) {
return Result.failed(fileName + "转html字符串失败");
}
model.setHtmlstr(htmlStr);
// String htmlStr = Word2HtmlStr.conver(file);
// if (htmlStr == null) {
// return Result.failed(fileName + "转html字符串失败");
// }
model.setHtmlstr(" ");
String key = "attachment/" + DateTimeUtil.yMd.get().format(new Date()) + "/" + StrKit.getRandomUUID();
fileName = file.getName();
String suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
@ -112,14 +115,14 @@ public class SupermarketProductLogSyncService extends BaseSyncService {
model.setCreateTime(new Date());
Result save = this.save(model, sysuser);
SupermarketSyncService.me.addProduct(model.getSupermarketId(), model.getProductId(), model.getUnitPrice().doubleValue(), 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, "该商品定价存在");
List<Record> recordList = Db.find("select * from supermarket_product_log where del = 0 and id = ?", model.getId());
if (recordList.isEmpty()){
return Result.failed(false, "该商品定价存在");
}
File file = null;
String fileName = "";
@ -127,11 +130,11 @@ public class SupermarketProductLogSyncService extends BaseSyncService {
try {
file = uploadFile.getFile();
String htmlStr = Word2HtmlStr.conver(file);
if (htmlStr == null) {
return Result.failed(fileName + "转html字符串失败");
}
model.setHtmlstr(htmlStr);
// String htmlStr = Word2HtmlStr.conver(file);
// if (htmlStr == null) {
// return Result.failed(fileName + "转html字符串失败");
// }
model.setHtmlstr(" ");
String key = "attachment/" + DateTimeUtil.yMd.get().format(new Date()) + "/" + StrKit.getRandomUUID();
fileName = file.getName();
String suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
@ -150,7 +153,7 @@ public class SupermarketProductLogSyncService extends BaseSyncService {
}
}
Result update = this.update(model, sysuser);
SupermarketSyncService.me.addProduct(model.getSupermarketId(), model.getProductId(), model.getUnitPrice().doubleValue(), sysuser);
// SupermarketSyncService.me.addProduct(model.getSupermarketId(), model.getProductId(), model.getUnitPrice().doubleValue(), sysuser);
return update;
}

View File

@ -51,6 +51,8 @@ public class TransportCompanyController extends Controller {
TransportCompany model = getModel(TransportCompany.class, "", true); // 忽略不在model中的字段
model.setCreateTime(new Date());
model.setCreateId(tokenuser.getId());
renderJson(TransportCompanySyncService.me.save(model, tokenuser));
}

View File

@ -105,7 +105,7 @@ public class TruckController extends BaseController {
Integer state = getInt("state");
String gps = get("gps");
String sim = get("sim");
Integer del = getInt("del");
Integer del = getInt("del",0);
String number = get("number");
renderJson(Result.object(TruckService.me.find(pp, license, trans_co_id, state, gps, sim, del, number)));
}