Pārlūkot izejas kodu

整体评价,用餐报表,中控

he.dujuan 3 gadi atpakaļ
vecāks
revīzija
5a16d8de31
15 mainītis faili ar 51 papildinājumiem un 28 dzēšanām
  1. 5 1
      eladmin-system/src/main/java/me/zhengjie/modules/dm/service/domain/DmServicePj.java
  2. 2 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/service/service/dto/DmServicePjDto.java
  3. 2 2
      eladmin-system/src/main/java/me/zhengjie/modules/dm/service/service/impl/DmServicePjServiceImpl.java
  4. 11 13
      eladmin-system/src/main/java/me/zhengjie/modules/dm/statement/repository/DmHaveDinnerRepository.java
  5. 4 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/user/domain/DmUser.java
  6. 1 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/user/service/dto/DmUserDto.java
  7. 5 2
      eladmin-system/src/main/java/me/zhengjie/modules/dmApp/domain/AppFoodPj.java
  8. 3 2
      eladmin-system/src/main/java/me/zhengjie/modules/dmApp/repository/AppFoodPjRepository.java
  9. 6 6
      eladmin-system/src/main/java/me/zhengjie/modules/dmApp/rest/AppFoodPjController.java
  10. 2 0
      eladmin-system/src/main/java/me/zhengjie/modules/dmApp/service/AppFoodPjService.java
  11. 5 1
      eladmin-system/src/main/java/me/zhengjie/modules/dmApp/service/dto/AppFoodPjDto.java
  12. 2 0
      eladmin-system/src/main/java/me/zhengjie/modules/dmApp/service/impl/AppFoodPjServiceImpl.java
  13. 1 1
      eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/CardRecordTask.java
  14. 1 0
      eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataSyncTask.java
  15. 1 0
      eladmin-system/src/main/java/me/zhengjie/modules/thirdparty/v1/OpenApiController.java

+ 5 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/service/domain/DmServicePj.java

@@ -50,9 +50,13 @@ public class DmServicePj implements Serializable {
     private String userName;
 
     @Column(name = "user_code")
-    @ApiModelProperty(value = "用户号")
+    @ApiModelProperty(value = "用户号")
     private String userCode;
 
+    @Column(name = "user_number")
+    @ApiModelProperty(value = "用户工号")
+    private String userNumber;
+
     @Column(name = "total_point")
     @ApiModelProperty(value = "综合评分")
     private String totalPoint;

+ 2 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/service/service/dto/DmServicePjDto.java

@@ -36,6 +36,8 @@ public class DmServicePjDto implements Serializable {
     /** 用户工号 */
     private String userCode;
 
+    private String userNumber;
+
     /** 综合评分 */
     private String totalPoint;
 

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/modules/dm/service/service/impl/DmServicePjServiceImpl.java

@@ -78,8 +78,8 @@ public class DmServicePjServiceImpl implements DmServicePjService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public DmServicePjDto createApp(DmServicePj resources) {
-//        resources.setUserName(resources.getFoodName());
-//        resources.setUserCode(resources.getFoodName());
+        Map<String, Object> map = dmServicePjRepository.enableApp();
+        resources.setEnabled(map.get("enabled").toString());
         return dmServicePjMapper.toDto(dmServicePjRepository.save(resources));
     }
 

+ 11 - 13
eladmin-system/src/main/java/me/zhengjie/modules/dm/statement/repository/DmHaveDinnerRepository.java

@@ -49,7 +49,6 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
     /**
      * todo 创建视图
      */
-//    @Transactional
     @Modifying
     @Query(value = "CREATE VIEW  zgmonth as " +
             "SELECT  i.name as zg_name,SUM(i.num) as zg_num,DATE_FORMAT(create_date,'%Y-%m') time  FROM `dm_order_item` i " +
@@ -58,7 +57,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
             "GROUP BY time,`zg_name` " +
             "ORDER BY time DESC,SUM(num) DESC ",nativeQuery = true)
     void addZgMonth(String stateDate,String endDate);
-//    @Transactional
+
     @Modifying
     @Query(value = "CREATE VIEW  zdmonth as " +
             "SELECT i.name as zd_name,SUM(i.num) as zd_num,SUM(i.money) as money,DATE_FORMAT(create_date,'%Y-%m') time FROM `dm_order_item` i " +
@@ -68,7 +67,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
             "ORDER BY time DESC,SUM(num) ASC ",nativeQuery = true)
     void addZdMonth(String stateDate,String endDate);
 
-//    @Transactional
+
     @Modifying
     @Query(value = "CREATE VIEW  zgyear as " +
             "SELECT  i.name as zg_name,SUM(i.num) as zg_num,DATE_FORMAT(create_date,'%Y') time  FROM `dm_order_item` i " +
@@ -77,7 +76,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
             "GROUP BY time,`zg_name` " +
             "ORDER BY time DESC,SUM(num) DESC ",nativeQuery = true)
     void addZgYear(String stateDate,String endDate);
-//    @Transactional
+
     @Modifying
     @Query(value = "CREATE VIEW  zdyear as " +
             "SELECT i.name as zd_name,SUM(i.num) as zd_num,SUM(i.money) as money,DATE_FORMAT(create_date,'%Y') time FROM `dm_order_item` i " +
@@ -87,7 +86,6 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
             "ORDER BY time DESC,SUM(num) ASC ",nativeQuery = true)
     void addZdYear(String stateDate,String endDate);
 
-//    @Transactional
     @Modifying
     @Query(value = "CREATE VIEW  zgday as " +
             "SELECT  i.name as zg_name,SUM(i.num) as zg_num,DATE_FORMAT(create_date,'%Y-%m-%d') time  FROM `dm_order_item` i " +
@@ -96,7 +94,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
             "GROUP BY time,`zg_name` " +
             "ORDER BY time DESC,SUM(num) DESC ",nativeQuery = true)
     void addZgDay(String stateDate,String endDate);
-//    @Transactional
+
     @Modifying
     @Query(value = "CREATE VIEW  zdday as " +
             "SELECT i.name as zd_name,SUM(i.num) as zd_num,SUM(i.money) as money,DATE_FORMAT(create_date,'%Y-%m-%d') time FROM `dm_order_item` i " +
@@ -110,18 +108,18 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
     @Query(value = "CREATE VIEW  zgweek as " +
             "SELECT  i.name as zg_name,SUM(i.num) as zg_num,DATE_FORMAT(create_date,'%Y-%u') week_time  FROM `dm_order_item` i " +
             "LEFT JOIN `dm_order_record` r ON  i.bh = r.bh " +
-            "WHERE if(:stateDate != '' and :endDate !='',create_date between :stateDate and :endDate,1=1) " +
-            "GROUP BY DATE_FORMAT(create_date,'%u'),`zg_name` " +
-            "ORDER BY DATE_FORMAT(create_date,'%u') DESC,SUM(num) DESC ",nativeQuery = true)
+            "WHERE if(:stateDate != '' and :endDate !='',create_date between :stateDate and :endDate,1=1)  AND create_date IS NOT NULL AND i.NAME IS NOT NULL " +
+            "GROUP BY week_time,`zg_name` " +
+            "ORDER BY week_time DESC,SUM(num) DESC ",nativeQuery = true)
     void addZgWeek(String stateDate,String endDate);
-    //    @Transactional
+
     @Modifying
     @Query(value = "CREATE VIEW  zdweek as " +
             "SELECT i.name as zd_name,SUM(i.num) as zd_num,SUM(i.money) as money,DATE_FORMAT(create_date,'%Y-%u') week_time FROM `dm_order_item` i " +
             "LEFT JOIN `dm_order_record` r ON  i.bh = r.bh " +
-            "WHERE if(:stateDate != '' and :endDate !='',create_date between :stateDate and :endDate,1=1) " +
-            "GROUP BY DATE_FORMAT(create_date,'%u'),`zd_name` " +
-            "ORDER BY DATE_FORMAT(create_date,'%u') DESC,SUM(num) ASC ",nativeQuery = true)
+            "WHERE if(:stateDate != '' and :endDate !='',create_date between :stateDate and :endDate,1=1)  AND create_date IS NOT NULL AND i.NAME IS NOT NULL " +
+            "GROUP BY week_time,`zd_name` " +
+            "ORDER BY week_time DESC,SUM(num) ASC ",nativeQuery = true)
     void addZdWeek(String stateDate,String endDate);
 
     /**

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/user/domain/DmUser.java

@@ -98,6 +98,10 @@ public class DmUser extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "卡号")
     private String cardId;
 
+    @Column(name = "user_number")
+    @ApiModelProperty(value = "用户工号")
+    private String userNumber;
+
     /*@Column(name = "create_by")
     @ApiModelProperty(value = "创建者")
     private String createBy;

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/user/service/dto/DmUserDto.java

@@ -64,4 +64,5 @@ public class DmUserDto extends BaseDTO implements Serializable {
 
     private String cardId;
 
+    private String userNumber;
 }

+ 5 - 2
eladmin-system/src/main/java/me/zhengjie/modules/dmApp/domain/AppFoodPj.java

@@ -2,6 +2,9 @@ package me.zhengjie.modules.dmApp.domain;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.copier.CopyOptions;
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import me.zhengjie.modules.dm.statement.domain.DmEvaluate;
@@ -18,8 +21,8 @@ public class AppFoodPj implements Serializable {
     @Id
     @Column(name = "id")
     @ApiModelProperty(value = "id")
-    @GeneratedValue(strategy = GenerationType.IDENTITY)//设置自增
-    private Long id;
+//    @GeneratedValue(strategy = GenerationType.IDENTITY)//设置自增
+    private String id;
 
     @Column(name = "name")
     @ApiModelProperty(value = "菜品名称")

+ 3 - 2
eladmin-system/src/main/java/me/zhengjie/modules/dmApp/repository/AppFoodPjRepository.java

@@ -7,8 +7,9 @@ import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.Param;
 
 import java.util.List;
+import java.util.Map;
 
-public interface AppFoodPjRepository extends JpaRepository<AppFoodPj,Integer>, JpaSpecificationExecutor<AppFoodPj> {
+public interface AppFoodPjRepository extends JpaRepository<AppFoodPj,String>, JpaSpecificationExecutor<AppFoodPj> {
     /**
      * 菜品评价 app
      * @param
@@ -22,7 +23,7 @@ public interface AppFoodPjRepository extends JpaRepository<AppFoodPj,Integer>, J
     @Query(nativeQuery =true,value = "SELECT a.id,b.`name`,b.`code`,b.type,c.create_date as order_time,c.bh," +
             "l.url as picture,user_code FROM dm_order_item a LEFT JOIN dm_food b ON a.pid = b.id " +
             "LEFT JOIN dm_order_record c ON a.bh=c.bh LEFT JOIN dm_food_cate d ON b.type = d.cate_id " +
-            "LEFT JOIN tool_local_storage l ON d.url = l.storage_id WHERE c.user_code='0001T110000000002HBL' " +
+            "LEFT JOIN tool_local_storage l ON d.url = l.storage_id WHERE c.user_code=:userCode " +
             "and a.pj_type='0' and date_format( create_date, '%Y-%m-%d' ) = date_format(now(),'%Y-%m-%d') ")
     List<AppFoodPj> selectAppFoodPj (@Param("userCode") String userCode);
 }

+ 6 - 6
eladmin-system/src/main/java/me/zhengjie/modules/dmApp/rest/AppFoodPjController.java

@@ -24,12 +24,12 @@ public class AppFoodPjController {
     private final AppFoodPjService appFoodPjService;
     private final DmFoodPjService dmFoodPjService;
 
-    @GetMapping(value = "/appFoodPj")
-    @Log("App菜品评价")
-    @ApiOperation("App菜品评价")
-    public ResponseEntity<Object> appFoodPj(String userCode) {
-        return new ResponseEntity<>(appFoodPjService.selectAppFoodPj(userCode), HttpStatus.OK);
-    }
+//    @GetMapping(value = "/appFoodPj")
+//    @Log("App菜品评价")
+//    @ApiOperation("App菜品评价")
+//    public ResponseEntity<Object> appFoodPj(String userCode) {
+//        return new ResponseEntity<>(appFoodPjService.selectAppFoodPj(userCode), HttpStatus.OK);
+//    }
 
     @PostMapping(value = "/createApp")
     @Log("新增foodPj")

+ 2 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dmApp/service/AppFoodPjService.java

@@ -1,8 +1,10 @@
 package me.zhengjie.modules.dmApp.service;
 
 import me.zhengjie.modules.dmApp.domain.AppFoodPj;
+import me.zhengjie.modules.dmApp.service.dto.AppFoodPjDto;
 
 import java.util.List;
+import java.util.Map;
 
 public interface AppFoodPjService {
     /**

+ 5 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dmApp/service/dto/AppFoodPjDto.java

@@ -1,5 +1,7 @@
 package me.zhengjie.modules.dmApp.service.dto;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -9,7 +11,9 @@ import java.sql.Timestamp;
 
 @Data
 public class AppFoodPjDto implements Serializable {
-    private Integer id;
+
+    @JSONField(serializeUsing= ToStringSerializer.class)
+    private String id;
 
     //菜品名称
     private String name;

+ 2 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dmApp/service/impl/AppFoodPjServiceImpl.java

@@ -4,9 +4,11 @@ import lombok.RequiredArgsConstructor;
 import me.zhengjie.modules.dmApp.domain.AppFoodPj;
 import me.zhengjie.modules.dmApp.repository.AppFoodPjRepository;
 import me.zhengjie.modules.dmApp.service.AppFoodPjService;
+import me.zhengjie.modules.dmApp.service.dto.AppFoodPjDto;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
 
 @Service
 @RequiredArgsConstructor

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/CardRecordTask.java

@@ -246,7 +246,7 @@ public class CardRecordTask {
                     }
                     JSONArray payment = attendance.getJSONArray("payments");
                     for (int n = 0; n < payment.size(); n++) {
-                        JSONObject userData = payment.getJSONObject(i);
+                        JSONObject userData = payment.getJSONObject(n);
                         DmOrderPayment dmOrderPayment = new DmOrderPayment();
                         dmOrderPayment.setBh(bh);
                         dmOrderPayment.setType(userData.getString("type"));

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataSyncTask.java

@@ -228,6 +228,7 @@ public class ZkDataSyncTask {
                 JSONObject dmUserObject = userData.getJSONObject("dmUser");
                 dmUser.setCardId(dmUserObject.getString("cardid"));
                 dmUser.setFaceid(dmUserObject.getString("faceid"));
+                dmUser.setUserNumber(dmUserObject.getString("userNumber"));
                 DmUser newDmUser = dmUserRepository.save(dmUser);
                 user.setDmUser(newDmUser);
                 userRepository.save(user);

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/modules/thirdparty/v1/OpenApiController.java

@@ -27,6 +27,7 @@ import me.zhengjie.modules.dm.service.domain.DmServicePj;
 import me.zhengjie.modules.dm.service.service.DmServicePjService;
 import me.zhengjie.modules.dmApp.domain.AppFoodPj;
 import me.zhengjie.modules.dmApp.service.AppFoodPjService;
+import me.zhengjie.modules.dmApp.service.dto.AppFoodPjDto;
 import me.zhengjie.service.LocalStorageService;
 import me.zhengjie.utils.FileUtil;
 import me.zhengjie.utils.SecurityUtils;