Commit 79cd054e authored by 燕南天's avatar 燕南天

Merge branch 'master' of gitlab.fqyxa.com:luoyangfei/store-system

parents f35fb4a2 44795c45
...@@ -3,7 +3,8 @@ package cn.com.fqy; ...@@ -3,7 +3,8 @@ package cn.com.fqy;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
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.scheduling.annotation.EnableScheduling;
@EnableScheduling
@SpringBootApplication @SpringBootApplication
@MapperScan(basePackages = "cn.com.fqy.core.dao") @MapperScan(basePackages = "cn.com.fqy.core.dao")
public class StoreMgtApplication { public class StoreMgtApplication {
......
...@@ -8,6 +8,7 @@ import javax.annotation.Resource; ...@@ -8,6 +8,7 @@ import javax.annotation.Resource;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import cn.com.fqy.common.Operator; import cn.com.fqy.common.Operator;
import cn.com.fqy.common.ResultInfo; import cn.com.fqy.common.ResultInfo;
...@@ -15,7 +16,7 @@ import cn.com.fqy.common.constants.Constant; ...@@ -15,7 +16,7 @@ import cn.com.fqy.common.constants.Constant;
import cn.com.fqy.core.model.Query; import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.Store; import cn.com.fqy.core.model.Store;
import cn.com.fqy.core.service.StoreService; import cn.com.fqy.core.service.StoreService;
@Component
public class StoreTimeTask { public class StoreTimeTask {
private static final Log log = LogFactory.getLog(StoreTimeTask.class); private static final Log log = LogFactory.getLog(StoreTimeTask.class);
......
package cn.com.fqy.controller.mapi; package cn.com.fqy.controller.mapi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -21,7 +24,7 @@ import cn.com.fqy.core.service.DataDictItemService; ...@@ -21,7 +24,7 @@ import cn.com.fqy.core.service.DataDictItemService;
* *
*/ */
@Controller @Controller
@RequestMapping("config") @RequestMapping("h5/config")
public class ConfigController extends BaseController{ public class ConfigController extends BaseController{
@Resource @Resource
...@@ -39,16 +42,24 @@ public class ConfigController extends BaseController{ ...@@ -39,16 +42,24 @@ public class ConfigController extends BaseController{
*/ */
@RequestMapping("getDataDictsStore") @RequestMapping("getDataDictsStore")
@ResponseBody @ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsStore(){ public ResultInfo<List<Map<String,Object>>> getDataDictsStore(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>(); ResultInfo<List<Map<String,Object>>> result = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
DataDictItem dataDictItem = new DataDictItem(); DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1); dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0); dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("CONSUME_INTERVAL"); dataDictItem.setDataDictCatCode("CONSUME_INTERVAL");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem)); List<DataDictItem> stoList = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) { if (stoList.size()>0 && stoList != null) {
for(DataDictItem list:stoList) {
Map<String,Object> map = new HashMap<>();
map.put("dataDictItemId", list.getDataDictItemId());
map.put("itemValue", list.getItemValue());
listQuery.add(map);
}
result.setCode("1"); result.setCode("1");
result.setData(list); result.setData(listQuery);
}else { }else {
result.setCode("0"); result.setCode("0");
result.setMsg("暂无数据"); result.setMsg("暂无数据");
...@@ -66,16 +77,23 @@ public class ConfigController extends BaseController{ ...@@ -66,16 +77,23 @@ public class ConfigController extends BaseController{
*/ */
@RequestMapping("getDataDictsHight") @RequestMapping("getDataDictsHight")
@ResponseBody @ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsHight(){ public ResultInfo<List<Map<String,Object>>> getDataDictsHight(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>(); ResultInfo<List<Map<String,Object>>> result = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
DataDictItem dataDictItem = new DataDictItem(); DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1); dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0); dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("WORKER_HEIGHT"); dataDictItem.setDataDictCatCode("WORKER_HEIGHT");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem)); List<DataDictItem> higList = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) { if (higList.size()>0 && higList != null) {
for(DataDictItem list:higList) {
Map<String,Object> map = new HashMap<>();
map.put("dataDictItemId", list.getDataDictItemId());
map.put("itemValue", list.getItemValue());
listQuery.add(map);
}
result.setCode("1"); result.setCode("1");
result.setData(list); result.setData(listQuery);
}else { }else {
result.setCode("0"); result.setCode("0");
result.setMsg("暂无数据"); result.setMsg("暂无数据");
...@@ -92,16 +110,23 @@ public class ConfigController extends BaseController{ ...@@ -92,16 +110,23 @@ public class ConfigController extends BaseController{
*/ */
@RequestMapping("getDataDictsAge") @RequestMapping("getDataDictsAge")
@ResponseBody @ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsAge(){ public ResultInfo<List<Map<String,Object>>> getDataDictsAge(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>(); ResultInfo<List<Map<String,Object>>> result = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
DataDictItem dataDictItem = new DataDictItem(); DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1); dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0); dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("WORKER_AGE"); dataDictItem.setDataDictCatCode("WORKER_AGE");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem)); List<DataDictItem> ageList = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) { if (ageList.size()>0 && ageList != null) {
for(DataDictItem list:ageList) {
Map<String,Object> map = new HashMap<>();
map.put("dataDictItemId", list.getDataDictItemId());
map.put("itemValue", list.getItemValue());
listQuery.add(map);
}
result.setCode("1"); result.setCode("1");
result.setData(list); result.setData(listQuery);
}else { }else {
result.setCode("0"); result.setCode("0");
result.setMsg("暂无数据"); result.setMsg("暂无数据");
......
package cn.com.fqy.controller.mapi; package cn.com.fqy.controller.mapi;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -42,15 +44,22 @@ public class IndexController { ...@@ -42,15 +44,22 @@ public class IndexController {
*/ */
@RequestMapping("getAdvertList") @RequestMapping("getAdvertList")
@ResponseBody @ResponseBody
public ResultInfo<List<Advert>> getAdvertList() { public ResultInfo<List<Map<String,Object>>> getAdvertList() {
ResultInfo<List<Advert>> resultInfo = new ResultInfo<List<Advert>>(); ResultInfo<List<Map<String,Object>>> resultInfo = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
Advert advert = new Advert(); Advert advert = new Advert();
advert.setIsAvailable(1); // 可用 advert.setIsAvailable(1); // 可用
Query q = new Query(advert); List<Advert> advList = advertService.getAdvertList(new Query(advert));
PageFinder<Advert> pageResult = advertService.getAdvertPagedList(q); if (null != advList && advList.size() > 0) {
if (null != pageResult && pageResult.getData().size() > 0) { for(Advert list:advList) {
List<Advert> result = pageResult.getData(); Map<String,Object> map = new HashMap<>();
resultInfo.setData(result); map.put("advertId", list.getAdvertId());
map.put("advertPicUrl", list.getAdvertPicUrl());
map.put("advertContent", list.getAdvertContent());
map.put("advertTitle", list.getAdvertTitle());
listQuery.add(map);
}
resultInfo.setData(listQuery);
resultInfo.setCode(Constant.SUCCESS); resultInfo.setCode(Constant.SUCCESS);
resultInfo.setMsg("请求成功"); resultInfo.setMsg("请求成功");
} else { } else {
...@@ -67,16 +76,23 @@ public class IndexController { ...@@ -67,16 +76,23 @@ public class IndexController {
@ResponseBody @ResponseBody
public ResultInfo<List<Store>> getStoreList() { public ResultInfo<List<Store>> getStoreList() {
ResultInfo<List<Store>> resultInfo = new ResultInfo<List<Store>>(); ResultInfo<List<Store>> resultInfo = new ResultInfo<List<Store>>();
List<Store> listQuery = new ArrayList<>();
Store store = new Store(); Store store = new Store();
store.setIsDeleted(0); // 未删除 store.setIsDeleted(0); // 未删除
store.setIsAvailable(1); // 店铺启用状态 store.setIsAuditing(1); // 店铺启用状态
store.setIsShopping(1); // 店铺展示状态 store.setIsShopping(1); // 店铺展示状态
store.setIsRecommend(1); // 店铺推荐状态 List<Store> stoList= storeService.getStoreList(new Query(store));
Query q = new Query(store); if (null != stoList && stoList.size() > 0) {
PageFinder<Store> pageResult = storeService.getStorePagedList(q); int number =0;
if (null != pageResult && pageResult.getData().size() > 0) { if(stoList.size()>3) {
List<Store> result = pageResult.getData(); number =3;
resultInfo.setData(result); }else {
number=stoList.size();
}
for(int i=0;i<number;i++) {
listQuery.add(stoList.get(i));
}
resultInfo.setData(listQuery);
resultInfo.setCode(Constant.SUCCESS); resultInfo.setCode(Constant.SUCCESS);
resultInfo.setMsg("请求成功"); resultInfo.setMsg("请求成功");
} else { } else {
...@@ -93,16 +109,25 @@ public class IndexController { ...@@ -93,16 +109,25 @@ public class IndexController {
@ResponseBody @ResponseBody
public ResultInfo<List<Worker>> getWorkerList() { public ResultInfo<List<Worker>> getWorkerList() {
ResultInfo<List<Worker>> resultInfo = new ResultInfo<List<Worker>>(); ResultInfo<List<Worker>> resultInfo = new ResultInfo<List<Worker>>();
List<Worker> listQuery = new ArrayList<>();
Worker worker = new Worker(); Worker worker = new Worker();
worker.setIsDeleted(0); // 未删除 worker.setIsDeleted(0); // 未删除
worker.setIsAuditing(1);// 已审核 worker.setIsShopping(1); // 员工展示状态
worker.setIsShopping(1);// 已展示 worker.setIsAuditing(1);
worker.setIsRecommend(1);// 已推荐 List<Worker> workerList = workerService.getWorkerList(new Query(worker));
Query q = new Query(worker); if (null != workerList && workerList.size() > 0) {
PageFinder<Worker> pageResult = workerService.getWorkerPagedList(q); int number =0;
if (null != pageResult && pageResult.getData().size() > 0) { if(workerList.size()>9) {
List<Worker> result = pageResult.getData(); number =9;
resultInfo.setData(result); }else {
number=workerList.size();
}
for(int i=0;i<number;i++) {
listQuery.add(workerList.get(i));
}
resultInfo.setData(listQuery);
resultInfo.setCode(Constant.SUCCESS); resultInfo.setCode(Constant.SUCCESS);
resultInfo.setMsg("请求成功"); resultInfo.setMsg("请求成功");
} else { } else {
...@@ -135,7 +160,7 @@ public class IndexController { ...@@ -135,7 +160,7 @@ public class IndexController {
ResultInfo<List<Store>> resultInfo = new ResultInfo<>(); ResultInfo<List<Store>> resultInfo = new ResultInfo<>();
List<Store> listQuery = new ArrayList<>(); List<Store> listQuery = new ArrayList<>();
store.setIsDeleted(0); // 未删除 store.setIsDeleted(0); // 未删除
store.setIsAvailable(1); // 店铺启用状态 store.setIsAuditing(1); // 店铺启用状态
store.setIsShopping(1); // 店铺展示状态 store.setIsShopping(1); // 店铺展示状态
int firstNumber = 0; int firstNumber = 0;
int lastNUmber = 0; int lastNUmber = 0;
...@@ -182,7 +207,8 @@ public class IndexController { ...@@ -182,7 +207,8 @@ public class IndexController {
ResultInfo<List<Worker>> resultInfo = new ResultInfo<>(); ResultInfo<List<Worker>> resultInfo = new ResultInfo<>();
List<Worker> listQuery = new ArrayList<>(); List<Worker> listQuery = new ArrayList<>();
worker.setIsDeleted(0); // 未删除 worker.setIsDeleted(0); // 未删除
worker.setIsShopping(1); // 店铺展示状态 worker.setIsShopping(1); // 员工展示状态
worker.setIsAuditing(1);
int firstNumber = 0; int firstNumber = 0;
int lastNUmber = 0; int lastNUmber = 0;
int firstNumber1 = 0; int firstNumber1 = 0;
......
...@@ -283,8 +283,9 @@ CITY_NAME,CITY_ID,PROVINCE_ID,COUNTY_ID ...@@ -283,8 +283,9 @@ CITY_NAME,CITY_ID,PROVINCE_ID,COUNTY_ID
<select id="queryAll" parameterType="Query" resultMap="Store"> <select id="queryAll" parameterType="Query" resultMap="Store">
select <include refid="CommonColumnlist"/> from T_STORE select <include refid="CommonColumnlist"/> from T_STORE
<where> <where>
<include refid="listCommonWhere"/> <include refid="listCommonWhere1"/>
</where> </where>
ORDER BY SERIAL_NUMBER ASC,CLICKS DESC
</select> </select>
<select id="pageList" parameterType="Query" resultMap="Store"> <select id="pageList" parameterType="Query" resultMap="Store">
......
...@@ -257,8 +257,9 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED,STORE_NAME ...@@ -257,8 +257,9 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED,STORE_NAME
<select id="queryAll" parameterType="Query" resultMap="Worker"> <select id="queryAll" parameterType="Query" resultMap="Worker">
select <include refid="CommonColumnlist"/> from T_WORKER select <include refid="CommonColumnlist"/> from T_WORKER
<where> <where>
<include refid="listCommonWhere"/> <include refid="listCommonWhere1"/>
</where> </where>
ORDER BY SERIAL_NUMBER ASC,CLICKS DESC
</select> </select>
<select id="pageList" parameterType="Query" resultMap="Worker"> <select id="pageList" parameterType="Query" resultMap="Worker">
......
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