Commit 74142c64 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-28

parent 58f22923
......@@ -46,11 +46,12 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I
public JSONObject selectInvoiceDetail(InvoiceDetail invoiceDetail) {
JSONObject jsonObject = new JSONObject();
MpAccountsEntity mpAccountsEntity = null;
if (StringUtils.isNotBlank(invoiceDetail.getAppId())){
if (StringUtils.isNotBlank(invoiceDetail.getAppId())) {
mpAccountsEntity = mpAccountsService.getMpAccountsAppid(invoiceDetail.getAppId());
}else{
} else {
jsonObject.put("errorNo","2");
jsonObject.put("errorMsg","appId不能为空");
return jsonObject;
}
try {
......
......@@ -6,7 +6,6 @@ import com.cftech.invoice.service.InvoiceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
......@@ -25,7 +24,7 @@ public class MobileInvoiceController {
* @return
*/
@RequestMapping(value = "/invoiceDetail", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject invoiceDetail (@RequestBody InvoiceDetail invoiceDetail){
public JSONObject invoiceDetail (InvoiceDetail invoiceDetail){
return invoiceService.selectInvoiceDetail(invoiceDetail);
}
......
......@@ -56,6 +56,31 @@
<div class="wrapper">
<div class="content-wrapper" style="margin-left:0;">
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="message-text" class="col-form-label" id="labels">商品不在订单中</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">确定</button>
</div>
</div>
</div>
</div>
<section class="content-header">
<h1>
需求清单出库管理
......@@ -270,76 +295,67 @@
}
//扫码全局变量
var scanCodeStr = "";
var sumScanCode = "";
var scanSubCode = "";
var avgTime = 30;
var lastTime = 0;
var lastTime = 0;//最后一次扫码时间
//触发顺序keydown keypress keyup
$(document).on('keydown', function(event){
function scanCode(event) {
let subCode = String.fromCharCode(event.keyCode);
let currTime = new Date().getTime();
let spaceTime = currTime - lastTime;
console.log(event.keyCode + "==");
let currTime = new Date().getTime();//当前时间
let spaceTime = currTime - lastTime;//间隔时间
//扫码间隔大于30,未认为输入
if (lastTime != 0 && spaceTime > avgTime) {
if (lastTime !=0 && spaceTime > avgTime) {
return;
}
if (event.keyCode != 13) {
scanSubCode += subCode;
}
lastTime = currTime;
if (event.keyCode == 13) {
lastTime = 0;
let nextEleV = 0;
let scanNumEle = null;
//获取所有商品编码
let flag = false;
$("#group").find('input[name="productCode"]').each(function() {
let index = 0;
$("#group").find('input[name="productCode"]').each(function(i) {
if ($(this).val() == scanSubCode) {
nextEleV = $(this).next().val();
scanNumEle = $(this).next().next();
index = i;
flag = true;
}
});
if (!flag) {
Cfapp.alert({
message: "商品未在订单中!",
btntext: "确定",
success: function () {}
});
scanSubCode = "";
return;
$("#labels").text("商品不在订单中");
$('#exampleModal').modal('show');
} else {
let orderNum = $("#group").find('input[name="orderNum"]:eq('+index+')').val();
let sendNum = $("#group").find('input[name="sendNum"]:eq('+index+')').val();
if (parseInt(sendNum) >= parseInt(orderNum)) {
$("#labels").text("超过订单商品数量");
$('#exampleModal').modal('show');
} else {
$("#group").find('input[name="sendNum"]:eq('+index+')').val(parseInt(sendNum) + 1);
sumScanCode += scanSubCode + "|";
$('textarea[name="scanGoodsCode"]').text(sumScanCode);
}
scanCodeStr += scanSubCode + "|";
let count = 0;
if (scanCodeStr != "" && scanCodeStr != null) {
let arr = scanCodeStr.split("|");
console.log(arr.length);
for(let i=0; i<arr.length; i++) {
if (arr[i] == scanSubCode)
count++;
}
if (nextEleV < count) {
Cfapp.alert({
message: "商品超过订单数量!",
btntext: "确定",
success: function () {}
});
scanSubCode = "";
return;
}
}
scanNumEle.val(count);
$('textarea[name="scanGoodsCode"]').text(scanCodeStr);
scanSubCode = "";
return;
}
scanSubCode += subCode;
lastTime = currTime;
//触发顺序keydown keypress keyup
$(document).on('keydown', function(event){
console.log("触发1");
scanCode(event);
});
// $(document).on('keypress', function(event){
......@@ -354,20 +370,6 @@
// }
// });
function checkProductCode(code) {
let flag = true;
$("#group").find('input[name="productCode"]').each(function(e) {
if (e.val() == code) {
let count = e.next().val();
let length = $('textarea[name="scanGoodsCode"]').text().split(code).length - 1;
if (count >= length)
return true;
}
});
if (!flag) {
return flag;
}
}
function list() {
var url = "#springUrl('/a/order/fromProduct')"
......@@ -387,21 +389,11 @@
selectProductList = JSON.parse(selectProductList);
for (var i = 0; i < selectProductList.length; i++) {
var obj = selectProductList[i];
// if($(this).val() == obj.provinceId){
// $(this).attr('selected', 'selected');
// }
console.log(obj);
clickAdd(obj.id, obj.productId, obj.productName, obj.drugsNum, obj.price, obj.amount, obj.productNumber);
}
}
// $('#selectProduct option').each(function () {
// for(var index= 0;i<selectProductList.length;i++){
// var obj = selectProductList[i];
// if($(this).val() == obj.provinceId){
// $(this).attr('selected', 'selected');
// }
// }
//
// })
}
});
}
......@@ -428,20 +420,6 @@
Cfapp.init();
list();
// var selectdrugsNum = $("#selectdrugsNum");
// for (var i = 1; i <=30; i ++){
// selectdrugsNum.append("<option value='"+[i]+"'>"+[i]+"</option>")
// }
// var drugsNum = "$!{data.drugsNum}";
// $('#selectdrugsNum option').each(function () {
// if($(this).val() == drugsNum){
// $(this).attr('selected', 'selected');
// }
// })
});
......@@ -498,10 +476,6 @@
}
function toTal() {
// $('#group').on('click', '.scanGoods', function() {
// $(this).prev().val("11111111111");
// });
var count = 0
$('.group [name="htmlAmount"]').each(function(index, item){
count += +item.value
......@@ -513,47 +487,18 @@
* 保存事件
*/
function save() {
var arr = []
var obj = {}
$('.translate').each((index, item) => {
var txt = $(item).find('[name="releas"]').val()
if (obj[txt]) {
arr.push(index)
return
} else {
obj[txt] = true
}
})
if (arr.length > 0) {
Cfapp.alert({
message: "无法增加重复商品!",
btntext: "确定",
success: function () {
let flag = false;
$("#group").find('.list-group-item').each(function(i) {
if ($(this).find('input[name="orderNum"]').val() != $(this).find('input[name="sendNum"]').val()) {
flag = true;
}
});
if (flag) {
$("#labels").text("订单商品数量和出库数量不一致");
$('#exampleModal').modal('show');
return;
}
var id = $("#id").val();
var orderAmount = $("#orderAmount").val();
var datas = [];
$('.translate').each(function (index,item){
const idDetail = $(item).find('[name="idDetail"]').val()
const productId = $(item).find('[name="releas"]').val()
const drugsNum = $(item).find('[name="listHtml"]').val()
const price = $(item).find('[name="htmlPrice"]').val()
const amount = $(item).find('[name="htmlAmount"]').val()
datas.push({
id : id,
idDetail : idDetail,
productId :productId,
drugsNum : drugsNum,
price : price,
amount : amount,
orderAmount :orderAmount
})
});
var url = "#springUrl('/a/waybill/orderSendOutForWaybill')";
......@@ -575,14 +520,8 @@
}
});
}else{
Cfapp.alert({
message: "出库失败",
btntext: "确定",
success: function () {
let idTmp = $('input[name="id"]').val();
location.href = "#springUrl('/a/order/sendOut?id="+idTmp+"')";
}
});
$("#labels").text("出库失败");
$('#exampleModal').modal('show');
}
}
......
......@@ -566,12 +566,14 @@
t.order_cancel AS orderCancel,
t.status,
DATE_FORMAT(t.create_time,'%Y-%m-%d %h:%i:%s') AS createTime,
DATE_FORMAT(t.order_time,'%Y-%m-%d %h:%i:%s') AS orderTime,
s.address_name AS addressName,
a.areaname AS province,
b.areaname AS city,
c.areaname AS area,
s.phone,
s.address
s.address,
t.confirm
FROM
t_order t
LEFT JOIN t_order_details d ON t.id =d.order_id
......
package com.cftech.order.job;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.model.SysJob;
import com.cftech.accounts.service.JobService;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.SpringContextHolder;
......@@ -18,6 +23,7 @@ import org.quartz.JobExecutionException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -37,6 +43,11 @@ public class OrderFollowupRemindJob implements Job {
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsService mpAccountsService= SpringContextHolder.getBean(MpAccountsService.class);
MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_FOLLOWUP_MSG");
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
......@@ -80,7 +91,13 @@ public class OrderFollowupRemindJob implements Job {
Date nowDate = sdf.parse(sdf.format(new Date()));
if (date.compareTo(nowDate) == 0) {
QyuserService qyuserService = SpringContextHolder.getBean(QyuserService.class);
Qyuser serverUser = qyuserService.fetchById(order.getServiceId());
List<Qyuser> serviceUsers = new ArrayList();
serviceUsers.add(serverUser);
QyMsgUtil qyMsgUtil = SpringContextHolder.getBean(QyMsgUtil.class);
msg += msg + order.getNumber();
qyMsgUtil.sendText(accounts, false, serviceUsers, null, null, agenId, msg, false);
}
} catch (ParseException e) {
e.printStackTrace();
......
......@@ -46,6 +46,11 @@ public class OrderMobile {
private String city;
/*区县*/
private String area;
private String orderTime;
private String confirm;
private List<ProductMobile> ProductMobile;
}
......@@ -307,9 +307,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
try {
Conds conds = new Conds();
conds.in("o.id",invoiceDto.getId().split(","));
conds.equal("o.id", invoiceDto.getId());
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
List<Order> list = orderMapper.fetchSearchBy(conds, null, 0, 0, null);
List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null);
if(list.size() > 0){
for (Order order : list){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -66,7 +66,7 @@ public class MobileOrderController {
* @return
*/
@RequestMapping(value = "/invoice", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject invoice(@RequestBody InvoiceDto invoiceDto){
public JSONObject invoice(InvoiceDto invoiceDto){
return orderService.invoice(invoiceDto);
}
}
......@@ -104,6 +104,14 @@
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品编码</label>
<input type="text" required class="form-control pull-right"
value="$!{data.productNumber}" maxlength="500" required
name="productNumber" placeholder="剂型"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>通用名</label>
<input type="text" required class="form-control pull-right"
......
......@@ -287,6 +287,9 @@
<if test="format != null">
format = #{format, jdbcType=VARCHAR},
</if>
<if test="productNumber != null">
product_number = #{productNumber, jdbcType=VARCHAR},
</if>
<if test="approveNumber != null">
approve_number = #{approveNumber, jdbcType=VARCHAR},
</if>
......
......@@ -107,7 +107,9 @@ public class ProductController {
} else {
product.setAccountsId(accountsId);
product.setDelFlag(false);
if (StringUtils.isBlank(product.getProductNumber())) {
product.setProductNumber(codingruleUtils.getNumber(accountsId,Product.class.getName()));
}
product.setAccountsId(UserUtils.getmpaccounts(request));
product.setCreateBy(UserUtils.getUser().getId());
product.setUpdateBy(UserUtils.getUser().getId());
......
......@@ -32,5 +32,10 @@
<artifactId>shipping-address-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>logistics-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
......@@ -256,7 +256,6 @@ public class ExpressOrderInfoUtils {
retObj.put("trackingType", 1);//1:根据顺丰运单号查询
JSONArray waybills = new JSONArray();
//waybills.add("SF7444420632664");
retObj.put("trackingNumber", waybills);//顺丰运单号
retObj.put("methodType", 1);//标准路由查询
} catch (Exception e) {
......
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 to comment