Commit 90035491 authored by 卜远杰's avatar 卜远杰

Merge remote-tracking branch 'origin/master'

parents 2f1dd9f2 74142c64
...@@ -46,11 +46,12 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I ...@@ -46,11 +46,12 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I
public JSONObject selectInvoiceDetail(InvoiceDetail invoiceDetail) { public JSONObject selectInvoiceDetail(InvoiceDetail invoiceDetail) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
MpAccountsEntity mpAccountsEntity = null; MpAccountsEntity mpAccountsEntity = null;
if (StringUtils.isNotBlank(invoiceDetail.getAppId())){ if (StringUtils.isNotBlank(invoiceDetail.getAppId())) {
mpAccountsEntity = mpAccountsService.getMpAccountsAppid(invoiceDetail.getAppId()); mpAccountsEntity = mpAccountsService.getMpAccountsAppid(invoiceDetail.getAppId());
}else{ } else {
jsonObject.put("errorNo","2"); jsonObject.put("errorNo","2");
jsonObject.put("errorMsg","appId不能为空"); jsonObject.put("errorMsg","appId不能为空");
return jsonObject;
} }
try { try {
......
...@@ -6,7 +6,6 @@ import com.cftech.invoice.service.InvoiceService; ...@@ -6,7 +6,6 @@ import com.cftech.invoice.service.InvoiceService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; 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.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -25,7 +24,7 @@ public class MobileInvoiceController { ...@@ -25,7 +24,7 @@ public class MobileInvoiceController {
* @return * @return
*/ */
@RequestMapping(value = "/invoiceDetail", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @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); return invoiceService.selectInvoiceDetail(invoiceDetail);
} }
......
...@@ -56,6 +56,31 @@ ...@@ -56,6 +56,31 @@
<div class="wrapper"> <div class="wrapper">
<div class="content-wrapper" style="margin-left:0;"> <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"> <section class="content-header">
<h1> <h1>
需求清单出库管理 需求清单出库管理
...@@ -270,76 +295,67 @@ ...@@ -270,76 +295,67 @@
} }
//扫码全局变量 //扫码全局变量
var scanCodeStr = ""; var sumScanCode = "";
var scanSubCode = ""; var scanSubCode = "";
var avgTime = 30; 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 subCode = String.fromCharCode(event.keyCode);
let currTime = new Date().getTime(); console.log(event.keyCode + "==");
let spaceTime = currTime - lastTime;
let currTime = new Date().getTime();//当前时间
let spaceTime = currTime - lastTime;//间隔时间
//扫码间隔大于30,未认为输入 //扫码间隔大于30,未认为输入
if (lastTime != 0 && spaceTime > avgTime) { if (lastTime !=0 && spaceTime > avgTime) {
return; return;
} }
if (event.keyCode != 13) {
scanSubCode += subCode;
}
lastTime = currTime;
if (event.keyCode == 13) { if (event.keyCode == 13) {
lastTime = 0; lastTime = 0;
let nextEleV = 0; //获取所有商品编码
let scanNumEle = null;
let flag = false; 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) { if ($(this).val() == scanSubCode) {
nextEleV = $(this).next().val(); index = i;
scanNumEle = $(this).next().next();
flag = true; flag = true;
} }
}); });
if (!flag) {
Cfapp.alert({
message: "商品未在订单中!",
btntext: "确定",
success: function () {}
});
scanSubCode = "";
return;
}
scanCodeStr += scanSubCode + "|"; if (!flag) {
let count = 0; $("#labels").text("商品不在订单中");
if (scanCodeStr != "" && scanCodeStr != null) { $('#exampleModal').modal('show');
let arr = scanCodeStr.split("|"); } else {
console.log(arr.length); let orderNum = $("#group").find('input[name="orderNum"]:eq('+index+')').val();
for(let i=0; i<arr.length; i++) { let sendNum = $("#group").find('input[name="sendNum"]:eq('+index+')').val();
if (arr[i] == scanSubCode) if (parseInt(sendNum) >= parseInt(orderNum)) {
count++; $("#labels").text("超过订单商品数量");
} $('#exampleModal').modal('show');
if (nextEleV < count) { } else {
Cfapp.alert({ $("#group").find('input[name="sendNum"]:eq('+index+')').val(parseInt(sendNum) + 1);
message: "商品超过订单数量!", sumScanCode += scanSubCode + "|";
btntext: "确定", $('textarea[name="scanGoodsCode"]').text(sumScanCode);
success: function () {}
});
scanSubCode = "";
return;
} }
} }
scanNumEle.val(count);
$('textarea[name="scanGoodsCode"]').text(scanCodeStr);
scanSubCode = ""; scanSubCode = "";
return;
} }
}
scanSubCode += subCode; //触发顺序keydown keypress keyup
lastTime = currTime; $(document).on('keydown', function(event){
console.log("触发1");
scanCode(event);
}); });
// $(document).on('keypress', function(event){ // $(document).on('keypress', function(event){
...@@ -354,20 +370,6 @@ ...@@ -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() { function list() {
var url = "#springUrl('/a/order/fromProduct')" var url = "#springUrl('/a/order/fromProduct')"
...@@ -387,21 +389,11 @@ ...@@ -387,21 +389,11 @@
selectProductList = JSON.parse(selectProductList); selectProductList = JSON.parse(selectProductList);
for (var i = 0; i < selectProductList.length; i++) { for (var i = 0; i < selectProductList.length; i++) {
var obj = selectProductList[i]; var obj = selectProductList[i];
// if($(this).val() == obj.provinceId){ console.log(obj);
// $(this).attr('selected', 'selected');
// }
clickAdd(obj.id, obj.productId, obj.productName, obj.drugsNum, obj.price, obj.amount, obj.productNumber); 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 @@ ...@@ -428,20 +420,6 @@
Cfapp.init(); Cfapp.init();
list(); 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 @@ ...@@ -498,10 +476,6 @@
} }
function toTal() { function toTal() {
// $('#group').on('click', '.scanGoods', function() {
// $(this).prev().val("11111111111");
// });
var count = 0 var count = 0
$('.group [name="htmlAmount"]').each(function(index, item){ $('.group [name="htmlAmount"]').each(function(index, item){
count += +item.value count += +item.value
...@@ -513,47 +487,18 @@ ...@@ -513,47 +487,18 @@
* 保存事件 * 保存事件
*/ */
function save() { function save() {
var arr = [] let flag = false;
var obj = {} $("#group").find('.list-group-item').each(function(i) {
if ($(this).find('input[name="orderNum"]').val() != $(this).find('input[name="sendNum"]').val()) {
$('.translate').each((index, item) => { flag = true;
var txt = $(item).find('[name="releas"]').val()
if (obj[txt]) {
arr.push(index)
return
} else {
obj[txt] = true
} }
}) });
if (arr.length > 0) {
Cfapp.alert({ if (flag) {
message: "无法增加重复商品!", $("#labels").text("订单商品数量和出库数量不一致");
btntext: "确定", $('#exampleModal').modal('show');
success: function () {
}
});
return; 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')"; var url = "#springUrl('/a/waybill/orderSendOutForWaybill')";
...@@ -575,14 +520,8 @@ ...@@ -575,14 +520,8 @@
} }
}); });
}else{ }else{
Cfapp.alert({ $("#labels").text("出库失败");
message: "出库失败", $('#exampleModal').modal('show');
btntext: "确定",
success: function () {
let idTmp = $('input[name="id"]').val();
location.href = "#springUrl('/a/order/sendOut?id="+idTmp+"')";
}
});
} }
} }
......
...@@ -566,12 +566,14 @@ ...@@ -566,12 +566,14 @@
t.order_cancel AS orderCancel, t.order_cancel AS orderCancel,
t.status, t.status,
DATE_FORMAT(t.create_time,'%Y-%m-%d %h:%i:%s') AS createTime, 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, s.address_name AS addressName,
a.areaname AS province, a.areaname AS province,
b.areaname AS city, b.areaname AS city,
c.areaname AS area, c.areaname AS area,
s.phone, s.phone,
s.address s.address,
t.confirm
FROM FROM
t_order t t_order t
LEFT JOIN t_order_details d ON t.id =d.order_id 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;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
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;
/**
* 订单跟进提醒 前7天、当天、后7天 关闭提醒
* Created by 16444 on 2020/11/29.
*/
@Slf4j
public class OrderFollowupRemindJob implements Job {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
boolean isCluster = Boolean.valueOf(SystemConfig.p.getProperty("quartz.isCluster"));
if (!isCluster) {
return;
}
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);
orderConds.notNull("o.remind_type");
orderConds.notEqual("o.remind_type", "0");
OrderService orderService = SpringContextHolder.getBean(OrderService.class);
List<Order> list = orderService.fetchSearchByPage(orderConds, null, 0, 0);
for (Order order: list) {
//未设置提醒或关闭提醒跳出循环
if (StringUtils.isBlank(order.getRemindType()) || StringUtils.equals(order.getRemindType(), "0")) {
continue;
}
String frequency = order.getTakeFrequency();//药品服用频率
if (StringUtils.isBlank(frequency) || !frequency.contains("/")) {
continue;
}
try {
String[] arr = frequency.split("/");
BigDecimal sum = new BigDecimal(arr[1]);//药品总数
BigDecimal avg = new BigDecimal(arr[0]);//每日服用数量
BigDecimal result = sum.divide(avg, 0, BigDecimal.ROUND_HALF_UP);
Date date = sdf.parse(order.getAcceptExpressDateStr());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int day = 0;
if (StringUtils.equals(order.getRemindType(), "1")) {//7天前
day = result.intValue() - 7;
} else if (StringUtils.equals(order.getRemindType(), "2")) {//当天
day = result.intValue();
} else if (StringUtils.equals(order.getRemindType(), "3")) {//7天后
day = result.intValue() + 7;
} else {
continue;
}
calendar.set(Calendar.MONTH, day);
date = calendar.getTime();
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();
} catch (Exception e) {
e.getMessage();
}
}
//获得明细数据
JobDataMap jobInfo = context.getJobDetail().getJobDataMap();
String id = jobInfo.get("uid") == null ? "" : jobInfo.getString("uid");//这个也是ID主键
log.info("任务ID:" + id);
//执行更新操作
if (context.getNextFireTime() != null) {
log.info("订单跟进提醒任务:下次执行时间=====" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(context.getNextFireTime()) + "==============");
} else {
JobService jobService = SpringContextHolder.getBean(JobService.class);
SysJob sysJob = new SysJob();
sysJob.setJobuid(id);
sysJob.setStatus("0");
jobService.updateStatus(sysJob);
log.info("订单跟进提醒任务,已执行完成!");
}
}
}
...@@ -46,6 +46,11 @@ public class OrderMobile { ...@@ -46,6 +46,11 @@ public class OrderMobile {
private String city; private String city;
/*区县*/ /*区县*/
private String area; private String area;
private String orderTime;
private String confirm;
private List<ProductMobile> ProductMobile; private List<ProductMobile> ProductMobile;
} }
...@@ -307,9 +307,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -307,9 +307,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
try { try {
Conds conds = new Conds(); 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); 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){ if(list.size() > 0){
for (Order order : list){ for (Order order : list){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
...@@ -66,7 +66,7 @@ public class MobileOrderController { ...@@ -66,7 +66,7 @@ public class MobileOrderController {
* @return * @return
*/ */
@RequestMapping(value = "/invoice", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @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); return orderService.invoice(invoiceDto);
} }
} }
...@@ -104,6 +104,14 @@ ...@@ -104,6 +104,14 @@
> >
</div> </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"> <div class="form-group form-md-line-input col-md-12">
<label>通用名</label> <label>通用名</label>
<input type="text" required class="form-control pull-right" <input type="text" required class="form-control pull-right"
......
...@@ -287,6 +287,9 @@ ...@@ -287,6 +287,9 @@
<if test="format != null"> <if test="format != null">
format = #{format, jdbcType=VARCHAR}, format = #{format, jdbcType=VARCHAR},
</if> </if>
<if test="productNumber != null">
product_number = #{productNumber, jdbcType=VARCHAR},
</if>
<if test="approveNumber != null"> <if test="approveNumber != null">
approve_number = #{approveNumber, jdbcType=VARCHAR}, approve_number = #{approveNumber, jdbcType=VARCHAR},
</if> </if>
......
...@@ -107,7 +107,9 @@ public class ProductController { ...@@ -107,7 +107,9 @@ public class ProductController {
} else { } else {
product.setAccountsId(accountsId); product.setAccountsId(accountsId);
product.setDelFlag(false); product.setDelFlag(false);
product.setProductNumber(codingruleUtils.getNumber(accountsId,Product.class.getName())); if (StringUtils.isBlank(product.getProductNumber())) {
product.setProductNumber(codingruleUtils.getNumber(accountsId,Product.class.getName()));
}
product.setAccountsId(UserUtils.getmpaccounts(request)); product.setAccountsId(UserUtils.getmpaccounts(request));
product.setCreateBy(UserUtils.getUser().getId()); product.setCreateBy(UserUtils.getUser().getId());
product.setUpdateBy(UserUtils.getUser().getId()); product.setUpdateBy(UserUtils.getUser().getId());
......
...@@ -32,5 +32,10 @@ ...@@ -32,5 +32,10 @@
<artifactId>shipping-address-module</artifactId> <artifactId>shipping-address-module</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>logistics-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -256,7 +256,6 @@ public class ExpressOrderInfoUtils { ...@@ -256,7 +256,6 @@ public class ExpressOrderInfoUtils {
retObj.put("trackingType", 1);//1:根据顺丰运单号查询 retObj.put("trackingType", 1);//1:根据顺丰运单号查询
JSONArray waybills = new JSONArray(); JSONArray waybills = new JSONArray();
//waybills.add("SF7444420632664");
retObj.put("trackingNumber", waybills);//顺丰运单号 retObj.put("trackingNumber", waybills);//顺丰运单号
retObj.put("methodType", 1);//标准路由查询 retObj.put("methodType", 1);//标准路由查询
} catch (Exception e) { } 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