1.商品库改造

2.用户支付信息录入
master
yangkai 6 years ago
parent 0b666f80c2
commit 90e17cc5b8

@ -0,0 +1,12 @@
package au.com.royalpay.payment.manage.customers.core;
import com.alibaba.fastjson.JSONObject;
public interface CustomerPaymentInfoService {
void saveCustomerPaymentInfo(JSONObject paymentInfo);
void updateCustomerPaymentInfo(JSONObject paymentInfo);
JSONObject selectPaymentInfoByOpenId(String open_id);
}

@ -0,0 +1,39 @@
package au.com.royalpay.payment.manage.customers.core.impls;
import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService;
import au.com.royalpay.payment.manage.mappers.system.SysCustomerPaymentInfoMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class CustomerPaymentInfoImpl implements CustomerPaymentInfoService {
@Resource
private SysCustomerPaymentInfoMapper sysCustomerPaymentInfoMapper;
@Override
public void saveCustomerPaymentInfo(JSONObject paymentInfo) {
if (sysCustomerPaymentInfoMapper.selectPaymentInfo(paymentInfo.getString("wechat_openid")) != null) {
throw new BadRequestException("openid exists");
}
sysCustomerPaymentInfoMapper.save(paymentInfo);
}
@Override
public void updateCustomerPaymentInfo(JSONObject paymentInfo) {
if (paymentInfo.getString("id") == null) {
throw new BadRequestException("ID is not empty");
}
if (sysCustomerPaymentInfoMapper.selectById(paymentInfo.getString("id")) == null) {
throw new BadRequestException("ID:" + paymentInfo.getString("id") + " not exists!");
}
sysCustomerPaymentInfoMapper.update(paymentInfo);
}
@Override
public JSONObject selectPaymentInfoByOpenId(String open_id) {
return sysCustomerPaymentInfoMapper.selectPaymentInfo(open_id);
}
}

@ -0,0 +1,30 @@
package au.com.royalpay.payment.manage.customers.web;
import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/customer/payment")
public class CustomerPaymentInfoController {
@Resource
private CustomerPaymentInfoService customerPaymentInfoService;
@RequestMapping(value = "/save", method = RequestMethod.POST)
public void saveTest(@RequestBody JSONObject paymentInfo) {
customerPaymentInfoService.saveCustomerPaymentInfo(paymentInfo);
}
@RequestMapping(value = "/update", method = RequestMethod.PUT)
public void updateTest(@RequestBody JSONObject paymentInfo) {
customerPaymentInfoService.updateCustomerPaymentInfo(paymentInfo);
}
@RequestMapping(value = "/{openid}/check", method = RequestMethod.GET)
public JSONObject selectTest(@PathVariable String openid) {
return customerPaymentInfoService.selectPaymentInfoByOpenId(openid);
}
}

@ -0,0 +1,23 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
@AutoMapper(tablename = "sys_customer_payment_info", pkName = "id")
public interface SysCustomerPaymentInfoMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject paymentInfo);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject paymentInfo);
@AutoSql(type = SqlType.SELECT)
JSONObject selectPaymentInfo(@Param(value = "wechat_openid") String open_id);
@AutoSql(type = SqlType.SELECT)
JSONObject selectById(@Param(value = "id") String id);
}

@ -11,6 +11,7 @@ public class ProductBean {
private String name;
private String price;
private String industry;
private String hf_industry;
private String counts;
private String degree;
private String client_moniker;
@ -32,6 +33,9 @@ public class ProductBean {
if (StringUtils.isNotBlank(industry)) {
param.put("industry", industry);
}
if (StringUtils.isNotBlank(hf_industry)) {
param.put("hf_industry", hf_industry);
}
if (StringUtils.isNotBlank(counts)) {
param.put("counts", counts);
}
@ -79,6 +83,14 @@ public class ProductBean {
this.industry = industry;
}
public String getHf_industry() {
return hf_industry;
}
public void setHf_industry(String hf_industry) {
this.hf_industry = hf_industry;
}
public String getCounts() {
return counts;
}

@ -159,6 +159,7 @@ public class ClientProductImpl implements ClientProduct {
object.put("industry", sqlValue[2]);
object.put("counts", sqlValue[3]);
object.put("degree", sqlValue[4]);
object.put("hf_industry", sqlValue[5]);
object.put("client_id", client.getString("client_id"));
object.put("create_id",manager.getString("manager_id"));
object.put("create_time",new Date());

@ -12,6 +12,9 @@
<if test="industry!=null">
and co.industry=#{industry}
</if>
<if test="hf_industry!=null">
and co.hf_industry=#{hf_industry}
</if>
<if test="client_id!=null">
and co.client_id = #{client_id}
</if>

@ -92,6 +92,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.loadProducts(1);
})
};
$scope.loadHfindustry = function () {
$http.get('/static/data/hfindustry.json').then(function (resp) {
$scope.hf_industry = resp.data;
})
};
$scope.loadHfindustry();
$scope.onHfIndustrySelect = function (selectedItem) {
$scope.params.hf_industry = selectedItem.mccCode;
$scope.loadProducts(1);
};
$scope.clearHFIndustry = function () {
$scope.params.hf_industry = null;
$scope.loadProducts(1);
}
$scope.loadProducts(1);
}]);
app.controller('managerAddProductDialogCtrl', ['$scope', '$http','$uibModal','product','$state','commonDialog','industryMap', function ($scope, $http,$uibModal,product,$state,commonDialog,industryMap) {
@ -102,7 +116,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}else {
$scope.edit_or_add = "Add";
}
$scope.save = function () {
$scope.loadHfindustry = function () {
$http.get('/static/data/hfindustry.json').then(function (resp) {
$scope.hf_industry = resp.data;
})
};
$scope.loadHfindustry();
$scope.onHfIndustrySelect = function (selectedItem) {
$scope.product.hf_label = selectedItem.label;
$scope.product.hf_industry = selectedItem.mccCode;
};
$scope.save = function (goodForm) {
if (goodForm.$invalid) {
angular.forEach(goodForm, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
if ($scope.product.commodity_id) {
$http.put('/sys/product', $scope.product).then(function (resp) {
alert("Success");

@ -71,6 +71,18 @@
</div>
</div>
<div class="form-group" ng-if="!product.partner"
ng-class="{'has-error':goodForm.hf_industry.$invalid && goodForm.hf_industry.$dirty}">
<label class="control-label col-sm-2" for="hf-industry-input">* HF Industry</label>
<div class="col-sm-8">
<input class="form-control" id="hf-industry-input" required
name="hf_industry" readonly
ng-model="product.hf_industry|partner_hf_industry"
multi-level-select-popup="hf_industry"
on-select="onHfIndustrySelect($selected)">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':goodForm.degree.$invalid && goodForm.degree.$dirty}">
<label class="control-label col-sm-2" for="degree-input">* Degree</label>

@ -19,17 +19,28 @@
</ui-select>
</div>
<div class="col-sm-6">
<input class="form-control" id="hf-industry-input" required
style="min-width: 150px;"
name="hf_industry" readonly
ng-model="params.hf_industry|partner_hf_industry"
multi-level-select-popup="hf_industry"
placeholder="Select a Hf Industry To Follow Up"
on-select="onHfIndustrySelect($selected)">
<a role="button" ng-if="params.hf_industry" style="position: absolute;margin-top: 7px;top: 0;right: 30px;" ng-click="clearHFIndustry()"><i class="fa fa-close"></i></a>
</div>
</div>
<div class="form-group col-sm-6">
<div class="col-sm-10">
<input type="text" class="form-control"
ng-model="params.search_text" placeholder="请输入商品名称"
ng-enter="loadProducts(1)">
</div>
</div>
<div class="form-group col-sm-1">
<div class="col-sm-2">
<a class="btn btn-primary pull-left" type="button" ng-click="loadProducts(1)"><i
class="fa fa-search"></i></a>
</div>
<div class="form-group col-sm-5">
<div class="pull-right">
</div>
<div class="col-xs-12">
<button class="btn btn-success" type="button" ngf-select="importExcel($file)"
ng-if="importShow==1">
<i class="fa fa-upload"></i> 导入Excel
@ -43,7 +54,6 @@
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title">List of Products</h3>
@ -55,6 +65,7 @@
<th>Product Name</th>
<th>Price</th>
<th>Industry</th>
<th>HF Industry</th>
<th>Counts</th>
<th>Degree</th>
<th>Operate</th>
@ -65,6 +76,7 @@
<td ng-bind="product.name"></td>
<td ng-bind="product.price"></td>
<td ng-bind="product.industry|partner_industry"></td>
<td ng-bind="product.hf_industry|partner_hf_industry"></td>
<td ng-bind="product.counts"></td>
<td ng-bind="product.degree"></td>
<td>

Loading…
Cancel
Save