Commit 2bc75689 by 刘宇峰

特约店、围栏

1 parent 6cc20f99
package cn.com.glsx; package cn.com.glsx;
import cn.com.glsx.auth.listener.SqlSessionEvent;
import com.glsx.plat.context.EnableRestAdmin; import com.glsx.plat.context.EnableRestAdmin;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableMBeanExport; import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.jmx.support.RegistrationPolicy; import org.springframework.jmx.support.RegistrationPolicy;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
...@@ -27,7 +29,8 @@ import static java.util.TimeZone.getTimeZone; ...@@ -27,7 +29,8 @@ import static java.util.TimeZone.getTimeZone;
public class Application { public class Application {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(Application.class, args); ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
context.publishEvent(new SqlSessionEvent(context));
} }
@PostConstruct @PostConstruct
......
...@@ -9,6 +9,7 @@ import cn.com.glsx.admin.modules.model.export.TrialDriveVehicleExport; ...@@ -9,6 +9,7 @@ import cn.com.glsx.admin.modules.model.export.TrialDriveVehicleExport;
import cn.com.glsx.admin.modules.model.param.VehicleManageSearch; import cn.com.glsx.admin.modules.model.param.VehicleManageSearch;
import cn.com.glsx.admin.modules.model.param.VehicleSearch; import cn.com.glsx.admin.modules.model.param.VehicleSearch;
import cn.com.glsx.admin.modules.model.param.VehicleTreeSearch; import cn.com.glsx.admin.modules.model.param.VehicleTreeSearch;
import com.glsx.plat.common.annotation.DataPerm;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper; import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -26,6 +27,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> { ...@@ -26,6 +27,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
* @param search * @param search
* @return * @return
*/ */
@DataPerm(showSql = true)
List<TrialDriveVehiclePageDTO> searchTrialDrive(VehicleManageSearch search); List<TrialDriveVehiclePageDTO> searchTrialDrive(VehicleManageSearch search);
/** /**
......
...@@ -286,8 +286,6 @@ public class ElectricFenceService { ...@@ -286,8 +286,6 @@ public class ElectricFenceService {
fence.setRecord(localFence.getRecord() + "操作时间:" + DateUtils.formatNormal(new Date()) fence.setRecord(localFence.getRecord() + "操作时间:" + DateUtils.formatNormal(new Date())
+ " 操作人:" + ShieldContextHolder.getAccount() + "(" + ShieldContextHolder.getUserId() + ")" + " 操作人:" + ShieldContextHolder.getAccount() + "(" + ShieldContextHolder.getUserId() + ")"
+ "<br/>"); + "<br/>");
fence.setStartTime(fenceBO.getStartTime());
fence.setEndTime(fenceBO.getEndTime());
fence.setUpdatedDate(new Date()); fence.setUpdatedDate(new Date());
fence.setUpdatedBy(ShieldContextHolder.getUserId()); fence.setUpdatedBy(ShieldContextHolder.getUserId());
int updateCnt = electricFenceMapper.updateByPrimaryKey(fence); int updateCnt = electricFenceMapper.updateByPrimaryKey(fence);
...@@ -333,15 +331,16 @@ public class ElectricFenceService { ...@@ -333,15 +331,16 @@ public class ElectricFenceService {
fenceCopy.setRecord(localFence.getRecord() + "操作时间:" + DateUtils.formatNormal(new Date()) fenceCopy.setRecord(localFence.getRecord() + "操作时间:" + DateUtils.formatNormal(new Date())
+ " 操作人:" + ShieldContextHolder.getAccount() + "(" + ShieldContextHolder.getUserId() + ")" + " 操作人:" + ShieldContextHolder.getAccount() + "(" + ShieldContextHolder.getUserId() + ")"
+ "<br/>"); + "<br/>");
fenceCopy.setStartTime(fenceBO.getStartTime());
fenceCopy.setEndTime(fenceBO.getEndTime());
fenceCopy.setUpdatedDate(new Date());
fenceCopy.setUpdatedBy(ShieldContextHolder.getUserId());
ElectricFenceCopy electricFenceCopy = electricFenceCopyMapper.selectByFenceId(fenceBO.getId()); ElectricFenceCopy electricFenceCopy = electricFenceCopyMapper.selectByFenceId(fenceBO.getId());
if (electricFenceCopy == null) { if (electricFenceCopy == null) {
fenceCopy.setCreatedDate(new Date());
fenceCopy.setCreatedBy(ShieldContextHolder.getUserId());
int updateCnt = electricFenceCopyMapper.insertUseGeneratedKeys(fenceCopy); int updateCnt = electricFenceCopyMapper.insertUseGeneratedKeys(fenceCopy);
} else { } else {
fenceCopy.setUpdatedDate(new Date());
fenceCopy.setUpdatedBy(ShieldContextHolder.getUserId());
int updateCnt = electricFenceCopyMapper.updateByPrimaryKey(fenceCopy); int updateCnt = electricFenceCopyMapper.updateByPrimaryKey(fenceCopy);
} }
......
...@@ -60,32 +60,48 @@ ...@@ -60,32 +60,48 @@
</select> </select>
<select id="search" resultType="cn.com.glsx.admin.modules.model.ElectricFenceDTO"> <select id="search" resultType="cn.com.glsx.admin.modules.model.ElectricFenceDTO">
select tef.id fenceId, select tef.id fenceId,
tef.fence_name fenceName, tef.fence_name fenceName,
ttds.shop_name shopName, ttds.shop_name shopName,
ttds.shop_code shopCode, ttds.shop_code shopCode,
ttds.shop_level shopLevel, ttds.shop_level shopLevel,
tef.created_date createdDate, tef.created_date createdDate,
tef.created_by creatorId tef.created_by creatorId
from t_electric_fence tef from t_electric_fence tef
left join t_user tu on tu.id = tef.created_by left join t_trial_drive_shop ttds on ttds.fence_id = tef.id
left join t_trial_drive_shop ttds on ttds.shop_code = tu.account
where tef.del_flag = 0 where tef.del_flag = 0
<if test="term != null and term !=''">
and (
ttds.shop_name like CONCAT('%',#{term},'%')
or
ttds.shop_code like CONCAT('%',#{term},'%')
or
tef.fence_name like CONCAT('%',#{term},'%')
)
</if>
order by tef.id desc order by tef.id desc
</select> </select>
<select id="export" resultType="cn.com.glsx.admin.modules.model.export.ElectricFenceExport"> <select id="export" resultType="cn.com.glsx.admin.modules.model.export.ElectricFenceExport">
select tef.id fenceId, select tef.id fenceId,
tef.fence_name fenceName, tef.fence_name fenceName,
ttds.shop_name shopName, ttds.shop_name shopName,
ttds.shop_code shopCode, ttds.shop_code shopCode,
ttds.shop_level shopLevel, ttds.shop_level shopLevel,
tef.created_date createdDate, tef.created_date createdDate,
tef.created_by creatorId tef.created_by creatorId
from t_electric_fence tef from t_electric_fence tef
left join t_user tu on tu.id = tef.created_by left join t_trial_drive_shop ttds on ttds.fence_id = tef.id
left join t_trial_drive_shop ttds on ttds.shop_code = tu.account
where tef.del_flag = 0 where tef.del_flag = 0
<if test="term != null and term !=''">
and (
ttds.shop_name like CONCAT('%',#{term},'%')
or
ttds.shop_code like CONCAT('%',#{term},'%')
or
tef.fence_name like CONCAT('%',#{term},'%')
)
</if>
order by tef.id desc order by tef.id desc
</select> </select>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
tef.fence_name fenceName, tef.fence_name fenceName,
ttds.created_by creatorId ttds.created_by creatorId
from t_trial_drive_shop ttds from t_trial_drive_shop ttds
left join t_electric_fence tef on tef.created_by = ttds.created_by left join t_electric_fence tef on tef.id = ttds.fence_id
where ttds.del_flag = 0 where ttds.del_flag = 0
and tef.biz_fence_type = 13 and tef.biz_fence_type = 13
<if test="term != null and term !=''"> <if test="term != null and term !=''">
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
tef.fence_name fenceName, tef.fence_name fenceName,
ttds.created_by creatorId ttds.created_by creatorId
from t_trial_drive_shop ttds from t_trial_drive_shop ttds
left join t_electric_fence tef on tef.created_by = ttds.created_by left join t_electric_fence tef on tef.id = ttds.fence_id
where ttds.del_flag = 0 where ttds.del_flag = 0
and tef.biz_fence_type = 13 and tef.biz_fence_type = 13
<if test="term != null and term !=''"> <if test="term != null and term !=''">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!