Commit b16d01c5 by ice

Merge remote-tracking branch 'aa/master'

parents 7c44c165 d85b632c
Showing with 2488 additions and 330 deletions
...@@ -12,10 +12,16 @@ import orthopedics.dao.*; ...@@ -12,10 +12,16 @@ import orthopedics.dao.*;
import orthopedics.model.*; import orthopedics.model.*;
import orthopedics.service.PropertiesServer; import orthopedics.service.PropertiesServer;
import orthopedics.util.IdWorker; import orthopedics.util.IdWorker;
import orthopedics.util.StringUtil;
import orthopedics.util.UuidUtil; import orthopedics.util.UuidUtil;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -159,6 +165,7 @@ public class Sync { ...@@ -159,6 +165,7 @@ public class Sync {
@Autowired @Autowired
private InvTransactionMapper invTransactionMapper; private InvTransactionMapper invTransactionMapper;
@GetMapping("/sku") @GetMapping("/sku")
public void addInvItemSku(){ public void addInvItemSku(){
List<TempItemSkuFomPmp> select = tempItemSkuFomPmpMapper.select(); List<TempItemSkuFomPmp> select = tempItemSkuFomPmpMapper.select();
...@@ -170,11 +177,17 @@ public class Sync { ...@@ -170,11 +177,17 @@ public class Sync {
data.put("inv_code","WH2"); data.put("inv_code","WH2");
data.put("subinv_code","KQ22"); data.put("subinv_code","KQ22");
data.put("locator_code","HJ"+tempItemSkuFomPmp.getRack()); data.put("locator_code","HJ"+tempItemSkuFomPmp.getRack());
String itemcode = invItemMapper.getPlucode(tempItemSkuFomPmp.getPlucode()); InvItem invItem = invItemMapper.findAllByPlucode(tempItemSkuFomPmp.getPlucode());
if(itemcode==null){ if(invItem==null){
logger.info("查询不到商品信息");
continue;
}
String id = invTransactionMapper.findIdByItemId(invItem.getId());
if(!StringUtil.isEmpty(id)){
logger.info(tempItemSkuFomPmp.getPlucode()+"已经同步");
continue; continue;
} }
data.put("item_code",itemcode); data.put("item_code",invItem.getItemCode());
data.put("tx_type_code","PMP_SYN"); data.put("tx_type_code","PMP_SYN");
data.put("tx_date",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); data.put("tx_date",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
data.put("tx_quantity",tempItemSkuFomPmp.getQty()); data.put("tx_quantity",tempItemSkuFomPmp.getQty());
......
package orthopedics.client; package orthopedics.client;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import orthopedics.controller.v1.TransactionController;
import orthopedics.dao.InvItemMapper; import orthopedics.dao.InvItemMapper;
import orthopedics.dao.SalOrderHeaderMapper; import orthopedics.dao.SalOrderHeaderMapper;
import orthopedics.dao.SalOrderLineMapper; import orthopedics.dao.SalOrderLineMapper;
...@@ -14,6 +16,7 @@ import orthopedics.model.InvItem; ...@@ -14,6 +16,7 @@ import orthopedics.model.InvItem;
import orthopedics.model.SalOrderHeader; import orthopedics.model.SalOrderHeader;
import orthopedics.model.SalOrderLine; import orthopedics.model.SalOrderLine;
import orthopedics.service.PropertiesServer; import orthopedics.service.PropertiesServer;
import orthopedics.util.StringUtil;
import orthopedics.util.UuidUtil; import orthopedics.util.UuidUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -41,6 +44,9 @@ public class SyncSalFromPos { ...@@ -41,6 +44,9 @@ public class SyncSalFromPos {
@Autowired @Autowired
PropertiesServer propertiesServer; PropertiesServer propertiesServer;
@Autowired
private TransactionController transactionController;
/** /**
* 将POS的销售订单同步到ERP(只同步我们同步过去的商品的销售订单) * 将POS的销售订单同步到ERP(只同步我们同步过去的商品的销售订单)
*/ */
...@@ -66,7 +72,8 @@ public class SyncSalFromPos { ...@@ -66,7 +72,8 @@ public class SyncSalFromPos {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateStr = sdf.format(timestamp); String dateStr = sdf.format(timestamp);
//查询支付方式 //查询支付方式
PreparedStatement ps1=ct.prepareStatement("SELECT * FROM shoptxns WHERE Convert(varchar,txntime,120) like ''+?+'%' and vouchnum=? and operator=? and salestype=8"); Connection ct1= DriverManager.getConnection("jdbc:sqlserver://130.1.0.32:1433;DatabaseName=shoptxns","wjkj","wjkj123456");
PreparedStatement ps1=ct1.prepareStatement("SELECT * FROM shoptxns WHERE Convert(varchar,txntime,120) like ''+?+'%' and vouchnum=? and operator=? and salestype=8");
ps1.setString(1,dateStr); ps1.setString(1,dateStr);
ps1.setLong(2,vouchnum); ps1.setLong(2,vouchnum);
ps1.setString(3,operator); ps1.setString(3,operator);
...@@ -89,7 +96,7 @@ public class SyncSalFromPos { ...@@ -89,7 +96,7 @@ public class SyncSalFromPos {
salOrderHeader.setCreateTime(LocalDateTime.now()); salOrderHeader.setCreateTime(LocalDateTime.now());
salOrderHeader.setSysOrgCode("A04"); salOrderHeader.setSysOrgCode("A04");
salOrderHeader.setOrgId("2c9007626dde3f4f016deda2151f1a42"); salOrderHeader.setOrgId("2c9007626dde3f4f016deda2151f1a42");
salOrderHeader.setOrderTypeId("000000006c60dba1016c661283010034"); salOrderHeader.setOrderTypeId("2c9007626e0202af016e16c0672b2000");
if(timestamp!=null){ if(timestamp!=null){
Date date = new Date(timestamp.getTime()); Date date = new Date(timestamp.getTime());
LocalDateTime ldt = date.toInstant() LocalDateTime ldt = date.toInstant()
...@@ -100,15 +107,6 @@ public class SyncSalFromPos { ...@@ -100,15 +107,6 @@ public class SyncSalFromPos {
salOrderHeader.setOrderNumber(propertiesServer.generateFlowingWater("SAL_ORDER_NUMBER")); salOrderHeader.setOrderNumber(propertiesServer.generateFlowingWater("SAL_ORDER_NUMBER"));
salOrderHeader.setCustomerId("2c9007626df2ab5b016dfd0edccb0039"); salOrderHeader.setCustomerId("2c9007626df2ab5b016dfd0edccb0039");
salOrderHeader.setOrderCurrency("CNY"); salOrderHeader.setOrderCurrency("CNY");
// if(paymentMethod.equals("001")){
// salOrderHeader.setPaymentMethod("CASH");
// }else if(paymentMethod.equals("098")){
// salOrderHeader.setPaymentMethod("ALIPAY");
// }else if(paymentMethod.equals("099")){
// salOrderHeader.setPaymentMethod("WECHAT");
// }else{
// salOrderHeader.setPaymentMethod("OTHER");
// }
salOrderHeader.setPaymentMethod(paymentMethod); salOrderHeader.setPaymentMethod(paymentMethod);
salOrderHeader.setSellerId("a9a2c497f64011e9a1b10242ac110002"); salOrderHeader.setSellerId("a9a2c497f64011e9a1b10242ac110002");
...@@ -135,6 +133,18 @@ public class SyncSalFromPos { ...@@ -135,6 +133,18 @@ public class SyncSalFromPos {
salOrderHeaderMapper.insert(salOrderHeader); salOrderHeaderMapper.insert(salOrderHeader);
salOrderLineMapper.insert(salOrderLine); salOrderLineMapper.insert(salOrderLine);
invItemMapper.updateByAttribute6(invItem.getId(),"2"); invItemMapper.updateByAttribute6(invItem.getId(),"2");
JSONObject jsonObject=new JSONObject();
JSONObject data=new JSONObject();
data.put("inv_code","WH2");
data.put("subinv_code","KQ22");
data.put("locator_code","HJ2");
data.put("item_code",invItem.getItemCode());
data.put("tx_type_code","PMP_SYN");
data.put("tx_date",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date()));
data.put("tx_quantity",quantity);
data.put("tx_price",attribute1);
jsonObject.put("data",data);
String s = transactionController.invItemInOut("201910271129039497a78b526d9a246eca0abb1025986f25cG7BHIxhVaDO6MYm", jsonObject);
} }
} }
......
package orthopedics.client;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import orthopedics.dao.*;
import orthopedics.model.*;
import orthopedics.service.PropertiesServer;
import orthopedics.service.UserServer;
import orthopedics.util.*;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
/**
* 同步pmp库区信息
*/
@Component
public class SyncTempAreaFomPmp {
private final static Logger logger = LoggerFactory.getLogger(SyncTempAreaFomPmp.class);
@Autowired
private InvSubinventoryMapper invSubinventoryMapper;
@Autowired
private InvInventoryMapper invInventoryMapper;
//每天晚上23:10点执行
@Scheduled(cron = "0 10 23 * * ? ")
@Transactional
public void scheduler(){
String gettoken = HttpUtilRSA.getToken();
String token = (String) JSONObject.parseObject(gettoken).get("Token");
String tempEncryptKey = (String) JSONObject.parseObject(gettoken).get("TempEncryKey");
JSONObject data=new JSONObject();
data.put("uniquekey","获取区域列表");
data.put("timestamp", getTimestamp());
Map headers=new HashMap();
headers.put("Content-Type","application/json");
headers.put("token",token);
byte[] encrypt = Aes.encrypt(JSON.toJSONString(data), tempEncryptKey, tempEncryptKey);
byte[] bytes = new byte[0];
try {
bytes = HttpUtilPMP.postBy("http://pmpapi.szcbfx.com/api/pmp/ExchangePMPData", encrypt,token);
} catch (Exception e) {
logger.error(e.getMessage());
return;
}
String s = new String(bytes);
JSONObject object = JSONObject.parseObject(s);
Object result = object.get("result");
if(result==null||!result.equals("success")){
logger.error((String) object.get("ret_msg"));
return;
}
List<JSONObject> retMsg= (List<JSONObject>) object.get("ret_msg");
if(retMsg==null || retMsg.size()<=0){
logger.info("没有可同步的区域数据");
return;
}
List<InvSubinventory> invSubinventories=new ArrayList<>();
for(JSONObject jsonObject:retMsg){
String subwh = jsonObject.getString("subwh");
String wh = jsonObject.getString("wh");
String descript = jsonObject.getString("descript");
InvSubinventory bySubinvCode = invSubinventoryMapper.findBySubinvCode("KQ" + subwh);
if(bySubinvCode!=null){
continue;
}
InvSubinventory invSubinventory=new InvSubinventory();
invSubinventory.setId(UuidUtil.get32UUIDString());
invSubinventory.setCreateDate(LocalDateTime.now());
invSubinventory.setCreateBy("0f98872af64711e9a1b10242ac110002");
InvInventory bySortid = invInventoryMapper.findBySortid(wh);
if(bySortid==null){
continue;
}
invSubinventory.setInvId(bySortid.getId());
invSubinventory.setSubinvType("STORAGE");
invSubinventory.setSubinvCode("KQ"+subwh);
invSubinventory.setSubinvName("存储区");
invSubinventory.setSubinvDesc("-1");
invSubinventory.setLocatorControl("Y");
invSubinventory.setStatus("A");
invSubinventories.add(invSubinventory);
}
if(invSubinventories.size()>0){
invSubinventoryMapper.insertBatch(invSubinventories);
}
logger.info("获取区域列表同步完成");
}
/**
* 获取时间戳(匹配书城)
* @return 时间戳
*/
public static long getTimestamp() {
long milli = System.currentTimeMillis() + 8*3600*1000;
return (milli*10000)+621355968000000000L;
}
}
...@@ -2,64 +2,45 @@ package orthopedics.client; ...@@ -2,64 +2,45 @@ package orthopedics.client;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import orthopedics.controller.pda.TakeStockController; import orthopedics.dao.*;
import orthopedics.model.*;
import orthopedics.service.PropertiesServer;
import orthopedics.service.UserServer;
import orthopedics.util.*; import orthopedics.util.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.time.ZoneId;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
public class SyncInvItem { * 同步pmp仓库信息
private final static Logger logger = LoggerFactory.getLogger(SyncInvItem.class); */
@Component
@Autowired public class SyncTempInventoryFomPmp {
private RedisTemplate redisTemplate; private final static Logger logger = LoggerFactory.getLogger(SyncTempInventoryFomPmp.class);
@Autowired @Autowired
private TakeStockController takeStockController; private InvInventoryMapper invInventoryMapper;
//每天晚上23点执行 //每天晚上23点执行
// @Scheduled(cron = "0 0 23 * * ? ") @Scheduled(cron = "0 0 23 * * ? ")
// @Transactional @Transactional
// public void scheduler(){ public void scheduler(){
// takeStockController.getPMPInvItem("20190904153120997a6088c4da5964015a88fa7a03651c2ff003h5Ol5W04Qp61");
// }
/**
* 获取时间戳(匹配书城)
* @return 时间戳
*/
public static long getTimestamp() {
long milli = System.currentTimeMillis() + 8*3600*1000;
return (milli*10000)+621355968000000000L;
}
public static void main(String[] args) {
String gettoken = HttpUtilRSA.getToken(); String gettoken = HttpUtilRSA.getToken();
System.err.println(gettoken);
String token = (String) JSONObject.parseObject(gettoken).get("Token"); String token = (String) JSONObject.parseObject(gettoken).get("Token");
String tempEncryptKey = (String) JSONObject.parseObject(gettoken).get("TempEncryKey"); String tempEncryptKey = (String) JSONObject.parseObject(gettoken).get("TempEncryKey");
JSONObject data=new JSONObject(); JSONObject data=new JSONObject();
data.put("uniquekey","获取区域列表"); data.put("uniquekey","获取仓号列表");
data.put("timestamp", getTimestamp()); data.put("timestamp", getTimestamp());
System.err.println(new Date());
//data.put("begintime","1995-12-23 00:00:00");
// data.put("begintime","2015-01-11 18:00:00");
// data.put("endTime","2020-06-12 18:00:00");
Map headers=new HashMap(); Map headers=new HashMap();
headers.put("Content-Type","application/json"); headers.put("Content-Type","application/json");
headers.put("token",token); headers.put("token",token);
...@@ -68,17 +49,54 @@ public class SyncInvItem { ...@@ -68,17 +49,54 @@ public class SyncInvItem {
try { try {
bytes = HttpUtilPMP.postBy("http://pmpapi.szcbfx.com/api/pmp/ExchangePMPData", encrypt,token); bytes = HttpUtilPMP.postBy("http://pmpapi.szcbfx.com/api/pmp/ExchangePMPData", encrypt,token);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.error(e.getMessage());
return;
} }
//String post = HttpUtilPMP.post("http://pmpapi.szcbfx.com/api/pmp/ExchangePMPData", data, headers, 6000, 6000, "utf-8",tempEncryptKey);
String s = new String(bytes); String s = new String(bytes);
JSONObject object = JSONObject.parseObject(s); JSONObject object = JSONObject.parseObject(s);
Object result = object.get("result");
if(result==null||!result.equals("success")){
logger.error((String) object.get("ret_msg"));
return;
}
List<JSONObject> retMsg= (List<JSONObject>) object.get("ret_msg"); List<JSONObject> retMsg= (List<JSONObject>) object.get("ret_msg");
if(retMsg==null || retMsg.size()<=0){
logger.info("没有可同步的仓号数据");
return;
}
List<InvInventory> invInventories=new ArrayList<>();
for(JSONObject jsonObject:retMsg){
String code = jsonObject.getString("code");
String descript = jsonObject.getString("descript");
InvInventory byInvCode = invInventoryMapper.findByInvCode("WH" + code);
if(byInvCode!=null){
continue;
}
InvInventory invInventory=new InvInventory();
invInventory.setId(UuidUtil.get32UUIDString());
invInventory.setOrg_id("2c9007626dde3f4f016deda2151f1a42");
invInventory.setInv_code("WH"+code);
invInventory.setInv_name(descript);
invInventory.setInv_desc("-1");
invInventory.setSortid(code);
invInventory.setStatus("A");
invInventory.setCreate_by("0f98872af64711e9a1b10242ac110002");
invInventory.setCreate_time(LocalDateTime.now());
invInventories.add(invInventory);
}
if(invInventories.size()>0){
invInventoryMapper.insertBatch(invInventories);
}
logger.info("获取仓号列表同步完成");
}
System.err.println(retMsg); /**
System.err.println(retMsg.size()); * 获取时间戳(匹配书城)
* @return 时间戳
*/
public static long getTimestamp() {
long milli = System.currentTimeMillis() + 8*3600*1000;
return (milli*10000)+621355968000000000L;
} }
} }
package orthopedics.client;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import orthopedics.dao.InvInventoryMapper;
import orthopedics.dao.InvLocatorMapper;
import orthopedics.dao.InvSubinventoryMapper;
import orthopedics.model.InvInventory;
import orthopedics.model.InvLocator;
import orthopedics.model.InvSubinventory;
import orthopedics.model.TempLocatorFomPmp;
import orthopedics.util.Aes;
import orthopedics.util.HttpUtilPMP;
import orthopedics.util.HttpUtilRSA;
import orthopedics.util.UuidUtil;
import java.time.LocalDateTime;
import java.util.*;
/**
* 同步pmp货架信息
*/
@Component
public class SyncTempLocatorFomPmp {
private final static Logger logger = LoggerFactory.getLogger(SyncTempLocatorFomPmp.class);
@Autowired
private InvLocatorMapper invLocatorMapper;
@Autowired
private InvInventoryMapper invInventoryMapper;
@Autowired
private InvSubinventoryMapper invSubinventoryMapper;
//每天晚上23:20点执行
@Scheduled(cron = "0 20 23 * * ? ")
@Transactional
public void scheduler(){
String gettoken = HttpUtilRSA.getToken();
String token = (String) JSONObject.parseObject(gettoken).get("Token");
String tempEncryptKey = (String) JSONObject.parseObject(gettoken).get("TempEncryKey");
JSONObject data=new JSONObject();
data.put("uniquekey","获取架号列表");
data.put("timestamp", getTimestamp());
Map headers=new HashMap();
headers.put("Content-Type","application/json");
headers.put("token",token);
byte[] encrypt = Aes.encrypt(JSON.toJSONString(data), tempEncryptKey, tempEncryptKey);
byte[] bytes = new byte[0];
try {
bytes = HttpUtilPMP.postBy("http://pmpapi.szcbfx.com/api/pmp/ExchangePMPData", encrypt,token);
} catch (Exception e) {
logger.error(e.getMessage());
}
String s = new String(bytes);
JSONObject object = JSONObject.parseObject(s);
Object result = object.get("result");
if(result==null||!result.equals("success")){
logger.error((String) object.get("ret_msg"));
return;
}
List<JSONObject> retMsg= (List<JSONObject>) object.get("ret_msg");
if(retMsg==null || retMsg.size()<=0){
logger.info("没有可同步的区域数据");
return;
}
List<InvLocator> invLocators=new ArrayList<>();
for(JSONObject jsonObject:retMsg){
String code = jsonObject.getString("code");
String wh = jsonObject.getString("wh");
InvLocator invLocatorList = invLocatorMapper.findLocatorByCode("HJ" + code);
if(invLocatorList!=null){
continue;
}
InvLocator invLocator=new InvLocator();
invLocator.setId(UuidUtil.get32UUIDString());
invLocator.setCreateBy("0f98872af64711e9a1b10242ac110002");
invLocator.setCreateTime(LocalDateTime.now());
InvInventory bySortid = invInventoryMapper.findBySortid(wh);
if(bySortid==null){
continue;
}
invLocator.setInvId(bySortid.getId());
List<InvSubinventory> invSubinventories = invSubinventoryMapper.selectByInvIdAndSubinvName(bySortid.getId());
if(invSubinventories==null || invSubinventories.size()<=0){
continue;
}
invLocator.setSubinvId(invSubinventories.get(0).getId());
invLocator.setLocatorCode("HJ"+code);
invLocator.setLocatorName(code);
invLocator.setLocatorDesc("-1");
invLocator.setStatus("A");
invLocators.add(invLocator);
}
if(invLocators.size()>0){
invLocatorMapper.insertBatch(invLocators);
}
logger.info("获取架号列表同步完成");
}
/**
* 获取时间戳(匹配书城)
* @return 时间戳
*/
public static long getTimestamp() {
long milli = System.currentTimeMillis() + 8*3600*1000;
return (milli*10000)+621355968000000000L;
}
}
//package orthopedics.client;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.core.env.Environment;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//import org.springframework.transaction.annotation.Transactional;
//import orthopedics.dao.*;
//import orthopedics.model.*;
//import orthopedics.service.PropertiesServer;
//import orthopedics.util.*;
//
//import java.math.BigDecimal;
//import java.sql.*;
//import java.text.SimpleDateFormat;
//import java.time.LocalDateTime;
//import java.time.ZoneId;
//import java.util.*;
//
///**
// * 同步BMP零售的销售订单
// */
//@Component
//public class SyncTempSalOrderFomPmp {
// private final static Logger logger = LoggerFactory.getLogger(SyncTempSalOrderFomPmp.class);
//
// @Autowired
// private RedisTemplate redisTemplate;
//
// @Autowired
// private Environment env;
//
// @Autowired
// private InvItemMapper invItemMapper;
//
// @Autowired
// private SalOrderHeaderMapper salOrderHeaderMapper;
//
// @Autowired
// private SalOrderLineMapper salOrderLineMapper;
//
// @Autowired
// PropertiesServer propertiesServer;
//
// //每天晚上23点执行
// @Scheduled(cron = "0 0 23 * * ? ")
// @Transactional
// public void scheduler(){
// Connection ct=null;
// PreparedStatement ps=null;
// ResultSet rs=null;
// String begintime= (String) redisTemplate.opsForValue().get("temp_sal_order_fom_pmp");
// if(StringUtil.isEmpty(begintime)){
// begintime=env.getProperty("synchronizationTime");
// }
// try {
// Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
// ct= DriverManager.getConnection("jdbc:sqlserver://130.1.0.32:1433;DatabaseName=shoptxns;sendStringParametersAsUnicode=false","wjkj","wjkj123456");
// ps=ct.prepareStatement("select s1.OPERATOR, s1.TXNTIME,s1.VOUCHNUM,s1.SEQUENCE,s2.DPTCODE,s1.CLSCODE, s1.DISPLAY,s1.CODE, s1.QTY, s1.PRICE, s1.DISC, \n" +
// "s1.ORGAMT, s1.ITEMDISC,s2.PRICE PRICE2\n" +
// "from SHOPTXNS s1\n" +
// "left join SHOPTXNS s2 on Convert(varchar,s1.txntime,23)= Convert(varchar,s2.txntime,23) AND s1.operator=s2.operator AND s1.vouchnum=s2.vouchnum AND s1.TERMINAL=s2.TERMINAL and s2.SALESTYPE = 8\n" +
// "where s1.SALESTYPE = 2 and s1.CODE IS NOT NULL and Convert(varchar,s1.txntime,120)>=?");
// ps.setString(1,begintime);
// rs = ps.executeQuery();
// while (rs.next()){
// String operator = rs.getString(1);//收银员账号
// Timestamp timestamp = rs.getTimestamp(2);//订单时间
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// String dateStr = sdf.format(timestamp);
// int vouchnum = rs.getInt(3);//小票单号
// int sequence = rs.getInt(4);//单据序号
// String dptcode = rs.getString(5);//支付方式
// String clscode = rs.getString(6);//分类代码(小类)
// String display = rs.getString(7);//分类代码
// String code = rs.getString(8);//商品条码
// int qty = rs.getInt(9);//数量
// int price = rs.getInt(10);//单价
// int disc = rs.getInt(11);//折扣
// int orgamt = rs.getInt(12);//订单总价
// int itemdisc = rs.getInt(13);//扣款金额
// int price2 = rs.getInt(14);//每笔支付方式支付的金额
//
// InvItem invItem = invItemMapper.findAllByPlucode(code);
// SalOrderHeader salOrderHeader=new SalOrderHeader();
// SalOrderLine salOrderLine=new SalOrderLine();
// String uuidString = UuidUtil.get32UUIDString();
// salOrderHeader.setId(uuidString);
// salOrderHeader.setCreateBy("PMP同步");
// salOrderHeader.setCreateTime(LocalDateTime.now());
// salOrderHeader.setSysOrgCode("A04");
// salOrderHeader.setOrgId("2c9007626dde3f4f016deda2151f1a42");
// salOrderHeader.setOrderTypeId("2c9007626e0202af016e16c0672b2000");
// salOrderHeader.setOrderDate(TimeUtil.fromDateToLocalDateTime(dateStr));
// salOrderHeader.setOrderNumber(propertiesServer.generateFlowingWater("SAL_ORDER_NUMBER"));
// salOrderHeader.setCustomerId("2c9007626df2ab5b016dfd0edccb0039");
// salOrderHeader.setOrderCurrency("CNY");
// salOrderHeader.setPaymentMethod(dptcode);
// salOrderHeader.setSellerId("a9a2c497f64011e9a1b10242ac110002");
//
// //封装从表数据
// salOrderLine.setId(UuidUtil.get32UUIDString());
// salOrderLine.setCreateTime(LocalDateTime.now());
// salOrderLine.setSysOrgCode("A04");
// salOrderLine.setOrgId("2c9007626dde3f4f016deda2151f1a42");
// salOrderLine.setSalOrderHeaderId(uuidString);
// salOrderLine.setLineNumber("1");
// salOrderLine.setItemCode(invItem.getItemCode());
// salOrderLine.setItemName(invItem.getItemName());
// salOrderLine.setItemDesc(invItem.getItemDesc());
// salOrderLine.setQuantity(quantity);
// salOrderLine.setUnitCode("BEN");
// salOrderLine.setSalePrice(BigDecimal.valueOf(attribute1/100));
// salOrderLine.setTaxRate("0");
// salOrderLine.setAttribute3(attribute3/100+"");
// salOrderLine.setAttribute2(Double.valueOf(attribute2/100));
// salOrderLine.setLineStatus("completed");
// salOrderLine.setOrderHeaderId(hid);
// salOrderLine.setItemId(invItem.getId());
// salOrderHeaderMapper.insert(salOrderHeader);
// salOrderLineMapper.insert(salOrderLine);
//
// }
//
// }catch (Exception e){
// logger.error("同步BMP零售的销售订单失败");
// logger.error(e.getMessage());
// }finally {
// try {
// if(rs!=null){
// rs.close();
// }
// if(ps!=null){
// ps.close();
// }
// if(ct!=null){
// ct.close();
// }
// } catch (SQLException e) {
// logger.error("将POS的销售订单同步到ERP流关闭异常");
// }
// }
//
// }
//
//
// /**
// * 获取时间戳(匹配书城)
// * @return 时间戳
// */
// public static long getTimestamp() {
// long milli = System.currentTimeMillis() + 8*3600*1000;
// return (milli*10000)+621355968000000000L;
// }
//
//}
package orthopedics.client;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import orthopedics.dao.*;
import orthopedics.model.*;
import orthopedics.util.Aes;
import orthopedics.util.HttpUtilPMP;
import orthopedics.util.HttpUtilRSA;
import orthopedics.util.UuidUtil;
import java.time.LocalDateTime;
import java.util.*;
/**
* 同步pmp供应商信息
*/
@Component
public class SyncTempSupplierFomPmp {
private final static Logger logger = LoggerFactory.getLogger(SyncTempSupplierFomPmp.class);
@Autowired
private PurSupplierMapper purSupplierMapper;
@Autowired
private PurSupplierSiteMapper purSupplierSiteMapper;
@Autowired
private PurSupplierContactMapper purSupplierContactMapper;
//每天晚上23点执行
@Scheduled(cron = "0 0 23 * * ? ")
@Transactional
public void scheduler(){
String gettoken = HttpUtilRSA.getToken();
String token = (String) JSONObject.parseObject(gettoken).get("Token");
String tempEncryptKey = (String) JSONObject.parseObject(gettoken).get("TempEncryKey");
JSONObject data=new JSONObject();
data.put("uniquekey","获取供商列表");
data.put("timestamp", getTimestamp());
data.put("begintime","1995-01-11 18:00:00");
data.put("endTime","2119-12-12 18:00:00");
Map headers=new HashMap();
headers.put("Content-Type","application/json");
headers.put("token",token);
byte[] encrypt = Aes.encrypt(JSON.toJSONString(data), tempEncryptKey, tempEncryptKey);
byte[] bytes = new byte[0];
try {
bytes = HttpUtilPMP.postBy("http://pmpapi.szcbfx.com/api/pmp/ExchangePMPData", encrypt,token);
} catch (Exception e) {
logger.error(e.getMessage());
}
String s = new String(bytes);
JSONObject object = JSONObject.parseObject(s);
Object result = object.get("result");
if(result==null||!result.equals("success")){
logger.error((String) object.get("ret_msg"));
return;
}
List<JSONObject> retMsg= (List<JSONObject>) object.get("ret_msg");
if(retMsg==null || retMsg.size()<=0){
logger.info("没有可同步的区域数据");
return;
}
List<PurSupplier> purSuppliers=new ArrayList<>();
List<PurSupplierSite> purSupplierSites=new ArrayList<>();
List<PurSupplierContact> purSupplierContacts=new ArrayList<>();
for (JSONObject jsonObject:retMsg) {
List<PurSupplier> purSuppliers1 = purSupplierMapper.selectByCode(jsonObject.getString("code"));
if(purSuppliers1!=null && purSuppliers1.size()>0){
continue;
}
PurSupplier purSupplier=new PurSupplier();
PurSupplierSite purSupplierSite=new PurSupplierSite();
PurSupplierContact purSupplierContact=new PurSupplierContact();
String uuid = UuidUtil.get32UUIDString();
purSupplier.setId(uuid);
purSupplier.setCreateBy("PMP同步");
purSupplier.setCreateTime(LocalDateTime.now());
purSupplier.setSupplierCode(jsonObject.getString("code"));
purSupplier.setSupplierName(jsonObject.getString("fullname"));
purSupplier.setSupplierShortName(jsonObject.getString("shortname"));
purSupplier.setStatus("A");
String uuidSite = UuidUtil.get32UUIDString();
purSupplierSite.setId(uuidSite);
purSupplierSite.setCreateBy("PMP同步");
purSupplierSite.setCreateTime(LocalDateTime.now());
purSupplierSite.setSupplierId(uuid);
purSupplierSite.setSupplierSiteName(jsonObject.getString("address"));
purSupplierSite.setTelephone(jsonObject.getString("phone"));
purSupplierSite.setStatus("A");
purSupplierContact.setId(UuidUtil.get32UUIDString());
purSupplierContact.setCreateBy("PMP同步");
purSupplierContact.setCreateTime(LocalDateTime.now());
purSupplierContact.setSupplierId(uuid);
purSupplierContact.setSupplierSiteId(uuidSite);
purSupplierContact.setContactName(jsonObject.getString("contact"));
purSupplierContact.setTelephone(jsonObject.getString("phone"));
purSupplierContact.setStatus("A");
purSuppliers.add(purSupplier);
purSupplierSites.add(purSupplierSite);
purSupplierContacts.add(purSupplierContact);
}
if(purSuppliers.size()>0){
purSupplierMapper.insertBatch(purSuppliers);
purSupplierSiteMapper.insertBatch(purSupplierSites);
purSupplierContactMapper.insertBatch(purSupplierContacts);
}
logger.info("获取供商列表供应商同步完成");
}
/**
* 获取时间戳(匹配书城)
* @return 时间戳
*/
public static long getTimestamp() {
long milli = System.currentTimeMillis() + 8*3600*1000;
return (milli*10000)+621355968000000000L;
}
}
...@@ -171,11 +171,13 @@ public class InvCountHeaderController { ...@@ -171,11 +171,13 @@ public class InvCountHeaderController {
} }
@GetMapping("/findByHeaderStatus") @GetMapping("/findByHeaderStatus")
public Result findByHeaderStatus(@RequestParam(value = "access_token",required = true)String token){ public Result findByHeaderStatus(@RequestParam(value = "access_token",required = true)String token,@RequestParam(value = "invId",required = true)String invId){
SysAccessToken sysAccessToken = userServer.checkToken(token); SysAccessToken sysAccessToken = userServer.checkToken(token);
List<InvCountHeaderPage> ichp=new ArrayList<>(); List<InvCountHeaderPage> ichp=new ArrayList<>();
if(StringUtil.isEmpty(invId)){
List<InvCountHeader> invCountHeaders = invCountHeaderMapper.fingByHeaderStatus("new"); return new Result(false, StatusCode.ERROR,"参数为空");
}
List<InvCountHeader> invCountHeaders = invCountHeaderMapper.fingByHeaderStatus("new",invId);
if(invCountHeaders==null ||invCountHeaders.size()<=0){ if(invCountHeaders==null ||invCountHeaders.size()<=0){
return new Result(false, StatusCode.ERROR,"没有状态为【新增】数据"); return new Result(false, StatusCode.ERROR,"没有状态为【新增】数据");
} }
......
...@@ -12,9 +12,7 @@ import orthopedics.util.StatusCode; ...@@ -12,9 +12,7 @@ import orthopedics.util.StatusCode;
import java.util.List; import java.util.List;
/**
* 库存信息同步到ERS
*/
@RestController @RestController
@RequestMapping("/bookcity/InvItemRfid") @RequestMapping("/bookcity/InvItemRfid")
public class InvItemRfidController { public class InvItemRfidController {
...@@ -22,12 +20,24 @@ public class InvItemRfidController { ...@@ -22,12 +20,24 @@ public class InvItemRfidController {
@Autowired @Autowired
private InvItemRfidService invItemRfidService; private InvItemRfidService invItemRfidService;
/**
* 生成rfid保存
* @param invItemRfid
* @param token
* @return
*/
@PostMapping("/save") @PostMapping("/save")
public Result save(@RequestBody InvItemRfid invItemRfid,@RequestParam(value = "access_token",required = true)String token ){ public Result save(@RequestBody InvItemRfid invItemRfid,@RequestParam(value = "access_token",required = true)String token ){
String save= invItemRfidService.save(token, invItemRfid); String save= invItemRfidService.save(token, invItemRfid);
return new Result(true, StatusCode.OK,"已生成"+save+"条记录"); return new Result(true, StatusCode.OK,"已生成"+save+"条记录");
} }
/**
* 将库存同步到ers
* @param strings
* @param token
* @return
*/
@PostMapping("/putaway") @PostMapping("/putaway")
public Result update(@RequestBody List<String> strings, @RequestParam(value = "access_token",required = true)String token ){ public Result update(@RequestBody List<String> strings, @RequestParam(value = "access_token",required = true)String token ){
String putaway = invItemRfidService.putaway(token, strings); String putaway = invItemRfidService.putaway(token, strings);
......
...@@ -5,11 +5,9 @@ import org.springframework.beans.BeanUtils; ...@@ -5,11 +5,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import orthopedics.dao.WarTransferLineMapper; import orthopedics.dao.*;
import orthopedics.dao.WarTransferMapper; import orthopedics.model.*;
import orthopedics.model.SysAccessToken; import orthopedics.service.HrPersonOrgService;
import orthopedics.model.WarTransfer;
import orthopedics.model.WarTransferLine;
import orthopedics.service.PropertiesServer; import orthopedics.service.PropertiesServer;
import orthopedics.service.UserServer; import orthopedics.service.UserServer;
import orthopedics.util.Result; import orthopedics.util.Result;
...@@ -37,6 +35,15 @@ public class WarTransferController { ...@@ -37,6 +35,15 @@ public class WarTransferController {
@Autowired @Autowired
private WarTransferLineMapper warTransferLineMapper; private WarTransferLineMapper warTransferLineMapper;
@Autowired
private WshParameterMapper wshParameterMapper;
@Autowired
private InvInventoryMapper invInventoryMapper;
@Autowired
private HrPersonOrgMapper hrPersonOrgMapper;
@PostMapping("/add") @PostMapping("/add")
public Result add(@RequestBody WarTransferPage warTransferPage, @RequestParam(value = "access_token",required = true)String token){ public Result add(@RequestBody WarTransferPage warTransferPage, @RequestParam(value = "access_token",required = true)String token){
...@@ -61,6 +68,26 @@ public class WarTransferController { ...@@ -61,6 +68,26 @@ public class WarTransferController {
warTransferPage.setDeliveryName(sysAccessToken.getUserId()); warTransferPage.setDeliveryName(sysAccessToken.getUserId());
warTransferPage.setRequestorId(sysAccessToken.getUserId()); warTransferPage.setRequestorId(sysAccessToken.getUserId());
warTransferPage.setOrderStatus("completed"); warTransferPage.setOrderStatus("completed");
InvInventory byInvCode = invInventoryMapper.findByInvCode(warTransferPage.getInvCode());
InvInventory byInvCodeIn = invInventoryMapper.findByInvCode(warTransferPage.getInInvCode());
if(byInvCode==null){
return new Result(false, StatusCode.ERROR,"调入库存code有误");
}
if(byInvCode==null){
return new Result(false, StatusCode.ERROR,"调出库存code有误");
}
List<WshParameter> wshParameters = wshParameterMapper.selectByInvIdByupdateTime(byInvCode.getId());
if(wshParameters==null || wshParameters.size()<=0){
return new Result(false, StatusCode.ERROR,"请维护发运参数");
}
warTransferPage.setSubinvCode(wshParameters.get(0).getDefaultShippingSubinvId());
warTransferPage.setExcutorId(sysAccessToken.getUserId());
warTransferPage.setInInvName(byInvCodeIn.getInv_name());
warTransferPage.setInvName(byInvCode.getInv_name());
List<HrPersonOrg> hrPersonOrgs = hrPersonOrgMapper.selectByPersonId(sysAccessToken.getUserId());
if(hrPersonOrgs!=null && hrPersonOrgs.size()>0){
warTransferPage.setOrgId(hrPersonOrgs.get(0).getOrgId());
}
//行数据封装 //行数据封装
List<WarTransferLine> warTransferLineList = warTransferPage.getWarTransferLineList(); List<WarTransferLine> warTransferLineList = warTransferPage.getWarTransferLineList();
......
...@@ -310,11 +310,11 @@ public class TakeStockController { ...@@ -310,11 +310,11 @@ public class TakeStockController {
if(StringUtil.isEmpty(plucode)){ if(StringUtil.isEmpty(plucode)){
continue; continue;
} }
List<InvItem> invItems = invItemMapper.selectByPlucode(plucode); InvItem invItem1 = invItemMapper.selectByPlucode(plucode);
if(invItems!=null&&invItems.size()>0){ if(invItem1!=null){
invItemMapper.deleteByPlucode(plucode); invItemMapper.deleteByPlucode(plucode);
invItemSkuMapper.deleteByItemCode(invItems.get(0).getItemCode()); invItemSkuMapper.deleteByItemCode(invItem1.getItemCode());
invItemAttributeMapper.deleteByItemCode(invItems.get(0).getItemCode()); invItemAttributeMapper.deleteByItemCode(invItem1.getItemCode());
invItemPmpMapper.deleteByPlucode(plucode); invItemPmpMapper.deleteByPlucode(plucode);
} }
InvItem invItem=new InvItem(); InvItem invItem=new InvItem();
...@@ -518,11 +518,11 @@ public class TakeStockController { ...@@ -518,11 +518,11 @@ public class TakeStockController {
if(StringUtil.isEmpty(plucode)){ if(StringUtil.isEmpty(plucode)){
continue; continue;
} }
List<InvItem> invItems = invItemMapper.selectByPlucode(plucode); InvItem invItem1 = invItemMapper.selectByPlucode(plucode);
if(invItems!=null&&invItems.size()>0){ if(invItem1!=null){
invItemMapper.deleteByPlucode(plucode); invItemMapper.deleteByPlucode(plucode);
invItemSkuMapper.deleteByItemCode(invItems.get(0).getItemCode()); invItemSkuMapper.deleteByItemCode(invItem1.getItemCode());
invItemAttributeMapper.deleteByItemCode(invItems.get(0).getItemCode()); invItemAttributeMapper.deleteByItemCode(invItem1.getItemCode());
invItemPmpMapper.deleteByPlucode(plucode); invItemPmpMapper.deleteByPlucode(plucode);
} }
InvItem invItem=new InvItem(); InvItem invItem=new InvItem();
......
...@@ -15,6 +15,9 @@ import org.slf4j.Logger; ...@@ -15,6 +15,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import orthopedics.controller.error.ErrorEnum; import orthopedics.controller.error.ErrorEnum;
import orthopedics.controller.operation.ShipProcessEnum; import orthopedics.controller.operation.ShipProcessEnum;
import orthopedics.dao.InvAccessMapper;
import orthopedics.dao.SysRoleMapper;
import orthopedics.dao.SysUserRoleMapper;
import orthopedics.model.InvItem; import orthopedics.model.InvItem;
import orthopedics.model.InvItemLot; import orthopedics.model.InvItemLot;
import orthopedics.model.InvItemSerial; import orthopedics.model.InvItemSerial;
...@@ -134,6 +137,8 @@ public class ShipController { ...@@ -134,6 +137,8 @@ public class ShipController {
header.setCreateBy(sysAccessToken.getUserName()); header.setCreateBy(sysAccessToken.getUserName());
header.setCreateTime(now); header.setCreateTime(now);
Object orgCode = organzitionServer.selectByUserId(sysAccessToken.getUserId()).get("org_code"); Object orgCode = organzitionServer.selectByUserId(sysAccessToken.getUserId()).get("org_code");
if (orgCode != null) { if (orgCode != null) {
header.setSysOrgCode((String) orgCode); header.setSysOrgCode((String) orgCode);
} }
...@@ -359,6 +364,12 @@ public class ShipController { ...@@ -359,6 +364,12 @@ public class ShipController {
return responseResult.toJSONString(); return responseResult.toJSONString();
} }
@Autowired
private InvAccessMapper invAccessMapper;
@Autowired
private SysUserRoleMapper sysUserRoleMapper;
@RequestMapping(value = "/header/search", method = RequestMethod.GET) @RequestMapping(value = "/header/search", method = RequestMethod.GET)
public String shipmentHeaderSearch(@RequestParam(value="access_token")String accessToken, public String shipmentHeaderSearch(@RequestParam(value="access_token")String accessToken,
@RequestParam(value = "inv_code", required = false)String invCode, @RequestParam(value = "party_code", required = false)String partyCode, @RequestParam(value = "inv_code", required = false)String invCode, @RequestParam(value = "party_code", required = false)String partyCode,
...@@ -386,7 +397,16 @@ public class ShipController { ...@@ -386,7 +397,16 @@ public class ShipController {
throw ErrorEnum.IllegalParamError.createException("shipment_header_status", shipmentHeaderStatus); throw ErrorEnum.IllegalParamError.createException("shipment_header_status", shipmentHeaderStatus);
} }
} }
List<String> invIds = inventoryServer.selectInvAccessByUserId(sysAccessToken.getUserId()).stream().map(v -> v.getInvId()).distinct().collect(Collectors.toList()); //List<String> invIds = inventoryServer.selectInvAccessByUserId(sysAccessToken.getUserId()).stream().map(v -> v.getInvId()).distinct().collect(Collectors.toList());
List<String> invIds=new ArrayList<>();
List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectRoleByUserId(sysAccessToken.getUserId(),LocalDateTime.now());
if(sysUserRoles==null || sysUserRoles.size()<=0){
throw ErrorEnum.IllegalParamError.createException("UserId", sysAccessToken.getUserId());
}
for (SysUserRole sysUserRole:sysUserRoles) {
List<String> attribute1 = invAccessMapper.getAttribute1(sysUserRole.getRoleId(), LocalDateTime.now());
invIds.addAll(attribute1);
}
if (invIds.size() <= 0) { if (invIds.size() <= 0) {
logger.info(String.format("该用户%s没有配置可访问的仓库", sysAccessToken.getUserName())); logger.info(String.format("该用户%s没有配置可访问的仓库", sysAccessToken.getUserName()));
...@@ -437,7 +457,16 @@ public class ShipController { ...@@ -437,7 +457,16 @@ public class ShipController {
} }
} }
JSONArray lines = new JSONArray(); JSONArray lines = new JSONArray();
List<String> invIds = inventoryServer.selectInvAccessByUserId(sysAccessToken.getUserId()).stream().map(v -> v.getInvId()).distinct().collect(Collectors.toList()); //List<String> invIds = inventoryServer.selectInvAccessByUserId(sysAccessToken.getUserId()).stream().map(v -> v.getInvId()).distinct().collect(Collectors.toList());
List<String> invIds=new ArrayList<>();
List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectRoleByUserId(sysAccessToken.getUserId(),LocalDateTime.now());
if(sysUserRoles==null || sysUserRoles.size()<=0){
throw ErrorEnum.IllegalParamError.createException("UserId", sysAccessToken.getUserId());
}
for (SysUserRole sysUserRole:sysUserRoles) {
List<String> attribute1 = invAccessMapper.getAttribute1(sysUserRole.getRoleId(), LocalDateTime.now());
invIds.addAll(attribute1);
}
if (invIds.size() <= 0) { if (invIds.size() <= 0) {
logger.info(String.format("该用户%s没有配置可访问的仓库", sysAccessToken.getUserName())); logger.info(String.format("该用户%s没有配置可访问的仓库", sysAccessToken.getUserName()));
......
...@@ -85,7 +85,7 @@ int updateInvCountHeaderStatus(@Param("status") String status, @Param("id") Stri ...@@ -85,7 +85,7 @@ int updateInvCountHeaderStatus(@Param("status") String status, @Param("id") Stri
public InvCountHeader fingByCountNumber(@Param("countNumber") String countNumber); public InvCountHeader fingByCountNumber(@Param("countNumber") String countNumber);
//根据header_status查询 //根据header_status查询
@Select("select * from inv_count_header where header_status = #{status}") @Select("select * from inv_count_header where header_status = #{status} and inv_id = #{invId}")
@ResultMap("invcountheader") @ResultMap("invcountheader")
public List<InvCountHeader> fingByHeaderStatus(@Param("status") String status); public List<InvCountHeader> fingByHeaderStatus(@Param("status") String status,@Param("invId") String invId);
} }
\ No newline at end of file
...@@ -83,4 +83,11 @@ Integer insert(InvInventory InvInventory); ...@@ -83,4 +83,11 @@ Integer insert(InvInventory InvInventory);
@Select("SELECT * FROM inv_inventory WHERE sortid = #{sortid}") @Select("SELECT * FROM inv_inventory WHERE sortid = #{sortid}")
@ResultMap("invinventory") @ResultMap("invinventory")
InvInventory findBySortid(@Param("sortid") String sortid); InvInventory findBySortid(@Param("sortid") String sortid);
@Select("SELECT sortid FROM inv_inventory")
List<String> getSortidAll();
//查询书吧仓库
@Select("SELECT id,org_id,,sortid FROM inv_inventory where inv_desc='-1'")
List<InvInventory> getSortidByInvDesc();
} }
\ No newline at end of file
...@@ -121,7 +121,7 @@ public interface InvItemMapper{ ...@@ -121,7 +121,7 @@ public interface InvItemMapper{
@Select("SELECT * FROM inv_item WHERE plucode = #{plucode}") @Select("SELECT * FROM inv_item WHERE plucode = #{plucode}")
@ResultMap("invitem") @ResultMap("invitem")
List<InvItem> selectByPlucode( @Param("plucode") String plucode); InvItem selectByPlucode(@Param("plucode") String plucode);
@Delete("DELETE FROM inv_item WHERE plucode = #{plucode}") @Delete("DELETE FROM inv_item WHERE plucode = #{plucode}")
int deleteByPlucode( @Param("plucode") String plucode); int deleteByPlucode( @Param("plucode") String plucode);
...@@ -143,4 +143,12 @@ public interface InvItemMapper{ ...@@ -143,4 +143,12 @@ public interface InvItemMapper{
@Select("SELECT item_code FROM inv_item WHERE plucode = #{plucode}") @Select("SELECT item_code FROM inv_item WHERE plucode = #{plucode}")
String getPlucode(@Param("plucode") String plucode); String getPlucode(@Param("plucode") String plucode);
@Select("SELECT id,item_code,item_name,item_desc FROM inv_item WHERE plucode = #{plucode}")
@ResultMap("invitem")
InvItem findAllByPlucode(@Param("plucode") String plucode);
@Select("SELECT plucode FROM inv_item")
List<String> getPlucodeAll();
} }
\ No newline at end of file
...@@ -122,4 +122,7 @@ public interface InvTransactionMapper{ ...@@ -122,4 +122,7 @@ public interface InvTransactionMapper{
"i.inv_id = w.inv_id AND i.subinv_id = w.default_shipping_subinv_id AND i.locator_id = w.default_shipping_locator_id " + "i.inv_id = w.inv_id AND i.subinv_id = w.default_shipping_subinv_id AND i.locator_id = w.default_shipping_locator_id " +
"and item_id = #{itemId}") "and item_id = #{itemId}")
Integer selectByOrgIdAndItemId(@Param("orgId")String orgId,@Param("itemId")String itemId); Integer selectByOrgIdAndItemId(@Param("orgId")String orgId,@Param("itemId")String itemId);
@Select("select id from inv_transaction where item_id=#{itemId}")
public String findIdByItemId(@Param("itemId")String itemId);
} }
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.PurSupplierContact;
/**
* @author author
*/
public interface PurSupplierContactMapper{
@Select("SELECT * FROM pur_supplier_contact")
@Results(id = "pursuppliercontact", value ={
@Result(property = "id", column = "id"),
@Result(property = "createBy", column = "create_by"),
@Result(property = "createTime", column = "create_time"),
@Result(property = "updateBy", column = "update_by"),
@Result(property = "updateTime", column = "update_time"),
@Result(property = "attributeCategory", column = "attribute_category"),
@Result(property = "attribute1", column = "attribute1"),
@Result(property = "attribute2", column = "attribute2"),
@Result(property = "attribute3", column = "attribute3"),
@Result(property = "attribute4", column = "attribute4"),
@Result(property = "attribute5", column = "attribute5"),
@Result(property = "attribute6", column = "attribute6"),
@Result(property = "attribute7", column = "attribute7"),
@Result(property = "attribute8", column = "attribute8"),
@Result(property = "attribute9", column = "attribute9"),
@Result(property = "attribute10", column = "attribute10"),
@Result(property = "supplierId", column = "supplier_id"),
@Result(property = "supplierSiteId", column = "supplier_site_id"),
@Result(property = "contactType", column = "contact_type"),
@Result(property = "contactName", column = "contact_name"),
@Result(property = "country", column = "country"),
@Result(property = "province", column = "province"),
@Result(property = "city", column = "city"),
@Result(property = "county", column = "county"),
@Result(property = "town", column = "town"),
@Result(property = "address", column = "address"),
@Result(property = "postalCode", column = "postal_code"),
@Result(property = "telephone", column = "telephone"),
@Result(property = "fax", column = "fax"),
@Result(property = "contactDesc", column = "contact_desc"),
@Result(property = "email", column = "email"),
@Result(property = "wechatOpenId", column = "wechat_open_id"),
@Result(property = "status", column = "status"),
})
public List<PurSupplierContact> select();
@Insert("<script>" +
"INSERT INTO pur_supplier_contact(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_id,contact_type,contact_name,country,province,city,county,town,address,postal_code,telephone,fax,contact_desc,email,wechat_open_id,status) VALUES" +
"<foreach collection='pursuppliercontacts' item='item' index='index' separator=','>" +
"(#{item.id},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.attributeCategory},#{item.attribute1},#{item.attribute2},#{item.attribute3},#{item.attribute4},#{item.attribute5},#{item.attribute6},#{item.attribute7},#{item.attribute8},#{item.attribute9},#{item.attribute10},#{item.supplierId},#{item.supplierSiteId},#{item.contactType},#{item.contactName},#{item.country},#{item.province},#{item.city},#{item.county},#{item.town},#{item.address},#{item.postalCode},#{item.telephone},#{item.fax},#{item.contactDesc},#{item.email},#{item.wechatOpenId},#{item.status})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("pursuppliercontacts") List<PurSupplierContact> PurSupplierContactList);
@Insert(
"INSERT INTO pur_supplier_contact(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_id,contact_type,contact_name,country,province,city,county,town,address,postal_code,telephone,fax,contact_desc,email,wechat_open_id,status) VALUES" +
"(#{id},#{createBy},#{createTime},#{updateBy},#{updateTime},#{attributeCategory},#{attribute1},#{attribute2},#{attribute3},#{attribute4},#{attribute5},#{attribute6},#{attribute7},#{attribute8},#{attribute9},#{attribute10},#{supplierId},#{supplierSiteId},#{contactType},#{contactName},#{country},#{province},#{city},#{county},#{town},#{address},#{postalCode},#{telephone},#{fax},#{contactDesc},#{email},#{wechatOpenId},#{status})"
)
Integer insert(PurSupplierContact PurSupplierContact);
}
\ No newline at end of file
package orthopedics.dao; package orthopedics.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.*;
import orthopedics.model.PurSupplier; import orthopedics.model.PurSupplier;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
/** /**
* @author cen.zhihong * @author cen.zhihong
...@@ -53,6 +49,9 @@ List<PurSupplier> selectById(@Param("id")String id); ...@@ -53,6 +49,9 @@ List<PurSupplier> selectById(@Param("id")String id);
@ResultMap("pursupplier") @ResultMap("pursupplier")
List<PurSupplier> selectByCode(@Param("supplier_code")String supplier_code); List<PurSupplier> selectByCode(@Param("supplier_code")String supplier_code);
@Delete("delete from pur_supplier where supplier_code = #{supplier_code}")
public int deleteByCode(@Param("supplier_code")String supplier_code);
@Insert("<script>" + @Insert("<script>" +
"INSERT INTO pur_supplier(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_type,supplier_code,supplier_name,supplier_short_name,organization_code,tax_registration_code,supplier_desc,status) VALUES" + "INSERT INTO pur_supplier(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_type,supplier_code,supplier_name,supplier_short_name,organization_code,tax_registration_code,supplier_desc,status) VALUES" +
......
...@@ -14,61 +14,54 @@ import org.apache.ibatis.annotations.ResultMap; ...@@ -14,61 +14,54 @@ import org.apache.ibatis.annotations.ResultMap;
*/ */
public interface PurSupplierSiteMapper{ public interface PurSupplierSiteMapper{
@Select("SELECT * FROM pur_supplier_site") @Select("SELECT * FROM pur_supplier_site")
@Results(id = "pursuppliersite", value ={ @Results(id = "pursuppliersite", value ={
@Result(property = "id", column = "id"), @Result(property = "id", column = "id"),
@Result(property = "createBy", column = "create_by"), @Result(property = "createBy", column = "create_by"),
@Result(property = "createTime", column = "create_time"), @Result(property = "createTime", column = "create_time"),
@Result(property = "updateBy", column = "update_by"), @Result(property = "updateBy", column = "update_by"),
@Result(property = "updateTime", column = "update_time"), @Result(property = "updateTime", column = "update_time"),
@Result(property = "attributeCategory", column = "attribute_category"), @Result(property = "attributeCategory", column = "attribute_category"),
@Result(property = "attribute1", column = "attribute1"), @Result(property = "attribute1", column = "attribute1"),
@Result(property = "attribute2", column = "attribute2"), @Result(property = "attribute2", column = "attribute2"),
@Result(property = "attribute3", column = "attribute3"), @Result(property = "attribute3", column = "attribute3"),
@Result(property = "attribute4", column = "attribute4"), @Result(property = "attribute4", column = "attribute4"),
@Result(property = "attribute5", column = "attribute5"), @Result(property = "attribute5", column = "attribute5"),
@Result(property = "attribute6", column = "attribute6"), @Result(property = "attribute6", column = "attribute6"),
@Result(property = "attribute7", column = "attribute7"), @Result(property = "attribute7", column = "attribute7"),
@Result(property = "attribute8", column = "attribute8"), @Result(property = "attribute8", column = "attribute8"),
@Result(property = "attribute9", column = "attribute9"), @Result(property = "attribute9", column = "attribute9"),
@Result(property = "attribute10", column = "attribute10"), @Result(property = "attribute10", column = "attribute10"),
@Result(property = "orgId", column = "org_id"), @Result(property = "supplierId", column = "supplier_id"),
@Result(property = "supplierId", column = "supplier_id"), @Result(property = "supplierSiteType", column = "supplier_site_type"),
@Result(property = "supplierSiteType", column = "supplier_site_type"), @Result(property = "supplierSiteCode", column = "supplier_site_code"),
@Result(property = "supplierSiteCode", column = "supplier_site_code"), @Result(property = "supplierSiteName", column = "supplier_site_name"),
@Result(property = "supplierSiteName", column = "supplier_site_name"), @Result(property = "supplierSiteShortName", column = "supplier_site_short_name"),
@Result(property = "supplierSiteShortName", column = "supplier_site_short_name"), @Result(property = "address", column = "address"),
@Result(property = "country", column = "country"), @Result(property = "postalCode", column = "postal_code"),
@Result(property = "province", column = "province"), @Result(property = "telephone", column = "telephone"),
@Result(property = "city", column = "city"), @Result(property = "fax", column = "fax"),
@Result(property = "county", column = "county"), @Result(property = "status", column = "status"),
@Result(property = "town", column = "town"), @Result(property = "supplierName", column = "supplier_name"),
@Result(property = "address", column = "address"), @Result(property = "supplierCode", column = "supplier_code"),
@Result(property = "postalCode", column = "postal_code"), })
@Result(property = "telephone", column = "telephone"), public List<PurSupplierSite> select();
@Result(property = "fax", column = "fax"),
@Result(property = "locationId", column = "location_id"),
@Result(property = "supplierSiteDesc", column = "supplier_site_desc"),
@Result(property = "defaultFlag", column = "default_flag"),
@Result(property = "status", column = "status"),
})
public List<PurSupplierSite> select();
@Select("SELECT * FROM pur_supplier_site WHERE id = #{id}") @Select("SELECT * FROM pur_supplier_site WHERE id = #{id}")
@ResultMap("pursuppliersite") @ResultMap("pursuppliersite")
List<PurSupplierSite> selectById(@Param("id")String id); List<PurSupplierSite> selectById(@Param("id")String id);
@Insert("<script>" + @Insert("<script>" +
"INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,country,province,city,county,town,address,postal_code,telephone,fax,location_id,supplier_site_desc,default_flag,status) VALUES" + "INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,address,postal_code,telephone,fax,status,supplier_name,supplier_code) VALUES" +
"<foreach collection='pursuppliersites' item='item' index='index' separator=','>" + "<foreach collection='pursuppliersites' item='item' index='index' separator=','>" +
"(#{item.id},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.attributeCategory},#{item.attribute1},#{item.attribute2},#{item.attribute3},#{item.attribute4},#{item.attribute5},#{item.attribute6},#{item.attribute7},#{item.attribute8},#{item.attribute9},#{item.attribute10},#{item.orgId},#{item.supplierId},#{item.supplierSiteType},#{item.supplierSiteCode},#{item.supplierSiteName},#{item.supplierSiteShortName},#{item.country},#{item.province},#{item.city},#{item.county},#{item.town},#{item.address},#{item.postalCode},#{item.telephone},#{item.fax},#{item.locationId},#{item.supplierSiteDesc},#{item.defaultFlag},#{item.status})" + "(#{item.id},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.attributeCategory},#{item.attribute1},#{item.attribute2},#{item.attribute3},#{item.attribute4},#{item.attribute5},#{item.attribute6},#{item.attribute7},#{item.attribute8},#{item.attribute9},#{item.attribute10},#{item.supplierId},#{item.supplierSiteType},#{item.supplierSiteCode},#{item.supplierSiteName},#{item.supplierSiteShortName},#{item.address},#{item.postalCode},#{item.telephone},#{item.fax},#{item.status},#{item.supplierName},#{item.supplierCode})" +
"</foreach>" + "</foreach>" +
"</script>") "</script>")
Integer insertBatch(@Param("pursuppliersites")List<PurSupplierSite> PurSupplierSiteList); Integer insertBatch(@Param("pursuppliersites")List<PurSupplierSite> PurSupplierSiteList);
@Insert( @Insert(
"INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,country,province,city,county,town,address,postal_code,telephone,fax,location_id,supplier_site_desc,default_flag,status) VALUES" + "INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,address,postal_code,telephone,fax,status,supplier_name,supplier_code) VALUES" +
"(#{id},#{createBy},#{createTime},#{updateBy},#{updateTime},#{attributeCategory},#{attribute1},#{attribute2},#{attribute3},#{attribute4},#{attribute5},#{attribute6},#{attribute7},#{attribute8},#{attribute9},#{attribute10},#{orgId},#{supplierId},#{supplierSiteType},#{supplierSiteCode},#{supplierSiteName},#{supplierSiteShortName},#{country},#{province},#{city},#{county},#{town},#{address},#{postalCode},#{telephone},#{fax},#{locationId},#{supplierSiteDesc},#{defaultFlag},#{status})" "(#{id},#{createBy},#{createTime},#{updateBy},#{updateTime},#{attributeCategory},#{attribute1},#{attribute2},#{attribute3},#{attribute4},#{attribute5},#{attribute6},#{attribute7},#{attribute8},#{attribute9},#{attribute10},#{supplierId},#{supplierSiteType},#{supplierSiteCode},#{supplierSiteName},#{supplierSiteShortName},#{address},#{postalCode},#{telephone},#{fax},#{status},#{supplierName},#{supplierCode})"
) )
Integer insert(PurSupplierSite PurSupplierSite); Integer insert(PurSupplierSite PurSupplierSite);
} }
\ No newline at end of file
package orthopedics.dao; package orthopedics.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempItemFomPmp; import orthopedics.model.TempItemFomPmp;
/** /**
...@@ -66,10 +62,22 @@ Integer insert(TempItemFomPmp TempItemFomPmp); ...@@ -66,10 +62,22 @@ Integer insert(TempItemFomPmp TempItemFomPmp);
@Select("select count(temp_item_fom_pmp.`id`) from temp_item_fom_pmp") @Select("select count(temp_item_fom_pmp.`id`) from temp_item_fom_pmp")
Integer findCount(); Integer findCount();
@Select("SELECT * FROM temp_item_fom_pmp LIMIT ${sta},1000") @Select("SELECT * FROM temp_item_fom_pmp where status=0 LIMIT ${sta},50000")
@ResultMap("tempitemfompmp") @ResultMap("tempitemfompmp")
public List<TempItemFomPmp> findLimit(@Param("sta") int sta); public List<TempItemFomPmp> findLimit(@Param("sta") int sta);
@Select("SELECT plucode FROM temp_item_fom_pmp LIMIT ${sta},${end}") @Select("SELECT plucode FROM temp_item_fom_pmp LIMIT ${sta},${end}")
public List<String> findLimitByStaEnd(@Param("sta") int sta,@Param("end") int end); public List<String> findLimitByStaEnd(@Param("sta") int sta,@Param("end") int end);
@Update("UPDATE temp_item_fom_pmp SET temp_item_fom_pmp.status=0 WHERE plucode=#{plucode}")
public void updateByStatus(@Param("plucode") String plucode);
@Delete("DELETE FROM temp_item_fom_pmp WHERE plucode = #{plucode}")
int deleteByPlucode(@Param("plucode") String plucode);
@Select("select plucode from temp_item_fom_pmp where plucode = #{plucode}")
public String getPlucodeByPlucode(@Param("plucode") String plucode);
@Select("select * from temp_item_fom_pmp a where a.plucode not in (select b.plucode from inv_item b)")
public List<TempItemFomPmp> getDifference();
} }
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempPurOrderFomPmp;
/**
* @author author
*/
public interface TempPurOrderFomPmpMapper{
@Select("SELECT * FROM temp_pur_order_fom_pmp")
@Results(id = "temppurorderfompmp", value ={
@Result(property = "id", column = "id"),
@Result(property = "number", column = "number"),
@Result(property = "shop", column = "shop"),
@Result(property = "plucode", column = "plucode"),
@Result(property = "title", column = "title"),
@Result(property = "price", column = "price"),
@Result(property = "qty", column = "qty"),
@Result(property = "hdltime", column = "hdltime"),
})
public List<TempPurOrderFomPmp> select();
@Insert("<script>" +
"INSERT INTO temp_pur_order_fom_pmp(id,number,shop,plucode,title,price,qty,hdltime) VALUES" +
"<foreach collection='temppurorderfompmps' item='item' index='index' separator=','>" +
"(#{item.id},#{item.number},#{item.shop},#{item.plucode},#{item.title},#{item.price},#{item.qty},#{item.hdltime})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("temppurorderfompmps") List<TempPurOrderFomPmp> TempPurOrderFomPmpList);
@Insert(
"INSERT INTO temp_pur_order_fom_pmp(id,number,shop,plucode,title,price,qty,hdltime) VALUES" +
"(#{id},#{number},#{shop},#{plucode},#{title},#{price},#{qty},#{hdltime})"
)
Integer insert(TempPurOrderFomPmp TempPurOrderFomPmp);
@Select("select number feom temp_pur_order_fom_pmp where number = #{number} ")
public String findByNumber(@Param("number") String number);
}
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempRcvReceiptFomPmp;
/**
* @author author
*/
public interface TempRcvReceiptFomPmpMapper{
@Select("SELECT * FROM temp_rcv_receipt_fom_pmp")
@Results(id = "temprcvreceiptfompmp", value ={
@Result(property = "id", column = "id"),
@Result(property = "number", column = "number"),
@Result(property = "shop", column = "shop"),
@Result(property = "descript", column = "descript"),
@Result(property = "rcvby", column = "rcvby"),
@Result(property = "rcvtime", column = "rcvtime"),
@Result(property = "plucode", column = "plucode"),
@Result(property = "title", column = "title"),
@Result(property = "qty", column = "qty"),
@Result(property = "money", column = "money"),
@Result(property = "realmoney", column = "realmoney"),
@Result(property = "status", column = "status"),
})
public List<TempRcvReceiptFomPmp> select();
@Insert("<script>" +
"INSERT INTO temp_rcv_receipt_fom_pmp(id,number,shop,descript,rcvby,rcvtime,plucode,title,qty,money,realmoney,status) VALUES" +
"<foreach collection='temprcvreceiptfompmps' item='item' index='index' separator=','>" +
"(#{item.id},#{item.number},#{item.shop},#{item.descript},#{item.rcvby},#{item.rcvtime},#{item.plucode},#{item.title},#{item.qty},#{item.money},#{item.realmoney},#{item.status})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("temprcvreceiptfompmps")List<TempRcvReceiptFomPmp> TempRcvReceiptFomPmpList);
@Insert(
"INSERT INTO temp_rcv_receipt_fom_pmp(id,number,shop,descript,rcvby,rcvtime,plucode,title,qty,money,realmoney,status) VALUES" +
"(#{id},#{number},#{shop},#{descript},#{rcvby},#{rcvtime},#{plucode},#{title},#{qty},#{money},#{realmoney},#{status})"
)
Integer insert(TempRcvReceiptFomPmp TempRcvReceiptFomPmp);
}
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.*;
import orthopedics.model.TempSalOrderFomPmp;
import org.apache.ibatis.annotations.Param;
/**
* @author author
*/
public interface TempSalOrderFomPmpMapper{
@Select("SELECT * FROM temp_sal_order_fom_pmp")
@Results(id = "tempsalorderfompmp", value ={
@Result(property = "id", column = "id"),
@Result(property = "txntime", column = "txntime"),
@Result(property = "operator", column = "operator"),
@Result(property = "vouchnum", column = "vouchnum"),
@Result(property = "dptcode", column = "dptcode"),
@Result(property = "code", column = "code"),
@Result(property = "qty", column = "qty"),
@Result(property = "price", column = "price"),
@Result(property = "disc", column = "disc"),
@Result(property = "orgamt", column = "orgamt"),
@Result(property = "sequence", column = "sequence"),
@Result(property = "clscode", column = "clscode"),
@Result(property = "display", column = "display"),
@Result(property = "itemdisc", column = "itemdisc"),
@Result(property = "price2", column = "price2"),
@Result(property = "status", column = "status"),
})
public List<TempSalOrderFomPmp> select();
@Insert("<script>" +
"INSERT INTO temp_sal_order_fom_pmp(id,txntime,operator,vouchnum,dptcode,code,qty,price,disc,orgamt,sequence,clscode,display,itemdisc,price2,status) VALUES" +
"<foreach collection='tempsalorderfompmps' item='item' index='index' separator=','>" +
"(#{item.id},#{item.txntime},#{item.operator},#{item.vouchnum},#{item.dptcode},#{item.code},#{item.qty},#{item.price},#{item.disc},#{item.orgamt},#{item.sequence},#{item.clscode},#{item.display},#{item.itemdisc},#{item.price2},#{item.status})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("tempsalorderfompmps")List<TempSalOrderFomPmp> TempSalOrderFomPmpList);
@Insert(
"INSERT INTO temp_sal_order_fom_pmp(id,txntime,operator,vouchnum,dptcode,code,qty,price,disc,orgamt,sequence,clscode,display,itemdisc,price2,status) VALUES" +
"(#{id},#{txntime},#{operator},#{vouchnum},#{dptcode},#{code},#{qty},#{price},#{disc},#{orgamt},#{sequence},#{clscode},#{display},#{itemdisc},#{price2},#{status})"
)
Integer insert(TempSalOrderFomPmp TempSalOrderFomPmp);
@Select("select txntime,operator,vouchnum,uptime from temp_sal_order_fom_pmp")
public List<TempSalOrderFomPmp> getTxntimeAndOperatorAndVouchnumAll();
@Update("update temp_sal_order_fom_pmp set dptcode=#{dptcode} where uptime=#{uptime}")
public void updateByDptcode(@Param("dptcode")String dptcode,@Param("uptime")String uptime);
}
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempSupplierFomPmp;
/**
* @author author
*/
public interface TempSupplierFomPmpMapper{
@Select("SELECT * FROM temp_supplier_fom_pmp")
@Results(id = "tempsupplierfompmp", value ={
@Result(property = "id", column = "id"),
@Result(property = "code", column = "code"),
@Result(property = "fullname", column = "fullname"),
@Result(property = "shortname", column = "shortname"),
@Result(property = "contact", column = "contact"),
@Result(property = "phone", column = "phone"),
@Result(property = "address", column = "address"),
})
public List<TempSupplierFomPmp> select();
@Insert("<script>" +
"INSERT INTO temp_supplier_fom_pmp(id,code,fullname,shortname,contact,phone,address) VALUES" +
"<foreach collection='tempsupplierfompmps' item='item' index='index' separator=','>" +
"(#{item.id},#{item.code},#{item.fullname},#{item.shortname},#{item.contact},#{item.phone},#{item.address})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("tempsupplierfompmps") List<TempSupplierFomPmp> TempSupplierFomPmpList);
@Insert(
"INSERT INTO temp_supplier_fom_pmp(id,code,fullname,shortname,contact,phone,address) VALUES" +
"(#{id},#{code},#{fullname},#{shortname},#{contact},#{phone},#{address})"
)
Integer insert(TempSupplierFomPmp TempSupplierFomPmp);
}
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempWarTransferFomPmp1;
/**
* @author author
*/
public interface TempWarTransferFomPmp1Mapper{
@Select("SELECT * FROM temp_war_transfer_fom_pmp1")
@Results(id = "tempwartransferfompmp1", value ={
@Result(property = "id", column = "id"),
@Result(property = "number", column = "number"),
@Result(property = "shop", column = "shop"),
@Result(property = "rcvshop", column = "rcvshop"),
@Result(property = "finishtime", column = "finishtime"),
@Result(property = "remarks", column = "remarks"),
@Result(property = "plucnt", column = "plucnt"),
@Result(property = "qty", column = "qty"),
@Result(property = "rqty", column = "rqty"),
@Result(property = "money", column = "money"),
@Result(property = "status", column = "status"),
})
public List<TempWarTransferFomPmp1> select();
@Insert("<script>" +
"INSERT INTO temp_war_transfer_fom_pmp1(id,number,shop,rcvshop,finishtime,remarks,plucnt,qty,rqty,money,status) VALUES" +
"<foreach collection='tempwartransferfompmp1s' item='item' index='index' separator=','>" +
"(#{item.id},#{item.number},#{item.shop},#{item.rcvshop},#{item.finishtime},#{item.remarks},#{item.plucnt},#{item.qty},#{item.rqty},#{item.money},#{item.status})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("tempwartransferfompmp1s") List<TempWarTransferFomPmp1> TempWarTransferFomPmp1List);
@Insert(
"INSERT INTO temp_war_transfer_fom_pmp1(id,number,shop,rcvshop,finishtime,remarks,plucnt,qty,rqty,money,status) VALUES" +
"(#{id},#{number},#{shop},#{rcvshop},#{finishtime},#{remarks},#{plucnt},#{qty},#{rqty},#{money},#{status})"
)
Integer insert(TempWarTransferFomPmp1 TempWarTransferFomPmp1);
}
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempWarTransferFomPmp;
/**
* @author author
*/
public interface TempWarTransferFomPmpMapper{
@Select("SELECT * FROM temp_war_transfer_fom_pmp")
@Results(id = "tempwartransferfompmp", value ={
@Result(property = "id", column = "id"),
@Result(property = "number", column = "number"),
@Result(property = "shop", column = "shop"),
@Result(property = "rcvshop", column = "rcvshop"),
@Result(property = "plucode", column = "plucode"),
@Result(property = "title", column = "title"),
@Result(property = "qty", column = "qty"),
@Result(property = "money", column = "money"),
@Result(property = "realmoney", column = "realmoney"),
@Result(property = "status", column = "status"),
})
public List<TempWarTransferFomPmp> select();
@Insert("<script>" +
"INSERT INTO temp_war_transfer_fom_pmp(id,number,shop,rcvshop,plucode,title,qty,money,realmoney,status) VALUES" +
"<foreach collection='tempwartransferfompmps' item='item' index='index' separator=','>" +
"(#{item.id},#{item.number},#{item.shop},#{item.rcvshop},#{item.plucode},#{item.title},#{item.qty},#{item.money},#{item.realmoney},#{item.status})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("tempwartransferfompmps") List<TempWarTransferFomPmp> TempWarTransferFomPmpList);
@Insert(
"INSERT INTO temp_war_transfer_fom_pmp(id,number,shop,rcvshop,plucode,title,qty,money,realmoney,status) VALUES" +
"(#{id},#{number},#{shop},#{rcvshop},#{plucode},#{title},#{qty},#{money},#{realmoney},#{status})"
)
Integer insert(TempWarTransferFomPmp TempWarTransferFomPmp);
}
\ No newline at end of file
package orthopedics.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import orthopedics.model.TempWshShipmentFomPmp;
/**
* @author author
*/
public interface TempWshShipmentFomPmpMapper{
@Select("SELECT * FROM temp_wsh_shipment_fom_pmp")
@Results(id = "tempwshshipmentfompmp", value ={
@Result(property = "id", column = "id"),
@Result(property = "number", column = "number"),
@Result(property = "seq", column = "seq"),
@Result(property = "plucode", column = "plucode"),
@Result(property = "fromrack", column = "fromrack"),
@Result(property = "torack", column = "torack"),
@Result(property = "txndate", column = "txndate"),
@Result(property = "price", column = "price"),
@Result(property = "disc", column = "disc"),
@Result(property = "qty", column = "qty"),
@Result(property = "rcvqty", column = "rcvqty"),
@Result(property = "casenum", column = "casenum"),
})
public List<TempWshShipmentFomPmp> select();
@Insert("<script>" +
"INSERT INTO temp_wsh_shipment_fom_pmp(id,number,seq,plucode,fromrack,torack,txndate,price,disc,qty,rcvqty,casenum) VALUES" +
"<foreach collection='tempwshshipmentfompmps' item='item' index='index' separator=','>" +
"(#{item.id},#{item.number},#{item.seq},#{item.plucode},#{item.fromrack},#{item.torack},#{item.txndate},#{item.price},#{item.disc},#{item.qty},#{item.rcvqty},#{item.casenum})" +
"</foreach>" +
"</script>")
Integer insertBatch(@Param("tempwshshipmentfompmps") List<TempWshShipmentFomPmp> TempWshShipmentFomPmpList);
@Insert(
"INSERT INTO temp_wsh_shipment_fom_pmp(id,number,seq,plucode,fromrack,torack,txndate,price,disc,qty,rcvqty,casenum) VALUES" +
"(#{id},#{number},#{seq},#{plucode},#{fromrack},#{torack},#{txndate},#{price},#{disc},#{qty},#{rcvqty},#{casenum})"
)
Integer insert(TempWshShipmentFomPmp TempWshShipmentFomPmp);
}
\ No newline at end of file
...@@ -38,15 +38,15 @@ public class GlobalExceptionHandler { ...@@ -38,15 +38,15 @@ public class GlobalExceptionHandler {
return JSON.toJSONString(reponseResult); return JSON.toJSONString(reponseResult);
} }
@ExceptionHandler(MyException.class) // @ExceptionHandler(MyException.class)
@ResponseBody // @ResponseBody
public String handleMyException(MyException exception) { // public String handleMyException(MyException exception) {
logger.error(getExceptionTrace(exception)); // logger.error(getExceptionTrace(exception));
logger.info("异常发生:" + exception.getErrorEnum().getErrorCode() + "--" + exception.getErrorEnum().getErrorMsg()); // logger.info("异常发生:" + exception.getErrorEnum().getErrorCode() + "--" + exception.getErrorEnum().getErrorMsg());
Map<String, Object> reponseResult = new HashMap<>(); // Map<String, Object> reponseResult = new HashMap<>();
exception.getErrorEnum().putIntoMap(reponseResult); // exception.getErrorEnum().putIntoMap(reponseResult);
return JSON.toJSONString(reponseResult); // return JSON.toJSONString(reponseResult);
} // }
@ExceptionHandler({PersistenceException.class, DataAccessException.class}) @ExceptionHandler({PersistenceException.class, DataAccessException.class})
@ResponseBody @ResponseBody
......
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempPurOrderFomPmp implements Serializable {
private static final long serialVersionUID = 1573724042918L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* 请配单号
* isNullAble:1
*/
@JSONField(name = "number")
private String number;
/**
* 请配仓号
* isNullAble:1
*/
@JSONField(name = "shop")
private String shop;
/**
* 货号
* isNullAble:1
*/
@JSONField(name = "plucode")
private String plucode;
/**
* 货名
* isNullAble:1
*/
@JSONField(name = "title")
private String title;
/**
* 价格
* isNullAble:1
*/
@JSONField(name = "price")
private java.math.BigDecimal price;
/**
* 数量
* isNullAble:1
*/
@JSONField(name = "qty")
private Integer qty;
/**
* 为空:未转配拣;不为空:已转配拣
* isNullAble:1
*/
@JSONField(name = "hdltime")
private String hdltime;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setNumber(String number){this.number = number;}
public String getNumber(){return this.number;}
public void setShop(String shop){this.shop = shop;}
public String getShop(){return this.shop;}
public void setPlucode(String plucode){this.plucode = plucode;}
public String getPlucode(){return this.plucode;}
public void setTitle(String title){this.title = title;}
public String getTitle(){return this.title;}
public void setPrice(java.math.BigDecimal price){this.price = price;}
public java.math.BigDecimal getPrice(){return this.price;}
public void setQty(Integer qty){this.qty = qty;}
public Integer getQty(){return this.qty;}
public void setHdltime(String hdltime){this.hdltime = hdltime;}
public String getHdltime(){return this.hdltime;}
@Override
public String toString() {
return "TempPurOrderFomPmp{" +
"id='" + id + '\'' +
"number='" + number + '\'' +
"shop='" + shop + '\'' +
"plucode='" + plucode + '\'' +
"title='" + title + '\'' +
"price='" + price + '\'' +
"qty='" + qty + '\'' +
"hdltime='" + hdltime + '\'' +
'}';
}
}
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempRcvReceiptFomPmp implements Serializable {
private static final long serialVersionUID = 1573797812141L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* 分发单号,唯一标识
* isNullAble:1
*/
@JSONField(name = "number")
private String number;
/**
* 仓号
* isNullAble:1
*/
@JSONField(name = "shop")
private String shop;
/**
* 仓号名称
* isNullAble:1
*/
@JSONField(name = "descript")
private String descript;
/**
* 确认人
* isNullAble:1
*/
@JSONField(name = "rcvby")
private String rcvby;
/**
* 确认时间
* isNullAble:1
*/
@JSONField(name = "rcvtime")
private String rcvtime;
/**
* 货号
* isNullAble:1
*/
@JSONField(name = "plucode")
private String plucode;
/**
* 货名
* isNullAble:1
*/
@JSONField(name = "title")
private String title;
/**
* 数量
* isNullAble:1
*/
@JSONField(name = "qty")
private Integer qty;
/**
* 码洋
* isNullAble:1
*/
@JSONField(name = "money")
private java.math.BigDecimal money;
/**
* 实洋
* isNullAble:1
*/
@JSONField(name = "realmoney")
private java.math.BigDecimal realmoney;
/**
* 状态
* isNullAble:1
*/
@JSONField(name = "status")
private Integer status;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setNumber(String number){this.number = number;}
public String getNumber(){return this.number;}
public void setShop(String shop){this.shop = shop;}
public String getShop(){return this.shop;}
public void setDescript(String descript){this.descript = descript;}
public String getDescript(){return this.descript;}
public void setRcvby(String rcvby){this.rcvby = rcvby;}
public String getRcvby(){return this.rcvby;}
public void setRcvtime(String rcvtime){this.rcvtime = rcvtime;}
public String getRcvtime(){return this.rcvtime;}
public void setPlucode(String plucode){this.plucode = plucode;}
public String getPlucode(){return this.plucode;}
public void setTitle(String title){this.title = title;}
public String getTitle(){return this.title;}
public void setQty(Integer qty){this.qty = qty;}
public Integer getQty(){return this.qty;}
public void setMoney(java.math.BigDecimal money){this.money = money;}
public java.math.BigDecimal getMoney(){return this.money;}
public void setRealmoney(java.math.BigDecimal realmoney){this.realmoney = realmoney;}
public java.math.BigDecimal getRealmoney(){return this.realmoney;}
public void setStatus(Integer status){this.status = status;}
public Integer getStatus(){return this.status;}
@Override
public String toString() {
return "TempRcvReceiptFomPmp{" +
"id='" + id + '\'' +
"number='" + number + '\'' +
"shop='" + shop + '\'' +
"descript='" + descript + '\'' +
"rcvby='" + rcvby + '\'' +
"rcvtime='" + rcvtime + '\'' +
"plucode='" + plucode + '\'' +
"title='" + title + '\'' +
"qty='" + qty + '\'' +
"money='" + money + '\'' +
"realmoney='" + realmoney + '\'' +
"status='" + status + '\'' +
'}';
}
}
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempSalOrderFomPmp implements Serializable {
private static final long serialVersionUID = 1574306443677L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* 操作时间
* isNullAble:1
*/
@JSONField(name = "txntime")
private java.time.LocalDateTime txntime;
/**
* 收银员账号
* isNullAble:1
*/
@JSONField(name = "operator")
private String operator;
/**
* 小票单号
* isNullAble:1
*/
@JSONField(name = "vouchnum")
private Integer vouchnum;
/**
* 支付方式
* isNullAble:1
*/
@JSONField(name = "dptcode")
private String dptcode;
/**
* 商品条码
* isNullAble:1
*/
@JSONField(name = "code")
private String code;
/**
* 数量
* isNullAble:1
*/
@JSONField(name = "qty")
private Integer qty;
/**
* 单价
* isNullAble:1
*/
@JSONField(name = "price")
private Integer price;
/**
* 折扣
* isNullAble:1
*/
@JSONField(name = "disc")
private Integer disc;
/**
* 订单总价
* isNullAble:1
*/
@JSONField(name = "orgamt")
private Integer orgamt;
/**
* 单据序号
* isNullAble:1
*/
@JSONField(name = "sequence")
private Integer sequence;
/**
* 分类代码(小类)
* isNullAble:1
*/
@JSONField(name = "clscode")
private String clscode;
/**
* 分类代码
* isNullAble:1
*/
@JSONField(name = "display")
private String display;
/**
* 扣款金额
* isNullAble:1
*/
@JSONField(name = "itemdisc")
private Integer itemdisc;
/**
* 每笔支付方式支付的金额
* isNullAble:1
*/
@JSONField(name = "price2")
private Integer price2;
/**
* 状态
* isNullAble:1
*/
@JSONField(name = "status")
private Integer status;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setTxntime(java.time.LocalDateTime txntime){this.txntime = txntime;}
public java.time.LocalDateTime getTxntime(){return this.txntime;}
public void setOperator(String operator){this.operator = operator;}
public String getOperator(){return this.operator;}
public void setVouchnum(Integer vouchnum){this.vouchnum = vouchnum;}
public Integer getVouchnum(){return this.vouchnum;}
public void setDptcode(String dptcode){this.dptcode = dptcode;}
public String getDptcode(){return this.dptcode;}
public void setCode(String code){this.code = code;}
public String getCode(){return this.code;}
public void setQty(Integer qty){this.qty = qty;}
public Integer getQty(){return this.qty;}
public void setPrice(Integer price){this.price = price;}
public Integer getPrice(){return this.price;}
public void setDisc(Integer disc){this.disc = disc;}
public Integer getDisc(){return this.disc;}
public void setOrgamt(Integer orgamt){this.orgamt = orgamt;}
public Integer getOrgamt(){return this.orgamt;}
public void setSequence(Integer sequence){this.sequence = sequence;}
public Integer getSequence(){return this.sequence;}
public void setClscode(String clscode){this.clscode = clscode;}
public String getClscode(){return this.clscode;}
public void setDisplay(String display){this.display = display;}
public String getDisplay(){return this.display;}
public void setItemdisc(Integer itemdisc){this.itemdisc = itemdisc;}
public Integer getItemdisc(){return this.itemdisc;}
public void setPrice2(Integer price2){this.price2 = price2;}
public Integer getPrice2(){return this.price2;}
public void setStatus(Integer status){this.status = status;}
public Integer getStatus(){return this.status;}
@Override
public String toString() {
return "TempSalOrderFomPmp{" +
"id='" + id + '\'' +
"txntime='" + txntime + '\'' +
"operator='" + operator + '\'' +
"vouchnum='" + vouchnum + '\'' +
"dptcode='" + dptcode + '\'' +
"code='" + code + '\'' +
"qty='" + qty + '\'' +
"price='" + price + '\'' +
"disc='" + disc + '\'' +
"orgamt='" + orgamt + '\'' +
"sequence='" + sequence + '\'' +
"clscode='" + clscode + '\'' +
"display='" + display + '\'' +
"itemdisc='" + itemdisc + '\'' +
"price2='" + price2 + '\'' +
"status='" + status + '\'' +
'}';
}
}
\ No newline at end of file
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempSupplierFomPmp implements Serializable {
private static final long serialVersionUID = 1573721281639L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* 供商代码
* isNullAble:1
*/
@JSONField(name = "code")
private String code;
/**
* 供商全称
* isNullAble:1
*/
@JSONField(name = "fullname")
private String fullname;
/**
* 供商简称
* isNullAble:1
*/
@JSONField(name = "shortname")
private String shortname;
/**
* 联系人
* isNullAble:1
*/
@JSONField(name = "contact")
private String contact;
/**
* 联系电话
* isNullAble:1
*/
@JSONField(name = "phone")
private String phone;
/**
* 联系地址
* isNullAble:1
*/
@JSONField(name = "address")
private String address;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setCode(String code){this.code = code;}
public String getCode(){return this.code;}
public void setFullname(String fullname){this.fullname = fullname;}
public String getFullname(){return this.fullname;}
public void setShortname(String shortname){this.shortname = shortname;}
public String getShortname(){return this.shortname;}
public void setContact(String contact){this.contact = contact;}
public String getContact(){return this.contact;}
public void setPhone(String phone){this.phone = phone;}
public String getPhone(){return this.phone;}
public void setAddress(String address){this.address = address;}
public String getAddress(){return this.address;}
@Override
public String toString() {
return "TempSupplierFomPmp{" +
"id='" + id + '\'' +
"code='" + code + '\'' +
"fullname='" + fullname + '\'' +
"shortname='" + shortname + '\'' +
"contact='" + contact + '\'' +
"phone='" + phone + '\'' +
"address='" + address + '\'' +
'}';
}
}
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempWarTransferFomPmp implements Serializable {
private static final long serialVersionUID = 1574323964496L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* pmp调剂单号,唯一标识
* isNullAble:1
*/
@JSONField(name = "number")
private String number;
/**
* 出货仓号
* isNullAble:1
*/
@JSONField(name = "shop")
private String shop;
/**
* 收货仓号
* isNullAble:1
*/
@JSONField(name = "rcvshop")
private String rcvshop;
/**
* 货号
* isNullAble:1
*/
@JSONField(name = "plucode")
private String plucode;
/**
* 货名
* isNullAble:1
*/
@JSONField(name = "title")
private String title;
/**
* 数量
* isNullAble:1
*/
@JSONField(name = "qty")
private Integer qty;
/**
* 码洋
* isNullAble:1
*/
@JSONField(name = "money")
private java.math.BigDecimal money;
/**
* 实洋
* isNullAble:1
*/
@JSONField(name = "realmoney")
private java.math.BigDecimal realmoney;
/**
* 状态
* isNullAble:1
*/
@JSONField(name = "status")
private Integer status;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setNumber(String number){this.number = number;}
public String getNumber(){return this.number;}
public void setShop(String shop){this.shop = shop;}
public String getShop(){return this.shop;}
public void setRcvshop(String rcvshop){this.rcvshop = rcvshop;}
public String getRcvshop(){return this.rcvshop;}
public void setPlucode(String plucode){this.plucode = plucode;}
public String getPlucode(){return this.plucode;}
public void setTitle(String title){this.title = title;}
public String getTitle(){return this.title;}
public void setQty(Integer qty){this.qty = qty;}
public Integer getQty(){return this.qty;}
public void setMoney(java.math.BigDecimal money){this.money = money;}
public java.math.BigDecimal getMoney(){return this.money;}
public void setRealmoney(java.math.BigDecimal realmoney){this.realmoney = realmoney;}
public java.math.BigDecimal getRealmoney(){return this.realmoney;}
public void setStatus(Integer status){this.status = status;}
public Integer getStatus(){return this.status;}
@Override
public String toString() {
return "TempWarTransferFomPmp{" +
"id='" + id + '\'' +
"number='" + number + '\'' +
"shop='" + shop + '\'' +
"rcvshop='" + rcvshop + '\'' +
"plucode='" + plucode + '\'' +
"title='" + title + '\'' +
"qty='" + qty + '\'' +
"money='" + money + '\'' +
"realmoney='" + realmoney + '\'' +
"status='" + status + '\'' +
'}';
}
}
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempWarTransferFomPmp1 implements Serializable {
private static final long serialVersionUID = 1574325830387L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* 单号
* isNullAble:1
*/
@JSONField(name = "number")
private String number;
/**
* 退仓门市
* isNullAble:1
*/
@JSONField(name = "shop")
private String shop;
/**
* 收货门市
* isNullAble:1
*/
@JSONField(name = "rcvshop")
private String rcvshop;
/**
* 收货时间
* isNullAble:1
*/
@JSONField(name = "finishtime")
private String finishtime;
/**
* 备注
* isNullAble:1
*/
@JSONField(name = "remarks")
private String remarks;
/**
* 品种数
* isNullAble:1
*/
@JSONField(name = "plucnt")
private String plucnt;
/**
* 发货数
* isNullAble:1
*/
@JSONField(name = "qty")
private String qty;
/**
* 实收数
* isNullAble:1
*/
@JSONField(name = "rqty")
private java.math.BigDecimal rqty;
/**
* 实洋
* isNullAble:1
*/
@JSONField(name = "money")
private java.math.BigDecimal money;
/**
* 状态
* isNullAble:1
*/
@JSONField(name = "status")
private Integer status;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setNumber(String number){this.number = number;}
public String getNumber(){return this.number;}
public void setShop(String shop){this.shop = shop;}
public String getShop(){return this.shop;}
public void setRcvshop(String rcvshop){this.rcvshop = rcvshop;}
public String getRcvshop(){return this.rcvshop;}
public void setFinishtime(String finishtime){this.finishtime = finishtime;}
public String getFinishtime(){return this.finishtime;}
public void setRemarks(String remarks){this.remarks = remarks;}
public String getRemarks(){return this.remarks;}
public void setPlucnt(String plucnt){this.plucnt = plucnt;}
public String getPlucnt(){return this.plucnt;}
public void setQty(String qty){this.qty = qty;}
public String getQty(){return this.qty;}
public void setRqty(java.math.BigDecimal rqty){this.rqty = rqty;}
public java.math.BigDecimal getRqty(){return this.rqty;}
public void setMoney(java.math.BigDecimal money){this.money = money;}
public java.math.BigDecimal getMoney(){return this.money;}
public void setStatus(Integer status){this.status = status;}
public Integer getStatus(){return this.status;}
@Override
public String toString() {
return "TempWarTransferFomPmp1{" +
"id='" + id + '\'' +
"number='" + number + '\'' +
"shop='" + shop + '\'' +
"rcvshop='" + rcvshop + '\'' +
"finishtime='" + finishtime + '\'' +
"remarks='" + remarks + '\'' +
"plucnt='" + plucnt + '\'' +
"qty='" + qty + '\'' +
"rqty='" + rqty + '\'' +
"money='" + money + '\'' +
"status='" + status + '\'' +
'}';
}
}
package orthopedics.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* @author author
*/
public class TempWshShipmentFomPmp implements Serializable {
private static final long serialVersionUID = 1573800933839L;
/**
* 主键
* 主键
* isNullAble:0
*/
@JSONField(name = "id")
private Integer id;
/**
* 单号
* isNullAble:1
*/
@JSONField(name = "number")
private String number;
/**
* 序号
* isNullAble:1
*/
@JSONField(name = "seq")
private Integer seq;
/**
* 货号
* isNullAble:1
*/
@JSONField(name = "plucode")
private String plucode;
/**
* 调出仓
* isNullAble:1
*/
@JSONField(name = "fromrack")
private String fromrack;
/**
* 调入仓
* isNullAble:1
*/
@JSONField(name = "torack")
private String torack;
/**
*
* isNullAble:1
*/
@JSONField(name = "txndate")
private String txndate;
/**
* 价格
* isNullAble:1
*/
@JSONField(name = "price")
private java.math.BigDecimal price;
/**
* 折扣
* isNullAble:1
*/
@JSONField(name = "disc")
private java.math.BigDecimal disc;
/**
* 下架数量
* isNullAble:1
*/
@JSONField(name = "qty")
private Integer qty;
/**
* 收货数量
* isNullAble:1
*/
@JSONField(name = "rcvqty")
private Integer rcvqty;
/**
* 箱号
* isNullAble:1
*/
@JSONField(name = "casenum")
private String casenum;
public void setId(Integer id){this.id = id;}
public Integer getId(){return this.id;}
public void setNumber(String number){this.number = number;}
public String getNumber(){return this.number;}
public void setSeq(Integer seq){this.seq = seq;}
public Integer getSeq(){return this.seq;}
public void setPlucode(String plucode){this.plucode = plucode;}
public String getPlucode(){return this.plucode;}
public void setFromrack(String fromrack){this.fromrack = fromrack;}
public String getFromrack(){return this.fromrack;}
public void setTorack(String torack){this.torack = torack;}
public String getTorack(){return this.torack;}
public void setTxndate(String txndate){this.txndate = txndate;}
public String getTxndate(){return this.txndate;}
public void setPrice(java.math.BigDecimal price){this.price = price;}
public java.math.BigDecimal getPrice(){return this.price;}
public void setDisc(java.math.BigDecimal disc){this.disc = disc;}
public java.math.BigDecimal getDisc(){return this.disc;}
public void setQty(Integer qty){this.qty = qty;}
public Integer getQty(){return this.qty;}
public void setRcvqty(Integer rcvqty){this.rcvqty = rcvqty;}
public Integer getRcvqty(){return this.rcvqty;}
public void setCasenum(String casenum){this.casenum = casenum;}
public String getCasenum(){return this.casenum;}
@Override
public String toString() {
return "TempWshShipmentFomPmp{" +
"id='" + id + '\'' +
"number='" + number + '\'' +
"seq='" + seq + '\'' +
"plucode='" + plucode + '\'' +
"fromrack='" + fromrack + '\'' +
"torack='" + torack + '\'' +
"txndate='" + txndate + '\'' +
"price='" + price + '\'' +
"disc='" + disc + '\'' +
"qty='" + qty + '\'' +
"rcvqty='" + rcvqty + '\'' +
"casenum='" + casenum + '\'' +
'}';
}
}
...@@ -14,7 +14,7 @@ spring.datasource.driverClassName = com.mysql.jdbc.Driver ...@@ -14,7 +14,7 @@ spring.datasource.driverClassName = com.mysql.jdbc.Driver
#书城测试服务器 #书城测试服务器
#spring.datasource.url = jdbc:mysql://116.62.111.56:3306/bookcity?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true #spring.datasource.url = jdbc:mysql://116.62.111.56:3306/bookcity?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
#书城正式服务器 #书城正式服务器
spring.datasource.url = jdbc:mysql://127.0.0.1:3306/bookcity?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true spring.datasource.url = jdbc:mysql://10.200.5.47:3306/bookcity?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
spring.datasource.username = root spring.datasource.username = root
spring.datasource.password = 123456 spring.datasource.password = 123456
...@@ -25,7 +25,6 @@ spring.datasource.password = 123456 ...@@ -25,7 +25,6 @@ spring.datasource.password = 123456
invoice_output_path = /var/www/orthopedics/invoice/ invoice_output_path = /var/www/orthopedics/invoice/
#\u5E8F\u5217\u7684\u4E0A\u4F20\u8DEF\u5F84 #\u5E8F\u5217\u7684\u4E0A\u4F20\u8DEF\u5F84
UPLOAD_PATH = /var/www/tomcat/upload/serial/ UPLOAD_PATH = /var/www/tomcat/upload/serial/
UPLOAD_PATH_IN_DATABASE = upload/serial/ UPLOAD_PATH_IN_DATABASE = upload/serial/
...@@ -49,5 +48,10 @@ SRB_INV_ITEM = http://116.62.111.56:5000/invItem/ ...@@ -49,5 +48,10 @@ SRB_INV_ITEM = http://116.62.111.56:5000/invItem/
SRB_INV_INVENTORY = http://116.62.111.56:5000/store/ SRB_INV_INVENTORY = http://116.62.111.56:5000/store/
# 打印sql
#logging.level.orthopedics.dao=debug
synchronizationTime = 2019-10-26 00-00-00
temp_fom_pmp_token = 20190904153120997a6088c4da5964015a88fa7a03651c2ff003h5Ol5W04Qp61
...@@ -11,12 +11,12 @@ import java.util.Set; ...@@ -11,12 +11,12 @@ import java.util.Set;
public class Demo { public class Demo {
public static void main(String[] args) { public static void main(String[] args) {
Set s=new HashSet(); // Set s=new HashSet();
IdWorker id=new IdWorker(); // IdWorker id=new IdWorker();
for (long i=0;i<10000000;i++){ // for (long i=0;i<10000000;i++){
s.add(id.nextId()); // s.add(id.nextId());
} // }
System.err.println(s.size()); System.err.println(2/10000==0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment