Commit 27b7e18b authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-10-26

parent 0fa8ee79
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<!-- general form elements disabled --> <!-- general form elements disabled -->
<div class="box box-primary"> <div class="box box-primary">
<form role="form" id="myForm"> <!--<form role="form" id="myForm">-->
<input id="id" name="id" value="$!{data.id}" hidden="true"/> <input id="id" name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body"> <div class="box-body">
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
<a href="#springUrl('/a/order/list')" class="btn btn-default">取消</a> <a href="#springUrl('/a/order/list')" class="btn btn-default">取消</a>
</div> </div>
</div> </div>
</form> <!--</form>-->
<!-- /.box-body --> <!-- /.box-body -->
</div><!-- /.box --> </div><!-- /.box -->
...@@ -434,7 +434,12 @@ ...@@ -434,7 +434,12 @@
} }
}) })
if (arr.length > 0) { if (arr.length > 0) {
alert('商品名称不能重复') Cfapp.alert({
message: "无法增加重复商品!",
btntext: "确定",
success: function () {
}
});
return; return;
} }
var id = $("#id").val() var id = $("#id").val()
...@@ -464,20 +469,31 @@ ...@@ -464,20 +469,31 @@
url: url, url: url,
type: "POST", type: "POST",
dateType:'json', dateType:'json',
headers:{"Accept": "application/json; charset=utf-8"}, headers:{"Accept": "application/json;charset=UTF-8"},
data : {_csrf:csrf,_csrf_header:csrf_header,"datas":JSON.stringify(datas)}, data : {_csrf:csrf,_csrf_header:csrf_header,datas:JSON.stringify(datas)},
success :function (rsp) { success :function (rsp) {
if(rsp.errorNO == "0"){ console.log(rsp);
console.log(rsp.errorNO) if(rsp.errorNo == "0"){
alert("修改成功") Cfapp.alert({
location.href = "#springUrl('/a/order/list')"; message: "修改成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}else{ }else{
alert("修改失败") Cfapp.alert({
location.href = "#springUrl('/a/order/list')"; message: "修改失败",
btntext: "确定",
success: function () {
let idTmp = $('input[name="id"]').val();
location.href = "#springUrl('/a/order/form?id="+idTmp+"')";
}
});
} }
} }
}) });
} }
// var recdTypeAdd = function () { // var recdTypeAdd = function () {
......
...@@ -11,7 +11,6 @@ import com.cftech.core.sql.Conds; ...@@ -11,7 +11,6 @@ import com.cftech.core.sql.Conds;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -23,11 +22,11 @@ import java.util.List; ...@@ -23,11 +22,11 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 订单管理ServiceImpl * 订单管理ServiceImpl
* *
* @author Licc * @author Licc
* @date: 2020-10-10 14:20 * @date: 2020-10-10 14:20
*/ */
@Service("orderService") @Service("orderService")
public class OrderServiceImpl extends GenericServiceImpl<Order> implements OrderService { public class OrderServiceImpl extends GenericServiceImpl<Order> implements OrderService {
...@@ -47,7 +46,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -47,7 +46,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
params.put("offset", page > 0 ? page : 0); params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0); params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort); params.put("sort", sort);
if (!StringUtils.equals(id,"1")){ if (!StringUtils.equals(id, "1")) {
params.put("id", id); params.put("id", id);
} }
...@@ -74,60 +73,61 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -74,60 +73,61 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
public com.alibaba.fastjson.JSONObject newlyAdded(String datas, Long accountsId) { public com.alibaba.fastjson.JSONObject newlyAdded(String datas, Long accountsId) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject();
OrderDetailDto orderDetailDto = null; OrderDetailDto orderDetailDto = null;
Map<String, Object> params = new HashMap<String, Object>();; Map<String, Object> params = new HashMap<String, Object>();
datas = datas.replaceAll("&quot;","\""); ;
datas = datas.replaceAll("&quot;", "\"");
JSONArray jsonArray = JSONArray.fromObject(datas); JSONArray jsonArray = JSONArray.fromObject(datas);
boolean isAnim = false; boolean isAnim = false;
try { try {
if (jsonArray.size()>0){ if (jsonArray.size() > 0) {
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
long id = jsonObject.getLong("id"); long id = jsonObject.getLong("id");
String idDetail = jsonObject.getString("idDetail"); String idDetail = jsonObject.getString("idDetail");
long productId = jsonObject.getLong("productId"); long productId = jsonObject.getLong("productId");
long drugsNum = jsonObject.getLong("drugsNum"); long drugsNum = jsonObject.getLong("drugsNum");
double price = jsonObject.getDouble("price"); double price = jsonObject.getDouble("price");
double amount = jsonObject.getDouble("amount"); double amount = jsonObject.getDouble("amount");
double orderAmount = jsonObject.getDouble("orderAmount"); double orderAmount = jsonObject.getDouble("orderAmount");
params.put("id",id); params.put("id", id);
params.put("accountsId",accountsId); params.put("accountsId", accountsId);
params.put("productId",productId); params.put("productId", productId);
params.put("drugsNum",drugsNum); params.put("drugsNum", drugsNum);
params.put("price",price); params.put("price", price);
params.put("amount",amount); params.put("amount", amount);
params.put("orderAmount",orderAmount); params.put("orderAmount", orderAmount);
params.put("idDetail",idDetail); params.put("idDetail", idDetail);
if (!isAnim){ if (!isAnim) {
orderMapper.updateDetill(params); orderMapper.updateDetill(params);
isAnim = true; isAnim = true;
} }
ProductDto productDtos = orderMapper.fetchProduct(params); ProductDto productDtos = orderMapper.fetchProduct(params);
orderDetailDto = new OrderDetailDto(); orderDetailDto = new OrderDetailDto();
Order orders = orderMapper.fetchOrder(id); Order orders = orderMapper.fetchOrder(id);
orderDetailDto.setOrderId(id); orderDetailDto.setOrderId(id);
orderDetailDto.setOrderCode(orders.getOrderCode()); orderDetailDto.setOrderCode(orders.getOrderCode());
orderDetailDto.setDrugsId(productDtos.getId()); orderDetailDto.setDrugsId(productDtos.getId());
orderDetailDto.setOpenid(orders.getOpenid()); orderDetailDto.setOpenid(orders.getOpenid());
orderDetailDto.setPrice(productDtos.getPrice()); orderDetailDto.setPrice(productDtos.getPrice());
orderDetailDto.setAmount(amount); orderDetailDto.setAmount(amount);
orderDetailDto.setDrugsNum(drugsNum); orderDetailDto.setDrugsNum(drugsNum);
orderDetailDto.setDrugsCode(productDtos.getProductNumber()); orderDetailDto.setDrugsCode(productDtos.getProductNumber());
orderDetailDto.setDrugsSku(productDtos.getFormat()); orderDetailDto.setDrugsSku(productDtos.getFormat());
orderDetailDto.setAccountsId(accountsId); orderDetailDto.setAccountsId(accountsId);
Integer detill = orderMapper.saveDetill(orderDetailDto); Integer detill = orderMapper.saveDetill(orderDetailDto);
if (detill>0){ if (detill > 0) {
Integer integer = orderMapper.updateOrder(params); Integer integer = orderMapper.updateOrder(params);
if (integer>0){ if (integer > 0) {
rtnJson.put("errorNO","0"); rtnJson.put("errorNo", "0");
}
} }
}
} }
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO","1"); rtnJson.put("errorNo", "1");
} }
return rtnJson; return rtnJson;
......
...@@ -100,7 +100,6 @@ public class OrderController { ...@@ -100,7 +100,6 @@ public class OrderController {
public JSONObject formData(HttpServletRequest request,String datas) { public JSONObject formData(HttpServletRequest request,String datas) {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
JSONObject jsonObject = orderService.newlyAdded(datas, accountsId); JSONObject jsonObject = orderService.newlyAdded(datas, accountsId);
System.out.println(jsonObject);
return jsonObject; return jsonObject;
} }
......
...@@ -198,14 +198,14 @@ ...@@ -198,14 +198,14 @@
CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county, CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county,
CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address, CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address,
t.address_id addressId, t.address_id addressId,
DATE_FORMAT(t.send_express_date, '%Y-%m-%d %H:%i') sendExpressDate, DATE_FORMAT(t.send_express_date, '%Y-%m-%d %H:%i') sendExpressDateStr,
DATE_FORMAT(t.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDate, DATE_FORMAT(t.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr,
t.waybill_remark waybillRemark, t.waybill_remark waybillRemark,
t.accounts_id accountsId, t.accounts_id accountsId,
t.del_flag delFlag, t.del_flag delFlag,
t.status, t.status,
t.create_time createTime, t.create_time createTimeStr,
t.update_time updateTime, t.update_time updateTimeStr,
t.description, t.description,
t.create_by, t.create_by,
t.update_by, t.update_by,
...@@ -253,14 +253,14 @@ ...@@ -253,14 +253,14 @@
CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county, CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county,
CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address, CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address,
t.address_id addressId, t.address_id addressId,
DATE_FORMAT(t.send_express_date, '%Y-%m-%d %H:%i') sendExpressDate, DATE_FORMAT(t.send_express_date, '%Y-%m-%d %H:%i') sendExpressDateStr,
DATE_FORMAT(t.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDate, DATE_FORMAT(t.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr,
t.waybill_remark waybillRemark, t.waybill_remark waybillRemark,
t.accounts_id accountsId, t.accounts_id accountsId,
t.del_flag delFlag, t.del_flag delFlag,
t.status, t.status,
DATE_FORMAT(t.create_time, '%Y-%m-%d %H:%i') createTime, DATE_FORMAT(t.create_time, '%Y-%m-%d %H:%i') createTimeStr,
DATE_FORMAT(t.update_time, '%Y-%m-%d %H:%i') updateTime, DATE_FORMAT(t.update_time, '%Y-%m-%d %H:%i') updateTimeStr,
t.description, t.description,
t.create_by, t.create_by,
t.update_by, t.update_by,
......
...@@ -108,6 +108,10 @@ public class Waybill implements Serializable { ...@@ -108,6 +108,10 @@ public class Waybill implements Serializable {
private String memberName;//会员名称 private String memberName;//会员名称
private String consultSheetCode;//咨询单编码 private String consultSheetCode;//咨询单编码
private String storageManageName;//仓管员名称 private String storageManageName;//仓管员名称
private String sendExpressDateStr;
private String acceptExpressDateStr;
private String createTimeStr;
private String updateTimeStr;
public Waybill() { public Waybill() {
this.delFlag = false; this.delFlag = false;
......
...@@ -148,38 +148,38 @@ ...@@ -148,38 +148,38 @@
<!--</div>--> <!--</div>-->
<!--</div>--> <!--</div>-->
<div class="form-group" style="display:none"> <!--<div class="form-group" style="display:none">-->
<select class="form-control select2 qyaccount" style="display:none" <!--<select class="form-control select2 qyaccount" style="display:none"-->
data-placeholder="请选择企业号"> <!--data-placeholder="请选择企业号">-->
#foreach( $account in $qyaccounts ) <!--#foreach( $account in $qyaccounts )-->
<option value="${account.id}">${account.description}</option> <!--<option value="${account.id}">${account.description}</option>-->
#end <!--#end-->
</select> <!--</select>-->
$qyUserRoles, $roles <!--$qyUserRoles, $roles-->
<select class="form-control select2 qyrole" style="width:100%;display:none" <!--<select class="form-control select2 qyrole" style="width:100%;display:none"-->
multiple="multiple" data-placeholder="请选择角色"> <!--multiple="multiple" data-placeholder="请选择角色">-->
#foreach( $role in $roles ) <!--#foreach( $role in $roles )-->
<option value="${role.id}" data-attr="${role.roleSign}">${role.roleName} <!--<option value="${role.id}" data-attr="${role.roleSign}">${role.roleName}-->
</option> <!--</option>-->
#end <!--#end-->
</select> <!--</select>-->
</div> <!--</div>-->
<div class="form-group"> <!--<div class="form-group">-->
<table id="qytable" class="table"> <!--<table id="qytable" class="table">-->
<thead> <!--<thead>-->
<tr> <!--<tr>-->
<th style="width:15%;"><label>企业号</label></th> <!--<th style="width:15%;"><label>企业号</label></th>-->
<th style="width:45%;"><label>角色</label></th> <!--<th style="width:45%;"><label>角色</label></th>-->
<th style="width:30%;"></th> <!--<th style="width:30%;"></th>-->
</tr> <!--</tr>-->
</thead> <!--</thead>-->
<tbody> <!--<tbody>-->
</tbody> <!--</tbody>-->
</table> <!--</table>-->
</div> <!--</div>-->
<button type="button" class="btn btn-info" id="addQyAccounts" >添加企业号</button> <!--<button type="button" class="btn btn-info" id="addQyAccounts" >添加企业号</button>-->
<div class="form-group" style="display:none"> <div class="form-group" style="display:none">
<select class="form-control select2 account" style="display:none" <select class="form-control select2 account" style="display:none"
......
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