Commit 53b7c51e authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 089bf7b1 adc9d3f4
......@@ -9,4 +9,6 @@ public class PageParam {
Integer page;
@ApiModelProperty("每页限制")
Integer limit;
}
......@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde
List<DailyTravelOrderStatistics> getTravelPenalSum(@Param("day") Integer day);
OrderStatistics monthOrderTotal(Integer branchCompanyId);
OrderStatistics monthOrderTotal(@Param("companyId")Integer companyId);
}
......@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr
List<DailyVehicleOrderStatistics> getViolationMoney(@Param("day") Integer day);
OrderStatistics monthOrderTotal(Integer companyId);
OrderStatistics monthOrderTotal(@Param("companyId")Integer companyId);
}
......@@ -52,6 +52,11 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
*/
private final Integer TYPE_TOTAL = 4;
/**
* 数据权限
*/
private final Integer DATA_AUTHORITY=1;
@Autowired
private DailyVehicleOrderStatisticsBiz vehicleBiz;
......@@ -77,6 +82,10 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
UserDTO user = userDTOObjectRestResponse.getData();
Integer companyId = user.getCompanyId();
if (DATA_AUTHORITY.equals(user.getDataAll())){
companyId=null;
}
if (TYPE_VEHICLE.equals(type)) {
OrderStatistics vehicle = vehicleBiz.findAll(companyId);
return ObjectRestResponse.succ(vehicle);
......
......@@ -32,17 +32,21 @@
one_day,branch_company_id
) m
WHERE
branch_company_id =#{companyId}
1=1
<if test="companyId != null">
and branch_company_id =#{companyId}
</if>
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv-->
<!-- FROM-->
<!-- daily_members_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{companyId}-->
<!-- and-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),interval 1 day),'%Y-%c')-->
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv-->
<!-- FROM-->
<!-- daily_members_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{companyId}-->
<!-- and-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),interval 1 day),'%Y-%c')-->
<!-- </select>-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -68,18 +68,21 @@
one_day,branch_company_id
) o
WHERE
branch_company_id =#{companyId}
1=1
<if test="companyId != null">
and branch_company_id =#{companyId}
</if>
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,-->
<!-- IFNULL(sum(penal_sum) ,0) as totalPenalSum-->
<!-- FROM-->
<!-- daily_travel_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{branchCompanyId}-->
<!-- AND-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%c')-->
<!-- </select>-->
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,-->
<!-- IFNULL(sum(penal_sum) ,0) as totalPenalSum-->
<!-- FROM-->
<!-- daily_travel_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{branchCompanyId}-->
<!-- AND-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%c')-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -80,6 +80,40 @@
</select>
<!-- 获取赔偿和延期JSON字符串-->
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
IFNULL(sum(gmv),0) as totalGmv,
(IFNULL(sum(security_deposit),0)-IFNULL(sum(refund_security_deposit) ,0)) as totalSecurityDeposit,
IFNULL(sum(refund_security_deposit) ,0) as totalRefundSecurityDeposit,
IFNULL(sum(compensation) ,0) as totalCompensation,
IFNULL(sum(forfeit) ,0) as totalForfeit,
IFNULL(sum(penal_sum) ,0) as totalPenalSum,
IFNULL(sum(postpone) ,0) as totalPostpone
FROM
(
SELECT
ANY_VALUE(id) as id,
one_day,
branch_company_id,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(security_deposit) AS security_deposit,
ANY_VALUE(refund_security_deposit) AS refund_security_deposit,
ANY_VALUE(forfeit) AS forfeit,ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(postpone) AS postpone,ANY_VALUE(crt_time) AS crt_time,
ANY_VALUE(compensation) AS compensation
FROM
daily_vehicle_order_statistics
GROUP BY
one_day,branch_company_id
) a
WHERE
1=1
<if test="companyId != null">
and branch_company_id = #{companyId}
</if>
</select>
<!--违章-->
<select id="getCompensationAndPostpone" resultType="HashMap">
SELECT
v.start_company_id AS branchCompanyId,
......@@ -105,7 +139,7 @@
order by v.start_company_id asc
</select>
<!--违章-->
<select id="getViolationMoney" resultType="com.xxfc.platform.order.entity.DailyVehicleOrderStatistics">
SELECT
d.start_company_id AS branchCompanyId,
......@@ -136,37 +170,6 @@
d.start_company_id
</select>
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
IFNULL(sum(gmv),0) as totalGmv,
(IFNULL(sum(security_deposit),0)-IFNULL(sum(refund_security_deposit) ,0)) as totalSecurityDeposit,
IFNULL(sum(refund_security_deposit) ,0) as totalRefundSecurityDeposit,
IFNULL(sum(compensation) ,0) as totalCompensation,
IFNULL(sum(forfeit) ,0) as totalForfeit,
IFNULL(sum(penal_sum) ,0) as totalPenalSum,
IFNULL(sum(postpone) ,0) as totalPostpone
FROM
(
SELECT
ANY_VALUE(id) as id,
one_day,
branch_company_id,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(security_deposit) AS security_deposit,
ANY_VALUE(refund_security_deposit) AS refund_security_deposit,
ANY_VALUE(forfeit) AS forfeit,ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(postpone) AS postpone,ANY_VALUE(crt_time) AS crt_time,
ANY_VALUE(compensation) AS compensation
FROM
daily_vehicle_order_statistics
GROUP BY
one_day,branch_company_id
) a
WHERE
branch_company_id = #{companyId}
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,-->
......
......@@ -8,10 +8,13 @@ import com.xxfc.platform.uccn.entity.SEO;
import com.xxfc.platform.uccn.mapper.SEOMapper;
import com.xxfc.platform.uccn.vo.SEOQuery;
import com.xxfc.platform.uccn.vo.SEOVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
......@@ -20,7 +23,9 @@ import java.util.List;
* @author Administrator
*/
@Service
@Slf4j
public class SEOBiz extends BaseBiz<SEOMapper, SEO> {
public PageInfo<SeoDTO> getList(SEOQuery query) {
PageHelper.startPage(query.getPage(),query.getLimit());
List<SeoDTO> seodtoList = mapper.getSEODTOList();
......@@ -33,18 +38,24 @@ public class SEOBiz extends BaseBiz<SEOMapper, SEO> {
try {
if (seoVo==null) {
return false;
}
SEO seo = new SEO();
BeanUtilsBean.getInstance().copyProperties(seo,seoVo);
if (seo.getId()==null) {
Example example = new Example(SEO.class);
example.createCriteria().andEqualTo("modelId", seo.getModelId());
List<SEO> list = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
seo.setCreTime(new Date());
mapper.insertSelective(seo);
}else {
}else if (list.size()==1){
seo.setUpdTime(new Date());
mapper.updateByPrimaryKeySelective(seo);
}else {
log.error("错误!该模块保存有多个seo");
return false;
}
return true;
} catch (Exception e) {
e.printStackTrace();
......
......@@ -7,6 +7,7 @@
select
m.name as modelName ,
m.id as model_id,
s.id,
s.title as title,
s.keywords as keywords,
s.description as description,
......
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