Commit 66c94980 by zhengxj

finish 技工月度对账单列表 on 20200109 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@25792 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 388e9bf1
...@@ -63,8 +63,8 @@ public class ReconciliationController { ...@@ -63,8 +63,8 @@ public class ReconciliationController {
} }
/** /**
* [服务商]确认对账单 * [服务商/技工]确认对账单
*/ */
@AuthCheck @AuthCheck
@PostMapping("/confirm") @PostMapping("/confirm")
public ResultObject confirm(@RequestBody @Validated ReconciliationOperation operation, HttpServletRequest request) { public ResultObject confirm(@RequestBody @Validated ReconciliationOperation operation, HttpServletRequest request) {
......
package com.glsx.ordercenter.controller; package com.glsx.ordercenter.controller;
import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.constants.ResultCodeEnum;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.Page;
import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.dto.OrderForReconciliationDto;
import com.glsx.ordercenter.pojo.SysReconciliationMonthly;
import com.glsx.ordercenter.service.ReconciliationMonthlyService; import com.glsx.ordercenter.service.ReconciliationMonthlyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/** /**
* 对账周期的控制器 * 对账周期的控制器
...@@ -12,10 +28,30 @@ import javax.annotation.Resource; ...@@ -12,10 +28,30 @@ import javax.annotation.Resource;
* @date 2020年1月4日11:48:27 * @date 2020年1月4日11:48:27
*/ */
@RestController @RestController
@RequestMapping("/reconciliationMonthly")
public class ReconciliationMonthlyController { public class ReconciliationMonthlyController {
@Resource @Resource
private ReconciliationMonthlyService reconciliationMonthlyService; private ReconciliationMonthlyService reconciliationMonthlyService;
/**
* 技工对账单
*/
@SuppressWarnings("resource")
@AuthCheck
@GetMapping("/list")
public ResultObject list(HttpServletRequest request, @RequestParam(defaultValue = "1") int pageIndex,
@RequestParam(defaultValue = "10") int pageSize) {
Map<String, Object> result = new HashMap<String, Object>();
int userId = UserUtils.getUserId(request);
List<SysReconciliationMonthly> list = reconciliationMonthlyService.queryList(userId, pageIndex, pageSize);
Page page = new Page(pageIndex, pageSize);
com.github.pagehelper.Page<SysReconciliationMonthly> pages = (com.github.pagehelper.Page<SysReconciliationMonthly>) list;
page.setTotalCount((int) pages.getTotal());
result.put("page", page);
result.put("items", list);
return ResultObject.of(ResultCodeEnum.SUCCESS, result);
}
} }
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List;
import com.glsx.ordercenter.pojo.SysReconciliationMonthly; import com.glsx.ordercenter.pojo.SysReconciliationMonthly;
public interface SysReconciliationMonthlyMapper { public interface SysReconciliationMonthlyMapper {
...@@ -14,4 +16,6 @@ public interface SysReconciliationMonthlyMapper { ...@@ -14,4 +16,6 @@ public interface SysReconciliationMonthlyMapper {
int updateByPrimaryKeySelective(SysReconciliationMonthly record); int updateByPrimaryKeySelective(SysReconciliationMonthly record);
int updateByPrimaryKey(SysReconciliationMonthly record); int updateByPrimaryKey(SysReconciliationMonthly record);
List<SysReconciliationMonthly> selectByUserId(Integer userId);
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.service; package com.glsx.ordercenter.service;
import java.util.List;
import com.glsx.ordercenter.pojo.SysReconciliationMonthly;
/** /**
* 对账周期服务类 * 对账周期服务类
* *
...@@ -7,4 +11,9 @@ package com.glsx.ordercenter.service; ...@@ -7,4 +11,9 @@ package com.glsx.ordercenter.service;
* @date 2020年1月4日13:52:48 * @date 2020年1月4日13:52:48
*/ */
public interface ReconciliationMonthlyService { public interface ReconciliationMonthlyService {
/**
* 技工/服务商--获取对账单列表
*/
List<SysReconciliationMonthly> queryList(Integer userId, int pageIndex, int pageSize);
} }
package com.glsx.ordercenter.service.impl; package com.glsx.ordercenter.service.impl;
import com.github.pagehelper.PageHelper;
import com.glsx.ordercenter.mapper.SysReconciliationMonthlyMapper;
import com.glsx.ordercenter.pojo.SysReconciliationMonthly;
import com.glsx.ordercenter.service.ReconciliationMonthlyService; import com.glsx.ordercenter.service.ReconciliationMonthlyService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -14,4 +22,16 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -14,4 +22,16 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional @Transactional
public class ReconciliationMonthlyServiceImpl implements ReconciliationMonthlyService { public class ReconciliationMonthlyServiceImpl implements ReconciliationMonthlyService {
@Resource
private SysReconciliationMonthlyMapper reconciliationMonthlyMapper;
/**
* 技工(服务商)月度账单
*/
@Override
public List<SysReconciliationMonthly> queryList(Integer userId, int pageIndex, int pageSize) {
PageHelper.startPage(pageIndex, pageSize, true);
List<SysReconciliationMonthly> list = reconciliationMonthlyMapper.selectByUserId(userId);
return list;
}
} }
...@@ -1497,6 +1497,9 @@ ...@@ -1497,6 +1497,9 @@
<if test="checkInAddress != null"> <if test="checkInAddress != null">
check_in_address = #{checkInAddress}, check_in_address = #{checkInAddress},
</if> </if>
<if test="merchantId != null">
merchant_id = #{merchantId},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -133,4 +133,12 @@ ...@@ -133,4 +133,12 @@
remark = #{remark,jdbcType=VARCHAR} remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="selectByUserId" parameterType="Integer" resultMap="BaseResultMap">
SELECT srm.id,concat(replace(srm.reconciliation_cycle,'-','年'),'月') as reconciliation_cycle, srm.settlement_amount,sr.statement_status
FROM sys_reconciliation_monthly srm
LEFT JOIN sys_reconciliation sr ON srm.id=sr.reconciliation_monthly_id
WHERE sr.user_id = #{userId,jdbcType=INTEGER}
and srm.reconciliation_status!=10
order by reconciliation_cycle desc
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!