Selaa lähdekoodia

财务管理导入

zouxuan 5 vuotta sitten
vanhempi
commit
f26f2e688a

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentRouteOrderDao.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
@@ -59,6 +60,10 @@ public interface StudentPaymentRouteOrderDao extends BaseDAO<Long, StudentPaymen
      * @return
      */
     int insertOrder(StudentPaymentOrder order);
+    
+    int queryAuditCount(Map<String, Object> params);
+    
+    List<StudentPaymentRouteOrder> queryAuditPage(Map<String, Object> params);
 
     /**
      * 是否有重复到订单号

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentPaymentRouteOrderQueryInfo.java

@@ -0,0 +1,47 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.common.page.QueryInfo;
+
+public class StudentPaymentRouteOrderQueryInfo extends QueryInfo {
+
+	private String transNo;
+	
+	private String organId;
+	
+	private AuditStatusEnum auditStatus;
+	
+	private String type;//SERVICE、SELL
+
+	public String getTransNo() {
+		return transNo;
+	}
+
+	public void setTransNo(String transNo) {
+		this.transNo = transNo;
+	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
+	public AuditStatusEnum getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(AuditStatusEnum auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentRouteOrderService.java

@@ -9,11 +9,20 @@ import com.ym.mec.biz.dal.dto.StudentPaymentRouteOrderDto;
 import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 import org.springframework.web.multipart.MultipartFile;
 
 
 public interface StudentPaymentRouteOrderService extends BaseService<Long, StudentPaymentRouteOrder> {
+	
+	/**
+	 * 查询审核列表
+	 * @param queryInfo
+	 * @return
+	 */
+	PageInfo<StudentPaymentRouteOrder> queryAuditList(QueryInfo queryInfo);
 
 	PageInfoOrder<StudentPaymentRouteOrderDto> OrderQueryPage(StudentPaymentOrderQueryInfo queryInfo);
 

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -35,6 +35,8 @@ import com.ym.mec.biz.service.SellOrderService;
 import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
@@ -66,6 +68,26 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
     }
 
     @Override
+	public PageInfo<StudentPaymentRouteOrder> queryAuditList(QueryInfo queryInfo) {
+    	PageInfo<StudentPaymentRouteOrder> pageInfo = new PageInfo<StudentPaymentRouteOrder>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		
+		List<StudentPaymentRouteOrder> dataList = null;
+		int count = studentPaymentRouteOrderDao.queryAuditCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentPaymentRouteOrderDao.queryAuditPage(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<StudentPaymentRouteOrder>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
     public PageInfoOrder<StudentPaymentRouteOrderDto> OrderQueryPage(StudentPaymentOrderQueryInfo queryInfo) {
         PageInfoOrder<StudentPaymentRouteOrderDto> pageInfo = new PageInfoOrder<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<String, Object>();

+ 53 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml

@@ -309,4 +309,57 @@
         #{classGroupId}, #{payTime})
     </insert>
 
+    <select id="queryAuditCount" parameterType="map" resultType="int">
+		SELECT count(spro.id_) FROM student_payment_route_order spro
+        left join sys_user u on spro.user_id_ = u.id_
+        <where>
+        	<if test="transNo != null and transNo != ''">
+        		and spro.trans_no_ = #{transNo}
+        	</if>
+        	<if test="organId != null and organId != ''">
+        		and spro.route_organ_id_ = #{organId}
+        	</if>
+        	<if test="auditStatus != null">
+        		and spro.audit_status_ = #{auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        	</if>
+        	<if test="type != null and type != ''">
+        		and
+        		<if test="type == 'SERVICE'">
+        			spro.service_amount_ is not null
+        		</if>
+        		<if test="type == 'SELL'">
+        			spro.sale_amount_ is not null
+        		</if>
+        	</if>
+        </where>
+		order by spro.id_ desc
+	</select>
+
+	<select id="queryAuditPage" parameterType="map" resultMap="StudentPaymentRouteOrderDto">
+		SELECT spro.*,u.username_,u.phone_ FROM student_payment_route_order spro
+        left join sys_user u on spro.user_id_ = u.id_
+        <where>
+        	<if test="transNo != null and transNo != ''">
+        		and spro.trans_no_ = #{transNo}
+        	</if>
+        	<if test="organId != null and organId != ''">
+        		and spro.route_organ_id_ = #{organId}
+        	</if>
+        	<if test="auditStatus != null">
+        		and spro.audit_status_ = #{auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        	</if>
+        	<if test="type != null and type != ''">
+        		and
+        		<if test="type == 'SERVICE'">
+        			spro.service_amount_ is not null
+        		</if>
+        		<if test="type == 'SELL'">
+        			spro.sale_amount_ is not null
+        		</if>
+        	</if>
+        </where>
+		order by spro.id_ desc
+		<include refid="global.limit" />
+	</select>
+
 </mapper>

+ 36 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java

@@ -30,6 +30,7 @@ import com.ym.mec.biz.dal.entity.SellOrder;
 import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.biz.dal.page.StudentPaymentRouteOrderQueryInfo;
 import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -86,6 +87,31 @@ public class StudentPaymentRouteOrderController extends BaseController {
     }
 
     @ApiOperation(value = "财务订单列表")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('routeOrder/queryPage')")
+    public HttpResponseResult<PageInfo<StudentPaymentRouteOrder>> queryPage(StudentPaymentRouteOrderQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+                return failed("用户所在分部异常");
+            } else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                    return failed("非法请求");
+                }
+            }
+        }
+
+        return succeed(studentPaymentRouteOrderService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "财务订单列表")
     @GetMapping("/query")
     @PreAuthorize("@pcs.hasPermissions('routeOrder/query')")
     public HttpResponseResult<StudentPaymentRouteOrder> query(Long id) {
@@ -115,6 +141,16 @@ public class StudentPaymentRouteOrderController extends BaseController {
     }
 
 
+	@ApiOperation(value = "订单审核")
+	@PostMapping("/auditOutOrder")
+	@PreAuthorize("@pcs.hasPermissions('routeOrder/auditOutOrder')")
+	public HttpResponseResult<String> auditOutOrder(Long studentPaymentRouteOrderId, AuditStatusEnum auditStatus, String memo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		studentPaymentRouteOrderService.auditOutOrder(studentPaymentRouteOrderId, auditStatus, memo, sysUser.getId());
+		return succeed();
+	}
+
+
     @ApiOperation(value = "修改订单")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('routeOrder/update')")