Browse Source

Merge remote-tracking branch 'origin/feature-operating-report' into feature-operating-report

周箭河 4 years ago
parent
commit
151ac837d4

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java

@@ -60,6 +60,17 @@ public class SporadicChargeInfo {
 	@ApiModelProperty(value = "所属乐团", required = true)
 	private String musicGroupId;
 
+	@ApiModelProperty(value = "所属乐团名称", required = true)
+	private String musicGroupName;
+
+	public String getMusicGroupName() {
+		return musicGroupName;
+	}
+
+	public void setMusicGroupName(String musicGroupName) {
+		this.musicGroupName = musicGroupName;
+	}
+
 	public String getMusicGroupId() {
 		return musicGroupId;
 	}

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRepair.java

@@ -142,6 +142,12 @@ public class StudentRepair {
     private String address;
 
     /**
+    * 所选商品
+    */
+    @ApiModelProperty(value = "商品", required = false)
+    private String goodsJson;
+
+    /**
     * 支付状态 0-未支付 1-支付中 2-已支付
     */
     @ApiModelProperty(value = "支付状态 0-未支付 1-支付中 2-已支付", required = false)
@@ -171,6 +177,14 @@ public class StudentRepair {
     @ApiModelProperty(value = "更新时间", required = false)
     private Date updateTime;
 
+    public String getGoodsJson() {
+        return goodsJson;
+    }
+
+    public void setGoodsJson(String goodsJson) {
+        this.goodsJson = goodsJson;
+    }
+
     public String getOrganName() {
         return organName;
     }

+ 13 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/page/GoodsQueryInfo.java

@@ -1,9 +1,9 @@
 package com.ym.mec.biz.dal.page;
 
-import io.swagger.annotations.ApiModelProperty;
-
+import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
 public class GoodsQueryInfo extends QueryInfo {
 
@@ -22,6 +22,17 @@ public class GoodsQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "状态(1,上架  0,下架)",required = false)
     private YesOrNoEnum status;
 
+    @ApiModelProperty(value = "商品类型", required = false)
+    private GoodsType type;
+
+    public GoodsType getType() {
+        return type;
+    }
+
+    public void setType(GoodsType type) {
+        this.type = type;
+    }
+
     public Integer getGoodsCategoryId() {
         return goodsCategoryId;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SporadicChargeInfoService.java

@@ -42,4 +42,15 @@ public interface SporadicChargeInfoService extends BaseService<Integer, Sporadic
      * @param id
      */
     void del(Integer id);
+
+    /**
+     * @describe 获取详情
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/9/10
+     * @time 15:20
+     * @param id:
+     * @return com.ym.mec.biz.dal.entity.SporadicChargeInfo
+     */
+    SporadicChargeInfo findDetail(Integer id, Integer userId);
 }

+ 0 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.ym.mec.biz.dal.dao.GoodsCategoryDao;
 import com.ym.mec.biz.dal.dao.GoodsDao;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.enums.GoodsType;
@@ -38,8 +37,6 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	private GoodsDao goodsDao;
 	@Autowired
 	private UploadFileService uploadFileService;
-	@Autowired
-	private GoodsCategoryDao goodsCategoryDao;
 
 	@Override
 	public BaseDAO<Integer, Goods> getDAO() {

+ 27 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java

@@ -2,14 +2,8 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
-import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
-import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
@@ -48,6 +42,8 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
     @Autowired
     private TeacherDao teacherDao;
     @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
     private SysUserCashAccountService sysUserCashAccountService;
     @Autowired
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
@@ -210,4 +206,27 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
             throw new BizException("当前缴费项目存在收费记录,请走关闭流程");
         }
     }
+
+    @Override
+    public SporadicChargeInfo findDetail(Integer id, Integer userId) {
+        if (userId == null) {
+            SysUser sysUser = sysUserFeignService.queryUserInfo();
+            if (sysUser == null || sysUser.getId() == null) {
+                throw new BizException("用户不存在");
+            }
+            userId = sysUser.getId();
+        }
+        SporadicChargeInfo chargeInfo = sporadicChargeInfoDao.get(id);
+        MusicGroup musicGroup = musicGroupDao.get(chargeInfo.getMusicGroupId());
+        if(musicGroup != null){
+            chargeInfo.setMusicGroupName(musicGroup.getName());
+        }
+        if (chargeInfo != null) {
+            SysUserCashAccount locked = sysUserCashAccountService.getLocked(userId);
+            chargeInfo.setBalance(locked.getBalance());
+        } else {
+            throw new BizException("信息不存在");
+        }
+        return chargeInfo;
+    }
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -1,5 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.StudentDao;
@@ -17,6 +20,7 @@ import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -114,6 +118,18 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             MapUtil.populateMap(repairInfoMap, repairInfo);
             return repairInfoMap;
         }
+
+        if(StringUtils.isNoneBlank(repairInfo.getGoodsJson())){
+            JSONArray goods = JSON.parseArray(repairInfo.getGoodsJson());
+            for (Object good : goods) {
+                JSONObject goodObject= (JSONObject) good;
+                BigDecimal groupPurchasePrice = goodObject.getBigDecimal("groupPurchasePrice");
+                if(Objects.nonNull(groupPurchasePrice)){
+                    amount=amount.add(groupPurchasePrice);
+                }
+            }
+        }
+
         repairInfo.setPayStatus(1);
         String channelType = "";
 

+ 9 - 3
mec-biz/src/main/resources/config/mybatis/FinancialExpenditureMapper.xml

@@ -53,7 +53,7 @@
 
     <!-- 根据主键查询一条记录 -->
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.FinancialExpenditure">
-        UPDATE charge_type
+        UPDATE financial_expenditure
         <set>
             <if test="delFlag != null">
                 del_flag_ = #{delFlag},
@@ -95,10 +95,10 @@
 
     <!-- 根据主键删除一条记录 -->
     <update id="delete">
-		UPDATE charge_type SET del_flag_ = 1 WHERE id_ = #{id}
+		UPDATE financial_expenditure SET del_flag_ = 1 WHERE id_ = #{id}
 	</update>
     <update id="batchDel">
-        UPDATE charge_type SET del_flag_ = 1 WHERE FIND_IN_SET(id_,#{ids})
+        UPDATE financial_expenditure SET del_flag_ = 1 WHERE FIND_IN_SET(id_,#{ids})
     </update>
 
     <sql id="queryPageSql">
@@ -113,6 +113,10 @@
             <if test="dingtalkProcessNo != null and dingtalkProcessNo != ''">
                 AND fe.dingtalk_process_no_ = #{dingtalkProcessNo}
             </if>
+            <if test="search != null and search != ''">
+                AND (fe.batch_no_ LIKE CONCAT('%',#{search},'%') OR fe.financial_process_no_ LIKE CONCAT('%',#{search},'%')
+                OR fe.dingtalk_process_no_ LIKE CONCAT('%',#{search},'%') OR su.real_name_ LIKE CONCAT('%',#{search},'%'))
+            </if>
             <if test="organId != null">
                 AND fe.organ_id_ = #{organId}
             </if>
@@ -145,6 +149,7 @@
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
 		SELECT COUNT(DISTINCT fe.id_) FROM financial_expenditure fe
+        LEFT JOIN sys_user su ON su.id_ = fe.apply_user_id_
         <include refid="queryPageSql"/>
 	</select>
 
@@ -156,6 +161,7 @@
 
     <select id="findFinancialExpenditureCount" resultType="java.lang.Integer">
         SELECT COUNT(DISTINCT fe.id_) FROM financial_expenditure fe
+        LEFT JOIN sys_user su ON su.id_ = fe.apply_user_id_
         <include refid="queryPageSql"/>
     </select>
     <select id="queryFinancialExpenditurePage" resultMap="FinancialExpenditureDto">

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -160,6 +160,9 @@
             <if test="goodsCategoryId != null">
                 g.goods_category_id_ = #{goodsCategoryId}
             </if>
+            <if test="type != null">
+                g.type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
             <if test="isNew != null">
                 g.is_new_ = #{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -30,6 +30,7 @@
         <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="username_" jdbcType="VARCHAR" property="studentName"/>
+        <result column="goods_json_" jdbcType="VARCHAR" property="goodsJson"/>
     </resultMap>
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentRepair">
@@ -48,7 +49,7 @@
         description_, amount_, finish_time_,
         send_type_, contact_name_, contact_mobile_,
         address_, pay_status_, create_time_,
-        update_time_,repair_status_)
+        update_time_,repair_status_,goods_json_)
         values (#{id,jdbcType=INTEGER}, #{transNo,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER},
         #{studentId,jdbcType=INTEGER}, #{studentName,jdbcType=VARCHAR}, #{studentSchool,jdbcType=VARCHAR},
         #{employeeId,jdbcType=INTEGER}, #{employeeName,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
@@ -56,11 +57,14 @@
         #{feeList,jdbcType=VARCHAR},#{description,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL},
         #{finishTime,jdbcType=TIMESTAMP},#{sendType,jdbcType=INTEGER}, #{contactName,jdbcType=VARCHAR},
         #{contactMobile,jdbcType=VARCHAR},#{address,jdbcType=VARCHAR}, #{payStatus,jdbcType=INTEGER},
-        #{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{repairStatus})
+        #{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{repairStatus},#{goodsJson})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
         UPDATE student_repair
         <set>
+            <if test="goodsJson != null">
+                goods_json_ = #{goodsJson},
+            </if>
             <if test="transNo != null">
                 trans_no_ = #{transNo},
             </if>

+ 0 - 3
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -165,9 +165,6 @@ public class RoomServiceImpl implements RoomService {
                 log.error("joinRoom IM error: roomId={}, {}", roomId, resultInfo.getErrorMessage());
                 throw new ApiException(ErrorEnum.ERR_CREATE_ROOM_ERROR, resultInfo.getErrorMessage());
             }
-//            else {
-//                scheduleManager.addExpiredTask(this, roomId);
-//            }
         } else {
             display = roomList.get(0).getDisplay();
         }

+ 6 - 2
mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java

@@ -6,7 +6,9 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentRepair;
+import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
+import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.StudentRepairService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -14,6 +16,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,6 +35,9 @@ public class RepairController extends BaseController {
     @Autowired
     private StudentRepairService studentRepairService;
 
+    @Autowired
+    private GoodsService goodsService;
+
     @ApiOperation("获取维修记录")
     @GetMapping(value = "/getStudentRepairList")
     public HttpResponseResult getStudentRepairList(RepairStudentQueryInfo queryInfo) {
@@ -80,6 +86,4 @@ public class RepairController extends BaseController {
         }
         return succeed(studentRepairService.getStudentRepairer(sysUser.getId(),sysUser.getOrganId()));
     }
-
-
 }

+ 1 - 17
mec-student/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java

@@ -33,8 +33,6 @@ public class SporadicChargeInfoController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private SysUserCashAccountDao sysUserCashAccountDao;
-    @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
     private MusicGroupService musicGroupService;
@@ -42,21 +40,7 @@ public class SporadicChargeInfoController extends BaseController {
     @ApiOperation(value = "单查询")
     @GetMapping("/get")
     public Object get(Integer id, Integer userId) {
-        if (userId == null) {
-            SysUser sysUser = sysUserFeignService.queryUserInfo();
-            if (sysUser == null || sysUser.getId() == null) {
-                return failed("用户不存在");
-            }
-            userId = sysUser.getId();
-        }
-        SporadicChargeInfo chargeInfo = sporadicChargeInfoService.get(id);
-        if (chargeInfo != null) {
-            SysUserCashAccount locked = sysUserCashAccountDao.getLocked(userId);
-            chargeInfo.setBalance(locked.getBalance());
-        } else {
-            throw new BizException("信息不存在");
-        }
-        return succeed(chargeInfo);
+        return succeed(sporadicChargeInfoService.findDetail(id,userId));
     }
 
 

+ 0 - 8
mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java

@@ -20,14 +20,6 @@ public class FinancialExpenditureController extends BaseController {
     @Autowired
     private FinancialExpenditureService financialExpenditureService;
 
-    @ApiOperation(value = "修改财务支出")
-    @PostMapping("/update")
-    @PreAuthorize("@pcs.hasPermissions('financialExpenditure/update')")
-    public Object upSet(@RequestBody FinancialExpenditure financialExpenditure) {
-        financialExpenditureService.update(financialExpenditure);
-        return succeed();
-    }
-
     @ApiOperation(value = "删除财务支出")
     @PostMapping("/batchDel")
     @PreAuthorize("@pcs.hasPermissions('financialExpenditure/batchDel')")

+ 20 - 5
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -7,7 +7,11 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentRepair;
+import com.ym.mec.biz.dal.page.GoodsCategoryQueryInfo;
+import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
+import com.ym.mec.biz.service.GoodsCategoryService;
+import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.StudentRepairService;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.common.controller.BaseController;
@@ -16,19 +20,14 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.snaker.engine.access.Page;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
 import java.util.Date;
-import java.util.List;
 import java.util.Objects;
 
 @RequestMapping("eduRepair")
@@ -45,6 +44,10 @@ public class EduRepairController extends BaseController {
     private StudentRepairService studentRepairService;
     @Autowired
     private SubjectService subjectService;
+    @Autowired
+    private GoodsService goodsService;
+    @Autowired
+    private GoodsCategoryService goodsCategoryService;
 
     @ApiOperation("获取学生列表")
     @GetMapping(value = "/getStudents")
@@ -142,4 +145,16 @@ public class EduRepairController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation(value = "分页查询商品(教材、辅件)列表")
+    @GetMapping("/queryGoodsPage")
+    public Object queryPage(GoodsQueryInfo queryInfo){
+        return succeed(goodsService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "分页查询商品分类列表")
+    @GetMapping("/queryGoodsCategoryPage")
+    public Object queryGoodsCategoryPage(GoodsCategoryQueryInfo queryInfo) {
+        return succeed(goodsCategoryService.queryPage(queryInfo));
+    }
+
 }

+ 6 - 6
mec-web/src/main/resources/columnMapper.ini

@@ -4,13 +4,13 @@
 商品名称 = name
 商品类型 = type
 商品分类 = goodsCategoryName
-商品型号 = specification
-商品价格 = marketPrice
-商品团购价 = groupPurchasePrice
-商品采购价 = discountPrice
+具体型号 = specification
+商品价格(元) = marketPrice
+商品团购价(元) = groupPurchasePrice
+商品采购价1(元) = discountPrice
 商品图片(插入一张图片) = image
-商品描述 = desc
-协议成本价 = agreeCostPrice
+商品明细 = desc
+商品采购价2(元) = agreeCostPrice
 
 [财务支出导入模板]
 批次号 = batchNo

BIN
mec-web/src/main/resources/excelTemplate/商品导入模板.xls