Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #167

Merged
merged 12 commits into from
Aug 2, 2020
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.zhinanzhen.b.controller;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -36,8 +37,11 @@

import com.ikasoa.core.utils.StringUtil;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.read.biff.BiffException;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableSheet;
Expand All @@ -62,6 +66,8 @@ public class CommissionOrderController extends BaseCommissionOrderController {

@Resource
ServiceOrderService serviceOrderService;

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

@RequestMapping(value = "/upload_img", method = RequestMethod.POST)
@ResponseBody
Expand Down Expand Up @@ -766,6 +772,59 @@ public Response<List<CommissionOrderListDTO>> list(@RequestParam(value = "maraId
}
}

@RequestMapping(value = "/upload", method = RequestMethod.POST)
@ResponseBody
public Response<Integer> upload(@RequestParam MultipartFile file, HttpServletRequest request,
HttpServletResponse response) throws IllegalStateException, IOException {
super.setPostHeader(response);
String message = "";
int n = 0;
Response<String> r = super.upload2(file, request.getSession(), "/tmp/");
try (InputStream is = new FileInputStream(r.getData())) {
jxl.Workbook wb = jxl.Workbook.getWorkbook(is);
Sheet sheet = wb.getSheet(0);
for (int i = 1; i < sheet.getRows(); i++) {
Cell[] cells = sheet.getRow(i);
String _id = cells[0].getContents();
String _schoolPaymentAmount = cells[21].getContents();
String _schoolPaymentDate = cells[22].getContents();
String _invoiceNumber = cells[23].getContents();
String _zyDate = cells[23].getContents();
String _sureExpectAmount = cells[26].getContents();
String _bonus = cells[27].getContents();
String _bonusDate = cells[28].getContents();
try {
CommissionOrderListDTO commissionOrderListDto = commissionOrderService
.getCommissionOrderById(Integer.parseInt(_id));
if (commissionOrderListDto == null) {
message += "[" + _id + "]佣金订单不存在;";
continue;
}
if (!CommissionStateEnum.DJY.toString()
.equalsIgnoreCase(commissionOrderListDto.getCommissionState())
&& !CommissionStateEnum.DZY.toString()
.equalsIgnoreCase(commissionOrderListDto.getCommissionState())) {
message += "[" + _id + "]佣金订单状态不是待结佣或待追佣;";
continue;
}
Response<CommissionOrderDTO> _r = updateOne(Integer.parseInt(_id),
Double.parseDouble(_schoolPaymentAmount), sdf.format(_schoolPaymentDate), _invoiceNumber,
sdf.format(_zyDate), Double.parseDouble(_sureExpectAmount), Double.parseDouble(_bonus),
sdf.format(_bonusDate), true);
if (_r.getCode() > 0)
message += "[" + _id + "]" + _r.getMessage() + ";";
else
n++;
} catch (NumberFormatException | ServiceException e) {
message += "[" + _id + "]" + e.getMessage() + ";";
}
}
} catch (BiffException | IOException e) {
return new Response<Integer>(1, "上传失败:" + e.getMessage(), 0);
}
return new Response<Integer>(0, message, n);
}

@RequestMapping(value = "/down", method = RequestMethod.GET)
@ResponseBody
public void down(@RequestParam(value = "maraId", required = false) Integer maraId,
Expand Down Expand Up @@ -858,7 +917,6 @@ public void down(@RequestParam(value = "maraId", required = false) Integer maraI
WritableCellFormat cellFormat = new WritableCellFormat();

int i = 1;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (CommissionOrderListDTO commissionOrderListDto : commissionOrderList) {
sheet.addCell(new Label(0, i, commissionOrderListDto.getId() + "", cellFormat));
sheet.addCell(new Label(1, i, sdf.format(commissionOrderListDto.getGmtCreate()), cellFormat));
Expand Down
52 changes: 48 additions & 4 deletions src/main/java/org/zhinanzhen/b/controller/VisaController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.zhinanzhen.b.controller;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -33,14 +34,14 @@

import com.ikasoa.core.utils.StringUtil;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.read.biff.BiffException;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableSheet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Controller
@CrossOrigin(origins = "*", maxAge = 3600)
Expand All @@ -52,6 +53,8 @@ public class VisaController extends BaseCommissionOrderController {

@Resource
ServiceOrderService serviceOrderService;

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

@RequestMapping(value = "/upload_img", method = RequestMethod.POST)
@ResponseBody
Expand Down Expand Up @@ -556,6 +559,48 @@ public Response<List<VisaDTO>> listVisa(@RequestParam(value = "keyword", require
return new Response<List<VisaDTO>>(1, e.getMessage(), null);
}
}

@RequestMapping(value = "/upload", method = RequestMethod.POST)
@ResponseBody
public Response<Integer> upload(@RequestParam MultipartFile file, HttpServletRequest request,
HttpServletResponse response) throws IllegalStateException, IOException {
super.setPostHeader(response);
String message = "";
int n = 0;
Response<String> r = super.upload2(file, request.getSession(), "/tmp/");
try (InputStream is = new FileInputStream(r.getData())) {
jxl.Workbook wb = jxl.Workbook.getWorkbook(is);
Sheet sheet = wb.getSheet(0);
for (int i = 1; i < sheet.getRows(); i++) {
Cell[] cells = sheet.getRow(i);
String _id = cells[0].getContents();
String _bonus = cells[11].getContents();
String _bonusDate = cells[12].getContents();
try {
VisaDTO visaDto = visaService.getVisaById(Integer.parseInt(_id));
if (visaDto == null) {
message += "[" + _id + "]佣金订单不存在;";
continue;
}
if (!CommissionStateEnum.DJY.toString().equals(visaDto.getCommissionState())) {
message += "[" + _id + "]佣金订单状态不是待结佣;";
continue;
}
Response<VisaDTO> _r = updateOne(Integer.parseInt(_id), null, Double.parseDouble(_bonus),
sdf.format(_bonusDate), true);
if (_r.getCode() > 0)
message += "[" + _id + "]" + _r.getMessage() + ";";
else
n++;
} catch (NumberFormatException | ServiceException e) {
message += "[" + _id + "]" + e.getMessage() + ";";
}
}
} catch (BiffException | IOException e) {
return new Response<Integer>(1, "上传失败:" + e.getMessage(), 0);
}
return new Response<Integer>(0, message, n);
}

@RequestMapping(value = "/down", method = RequestMethod.GET)
@ResponseBody
Expand Down Expand Up @@ -645,7 +690,6 @@ public void down(@RequestParam(value = "keyword", required = false) String keywo
WritableCellFormat cellFormat = new WritableCellFormat();

int i = 1;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (VisaDTO visaDto : list) {
sheet.addCell(new Label(0, i, visaDto.getId() + "", cellFormat));
sheet.addCell(new Label(1, i, sdf.format(visaDto.getGmtCreate()), cellFormat));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public int countCommissionOrder(Integer maraId, Integer adviserId, Integer offic
throws ServiceException {
return commissionOrderDao.countCommissionOrder(maraId, adviserId, officialId, userId, name, phone,
wechatUsername, schoolId, isSettle, stateList, commissionStateList, startKjApprovalDate,
endKjApprovalDate, isYzyAndYjy);
theDateTo23_59_59(endKjApprovalDate), isYzyAndYjy);
}

@Override
Expand All @@ -145,7 +145,8 @@ public List<CommissionOrderListDTO> listCommissionOrder(Integer maraId, Integer
try {
commissionOrderListDoList = commissionOrderDao.listCommissionOrder(maraId, adviserId, officialId, userId,
name, phone, wechatUsername, schoolId, isSettle, stateList, commissionStateList,
startKjApprovalDate, endKjApprovalDate, isYzyAndYjy, pageNum * pageSize, pageSize);
startKjApprovalDate, theDateTo23_59_59(endKjApprovalDate), isYzyAndYjy, pageNum * pageSize,
pageSize);
if (commissionOrderListDoList == null)
return null;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ private void schoolSetting7(SchoolSettingDO schoolSetting, Date startDate, Date
// co.getId() + "学校设置计算=学校设置金额[" + subjectSettingDo.getPrice() + "]=" + co.getCommission());
if (parameters != null) {
co.setCommission(co.getAmount() - Double.parseDouble(parameters.trim()));
System.out.println(co.getId() + "学校设置计算=本次收款金额[\" + co.getAmount() + \"]-学校设置金额[" + Double.parseDouble(parameters.trim()) + "]="
System.out.println(co.getId() + "学校设置计算=本次收款金额[" + co.getAmount() + "]-学校设置金额[" + Double.parseDouble(parameters.trim()) + "]="
+ co.getCommission());
} else {
co.setCommission(co.getAmount()); // 正常情况下是不会执行到这里的
Expand Down
4 changes: 3 additions & 1 deletion webroot/mycommission-accounting.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,10 @@
</button>
<strong id="error_info"></strong>
</div>
<form class="form-inline" style="margin-top:10px;">
<form class="form-inline" style="margin-top:10px;">
<input v-model.trim="userId" type="hidden" name="userId" id="userId" value="0" />
<div class="form-group">
<input type="text" v-model.trim="id" id="id" class="form-control" style="width:90px;" placeholder="订单ID">
<input type="text" name="user_name" id="user_name" class="form-control" style="width:150px;" placeholder="客户姓名">
<select v-model.trim="adviserId" id="adviserId" class="form-control" style="width:130px;">
</select>
Expand Down Expand Up @@ -573,6 +574,7 @@ <h4 class="modal-title" id="myModalLabel">操作提示</h4>
getSearch: function() {
var that = this;
var json = {};
if (that.id != '') json['id'] = that.id;
if (that.userId != '0') json['userId'] = that.userId;
if (that.adviserId != '0')
{
Expand Down
3 changes: 3 additions & 0 deletions webroot/mycommission-ovst-accounting.html
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@
<form class="form-inline" style="margin-top:10px;">
<input v-model.trim="userId" type="hidden" name="userId" id="userId" value="0" />
<div class="form-group">
<label>订单ID</label>
<input v-model.trim="id" id="id" type="text" class="form-control" style="width:90px;" placeholder="请输入纯数字">
<label>客户姓名</label>
<input type="text" v-model.trim="name" class="form-control" style="width:150px;" placeholder="模糊匹配">
<label>电话号码</label>
Expand Down Expand Up @@ -679,6 +681,7 @@ <h4 class="modal-title" id="myModalLabel">操作提示</h4>
getSearch: function() {
var that = this;
var json = {};
if (that.id != '') json['id'] = that.id;
if (that.name != '') json['name'] = that.name;
if (that.phone != '') json['phone'] = that.phone;
if (that.wechatUsername != '') json['wechatUsername'] = that.wechatUsername;
Expand Down
8 changes: 5 additions & 3 deletions webroot/mycommission-ovst.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,11 @@
</button>
<strong id="error_info"></strong>
</div>
<form class="form-inline" style="margin-top:10px;">
<form class="form-inline" style="margin-top:10px;">
<input v-model.trim="userId" type="hidden" name="userId" id="userId" value="0" />
<div class="form-group">
<input type="text" name="user_name" id="user_name" class="form-control" style="width:150px;" placeholder="客户姓名">
<div class="form-group">
<input type="text" v-model.trim="id" id="id" class="form-control" style="width:90px;" placeholder="订单ID">
<input type="text" name="user_name" id="user_name" class="form-control" style="width:150px;" placeholder="客户姓名">
</div>
<div class="form-group">
<input v-model.trim="startHandlingDate" type="text" autocomplete="off" class="form-control default-date-picker1" style="width:120px;" placeholder="办理时间(开始)">
Expand Down Expand Up @@ -556,6 +557,7 @@ <h4 class="modal-title" id="myModalLabel">操作提示</h4>
getSearch: function() {
var that = this;
var json = {};
if (that.id != '') json['id'] = that.id;
if (that.userId != '0') json['userId'] = that.userId;
if (that.adviserId != '0') json['adviserId'] = that.adviserId;
if (that.type != '') json['type'] = that.type;
Expand Down
2 changes: 2 additions & 0 deletions webroot/mycommission.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
<form class="form-inline" style="margin-top:10px;">
<input v-model.trim="userId" type="hidden" name="userId" id="userId" value="0" />
<div class="form-group">
<input type="text" v-model.trim="id" id="id" class="form-control" style="width:90px;" placeholder="订单ID">
<input type="text" name="user_name" id="user_name" class="form-control" style="width:150px;" placeholder="客户姓名">
</div>
<div class="form-group">
Expand Down Expand Up @@ -531,6 +532,7 @@ <h4 class="modal-title" id="myModalLabel">操作提示</h4>
getSearch: function() {
var that = this;
var json = {};
if (that.id != '') json['id'] = that.id;
if (that.userId != '0') json['userId'] = that.userId;
if (that.adviserId != '0') json['adviserId'] = that.adviserId;
if (that.type != '') json['type'] = that.type;
Expand Down
5 changes: 4 additions & 1 deletion webroot/serviceorder-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@
<form class="form-inline" style="margin-top:10px;">
<input v-model.trim="userId" type="hidden" name="userId" id="userId" value="0" />
<div class="form-group">
<label>订单ID</label>
<input v-model.trim="id" id="id" type="text" class="form-control" style="width:130px;" placeholder="请输入纯数字">
<label>客户姓名</label>
<input type="text" name="user_name" id="user_name" class="form-control" style="width:150px;">
<!--
Expand Down Expand Up @@ -423,7 +425,7 @@
<dle v-if="ap_list==='GW'">
<d2 v-if="item.type==='SIV' && !item.parentId">
<d1 v-if="!item.submitted && item.pay">
<a href="javascript:show_confirmbox('{{item.type}}',{{item.id}},'REVIEW',1)"><span style="font-weight:bold;color:#99CC66;">提交佣金表</span></a>
<button onclick="show_confirmbox('{{item.type}}',{{item.id}},'REVIEW',1)" type="button" class="btn btn-success" style="">提交佣金表</button>
</d1>
</d2>
<d2 v-if="item.type!=='SIV'">
Expand Down Expand Up @@ -605,6 +607,7 @@ <h4 class="modal-title" id="myModalLabel">操作提示</h4>
getSearch: function() {
var that = this;
var json = {};
if (that.id != '') json['id'] = that.id;
if (that.userId != '0') json['userId'] = that.userId;
if (that.adviserId != '0') json['adviserId'] = that.adviserId;
if (that.officialId != '0') json['officialId'] = that.officialId;
Expand Down
8 changes: 4 additions & 4 deletions webroot/user-common-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h4 class="modal-title" id="myModalLabel">服务详情页</h4>
<option v-if="flowstate_gw==='REVIEW' && flowstate_wa===null" value="REVIEW">资料审核中</option>
<option v-if="flowstate_wa==='REVIEW' && servicepackage_type!=='EOI' && (flowstate_ma===null || flowstate_ma === 'REVIEW')" value="WAIT">提交Mara审核</option>
<option v-if="flowstate_wa==='WAIT'" value="">Mara审核中</option>
<option v-if="flowstate_ma==='FINISH' && servicepackage_type==='VISA'" value="APPLY">已提交申请</option>
<option v-if="flowstate_ma==='FINISH'" value="APPLY">已提交申请</option>
<option v-if="servicepackage_type==='VA' && (flowstate_wa==='APPLY' || flowstate_wa==='COMPLETE')" value="COMPLETE">申请成功</option>
<option v-if="servicepackage_type==='EOI' && (flowstate_wa==='APPLY' || flowstate_wa==='COMPLETE')" value="COMPLETE">EOI完成</option>
<option v-if="servicepackage_type==='CA' && (flowstate_wa==='APPLY' || flowstate_wa==='COMPLETE')" value="COMPLETE">评估完成</option>
Expand Down Expand Up @@ -210,7 +210,7 @@ <h4 class="modal-title" id="myModalLabel">服务详情页</h4>
<label class="control-label" style="width:80px;"><strong>服务项目:</strong></label>
<label id="c2" style="width:100px;">留学</strong></label>
<label class="control-label"><strong>学校:</strong></label>
<label id="c3" style="width:150px;"></label>
<label id="c3" style=" word-break: keep-all; word-wrap: break-word;"></label>
</div>
<div class="form-group" style="width:100%;height:40px;">
<label class="control-label"><strong>课程:</strong></label>
Expand Down Expand Up @@ -723,7 +723,7 @@ <h4 class="modal-title" id="myModalLabel">确认</h4>

v_sub.flowstate_gw = response.review.adviserState;
v_sub.flowstate_wa = response.review.officialState;
v_sub.flowstate_ma = response.review.maraState;
v_sub.flowstate_ma = response.review.maraState;
if (response.review.officialState == 'REVIEW')
{
if (response.review.maraState == 'FINISH')
Expand Down Expand Up @@ -755,7 +755,7 @@ <h4 class="modal-title" id="myModalLabel">确认</h4>
}
if (str_state == 'WA_REVIEW') $("#b19").val('REVIEW');
if (str_state == 'WA_MA_WAIT' || str_state == 'MA_WAIT') $("#b19").val('WAIT');
if (str_state == 'APPLY' || str_state == 'COMPLETE' || str_state == 'CLOSE') $("#b19").val(str_state);
if (str_state == 'APPLY' || str_state == 'COMPLETE' || str_state == 'CLOSE') $("#b19").val(str_state);
}else if (type == 'OVST')//留学
{
//留学
Expand Down
4 changes: 2 additions & 2 deletions webroot/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ <h4 class="modal-title" id="myModalLabel">添加客户</h4>
</div>
<div class="form-group" style="width:100%;height:40px;">
<label class="control-label" style="color:red;">客户的姓</label>
<input type="text" autocomplete="off" id="a2" class="form-control" style="width:200px;" onKeyUp="value=value.replace(/[^a-zA-Z]/g,'').toUpperCase();" maxlength="6" placeholder="请输入客户姓的拼音" >
<input type="text" autocomplete="off" id="a2" class="form-control" style="width:200px;" onKeyUp="value=value.replace(/[^a-zA-Z ]/g,'').toUpperCase();" maxlength="6" placeholder="请输入客户姓的拼音" >
<label class="control-label" style="color:red;">客户的名</label>
<input type="text" autocomplete="off" id="a2b" class="form-control" style="width:200px;" onKeyUp="value=value.replace(/[^a-zA-Z]/g,'').substring(0, 1).toUpperCase()+value.replace(/[^a-zA-Z]/g,'').substring(1);" placeholder="请输入客户名的拼音" >
<input type="text" autocomplete="off" id="a2b" class="form-control" style="width:200px;" onKeyUp="value=value.replace(/[^a-zA-Z]/g,'').substring(0, 1).toUpperCase()+value.replace(/[^a-zA-Z ]/g,'').substring(1);" placeholder="请输入客户名的拼音" >
</div>
<div class="form-group" style="width:100%;height:40px;">
<label class="control-label" style="color:red;">手机号码</label>
Expand Down