md
This commit is contained in:
parent
b0b8607877
commit
81b1f38544
@ -11,14 +11,24 @@
|
||||
|
||||
package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.utils.DateUtils;
|
||||
import com.xdadan.erp.emis.domain.EmisCommissionDtl;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisCommissionDtlService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@ -51,6 +61,11 @@ public class EmisCommissionProfitController extends BaseController
|
||||
@Autowired
|
||||
private IEmisCommissionProfitService emisCommissionProfitService;
|
||||
|
||||
@Autowired
|
||||
private IEmisCommissionDtlService emisCommissionDtlService;
|
||||
|
||||
@Autowired
|
||||
private EmisBaseService emisBaseService;
|
||||
|
||||
@GetMapping(value = "/batchReCalcProfitByBillCode")
|
||||
public AjaxResult batchReCalcProfitByBillCode(String billCode)
|
||||
@ -86,6 +101,59 @@ public class EmisCommissionProfitController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* app端员工计提统计汇总
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getMyProfitStat")
|
||||
public AjaxResult getMyProfitStat()
|
||||
{
|
||||
// 获取当前登录员工
|
||||
String empName=getLoginUser().getUser().getEmpName();
|
||||
|
||||
EmisCommissionProfit emisCommissionProfit = new EmisCommissionProfit();
|
||||
emisCommissionProfit.setEmpName(empName);
|
||||
emisCommissionProfit.setBillMonth(DateUtils.parseDateToStr(DateUtils.YYYY_MM,new Date()));
|
||||
List<EmisCommissionProfit> listProfit= emisCommissionProfitService.selectEmisCommissionProfitList(emisCommissionProfit);
|
||||
|
||||
|
||||
JSONObject jObjData = new JSONObject();
|
||||
jObjData.put("money","0.00");
|
||||
jObjData.put("payedMoney","0.00");
|
||||
|
||||
if(!CollectionUtils.isEmpty(listProfit)){
|
||||
EmisCommissionProfit item0=listProfit.get(0);
|
||||
jObjData.put("money",item0.getMoney().toPlainString());
|
||||
jObjData.put("payedMoney",item0.getPayedMoney());
|
||||
}
|
||||
// 获取提成明细
|
||||
return AjaxResult.success("查询成功",jObjData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计提明细
|
||||
* @param emisCommissionDtl
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "APP获取计提明细", businessType = BusinessType.OTHER)
|
||||
@JacksonFilter(include= {
|
||||
"money","billCode","billMonth","feeType",
|
||||
},value= EmisCommissionDtl.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
||||
@GetMapping("/getMyProfitSimpleList")
|
||||
public TableDataInfo getMyProfitSimpleList(EmisCommissionDtl emisCommissionDtl)
|
||||
{
|
||||
startPage();
|
||||
|
||||
String empName=getLoginUser().getUser().getEmpName();
|
||||
|
||||
emisCommissionDtl.setEmpName(empName);
|
||||
emisCommissionDtl.setBillMonth(DateUtils.parseDateToStr(DateUtils.YYYY_MM,new Date()));
|
||||
|
||||
|
||||
List<EmisCommissionDtl> list = emisCommissionDtlService.selectEmisCommissionDtlList(emisCommissionDtl);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*
|
||||
|
||||
@ -617,6 +617,33 @@ public class EmisWaybillController extends EmisBaseController
|
||||
return AjaxResult.success("查询成功",rstMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询个人业务统计信息
|
||||
*/
|
||||
@GetMapping("/getMyBizStatInfo")
|
||||
public AjaxResult getMyBizStatInfo(EmisWaybill emisWaybill)
|
||||
{
|
||||
startPage();
|
||||
setPrivParams(emisWaybill);
|
||||
String empName = getLoginUser().getUser().getEmpName();
|
||||
emisWaybill.setSalesmen(empName);
|
||||
|
||||
Map rstMap = emisWaybillService.getMyBizStatInfo(emisWaybill);
|
||||
return AjaxResult.success("查询成功",rstMap);
|
||||
}
|
||||
|
||||
@GetMapping("/getMyBizStatList")
|
||||
public AjaxResult getMyBizStatList(EmisWaybill emisWaybill)
|
||||
{
|
||||
startPage();
|
||||
setPrivParams(emisWaybill);
|
||||
|
||||
String empName = getLoginUser().getUser().getEmpName();
|
||||
emisWaybill.setSalesmen(empName);
|
||||
|
||||
List<Map> rstMapList = emisWaybillService.getMyBizStatListByCountry(emisWaybill);
|
||||
return AjaxResult.success("查询成功",rstMapList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询签收运单列表列表
|
||||
|
||||
@ -69,6 +69,9 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
|
||||
public Map getQueryStatInfoMap(EmisWaybill emisWaybill);
|
||||
|
||||
|
||||
public Map getMyBizStatInfo(EmisWaybill emisWaybill);
|
||||
|
||||
|
||||
public List<EmisWaybill> selectWaitDoBillList(EmisWaybill emisWaybill);
|
||||
|
||||
|
||||
|
||||
@ -3075,6 +3075,14 @@ public class EmisBaseService {
|
||||
return;
|
||||
}
|
||||
|
||||
if(WaybillStatus.INIT.statusCode.equals(emisWaybill.getWaybillStatus())){
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "未接单,不允许修改");
|
||||
}
|
||||
|
||||
if(OrderStatus.CANCEL.statusCode.equals(emisWaybill.getOrderStatus())){
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "订单已取消,不允许修改");
|
||||
}
|
||||
|
||||
if( PaymentStatus.PAID.statusCode.equals(emisWaybill.getPaymentStatus())
|
||||
|| PaymentStatus.PAID_SOME.statusCode.equals(emisWaybill.getPaymentStatus())
|
||||
){
|
||||
|
||||
@ -79,6 +79,21 @@ public interface IEmisWaybillService extends IDataAuditService
|
||||
public Map getQueryStatInfoMap(EmisWaybill emisWaybill);
|
||||
|
||||
|
||||
/**
|
||||
* 获取个人业务统计
|
||||
* @param emisWaybill
|
||||
* @return
|
||||
*/
|
||||
public Map getMyBizStatInfo(EmisWaybill emisWaybill);
|
||||
|
||||
/**
|
||||
* 获取个人按国家统计
|
||||
* @param emisWaybill
|
||||
* @return
|
||||
*/
|
||||
public List<Map> getMyBizStatListByCountry(EmisWaybill emisWaybill);
|
||||
|
||||
|
||||
/**
|
||||
* 获取运单信息 根据 billCode
|
||||
* @param billCode
|
||||
|
||||
@ -216,6 +216,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
return statInfoMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map getMyBizStatInfo(EmisWaybill emisWaybill)
|
||||
{
|
||||
Map statInfoMap=emisWaybillMapper.getMyBizStatInfo(emisWaybill);
|
||||
return statInfoMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1845,6 +1845,73 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getMyBizStatInfo" parameterType="EmisWaybill" resultType="map">
|
||||
select
|
||||
count(1) as totalNum,
|
||||
sum(a.parcel_qty) as totalParcelQty,
|
||||
round(sum(bill_weight),2) as totalBillWeight,
|
||||
round(sum(total_volume),5) as totalVolume,
|
||||
round(sum(volume_weight),2) as totalVolumeWeight,
|
||||
round(sum(settlement_weight),2) as totalSettlementWeight,
|
||||
round(sum(freight),2) as totalFreight
|
||||
from emis_waybill a
|
||||
<where>
|
||||
a.del_flag='0' and a.order_status !='0' and a.order_status!='2'
|
||||
|
||||
|
||||
<if test="salesmen != null and salesmen != '' " >
|
||||
and a.salesmen=#{salesmen}
|
||||
</if>
|
||||
|
||||
<if test="params.beginDate != null and params.beginDate != ''">
|
||||
and a.send_date <![CDATA[ >= ]]> #{params.beginDate}
|
||||
</if>
|
||||
<if test="params.endDate != null and params.endDate != ''">
|
||||
and a.send_date <![CDATA[ <= ]]> #{params.endDate}
|
||||
</if>
|
||||
|
||||
<if test="salesmen == null and params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||
and (
|
||||
|
||||
a.send_site_code in (
|
||||
SELECT t1.site_code FROM (
|
||||
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
||||
#{params.privSiteCode} ) pd
|
||||
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
||||
UNION
|
||||
SELECT #{params.privSiteCode} FROM dual
|
||||
)
|
||||
or
|
||||
a.dispatch_site_code in (
|
||||
SELECT t1.site_code FROM (
|
||||
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
||||
#{params.privSiteCode} ) pd
|
||||
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
||||
UNION
|
||||
SELECT #{params.privSiteCode} FROM dual
|
||||
)
|
||||
<if test="params.isQueryPrintOrder != null and params.isQueryPrintOrder == 1">
|
||||
or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode})
|
||||
</if>
|
||||
|
||||
<if test="custNo != null and custNo != ''">
|
||||
or EXISTS (
|
||||
select 1 from emis_customer_user ecu where a.cust_no=ecu.monthly_pay_code and ecu.owner_site=#{params.privSiteCode}
|
||||
)
|
||||
</if>
|
||||
|
||||
or a.salesmen=#{params.privEmpName}
|
||||
or a.payee=#{params.privEmpName}
|
||||
or a.operate_employee_code=#{params.privEmpCode}
|
||||
or a.take_piece_employee_code=#{params.privEmpCode}
|
||||
)
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPrintWaybillList" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
|
||||
<include refid="selectEmisWaybillVo"/>
|
||||
<where>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user