解决账户报表统计的bug
This commit is contained in:
@@ -196,6 +196,10 @@
|
||||
type: "get",
|
||||
url: "/account/getStatistics",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
name: name,
|
||||
serialNo: serialNo
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
|
||||
@@ -179,10 +179,12 @@ public class AccountController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getStatistics")
|
||||
public BaseResponseInfo getStatistics(HttpServletRequest request) throws Exception {
|
||||
public BaseResponseInfo getStatistics(@RequestParam("name") String name,
|
||||
@RequestParam("serialNo") String serialNo,
|
||||
HttpServletRequest request) throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
Map<String, Object> map = accountService.getStatistics();
|
||||
Map<String, Object> map = accountService.getStatistics(name, serialNo);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch(Exception e){
|
||||
|
||||
@@ -11,6 +11,10 @@ import java.util.List;
|
||||
|
||||
public interface AccountMapperEx {
|
||||
|
||||
List<Account> getAccountByParam(
|
||||
@Param("name") String name,
|
||||
@Param("serialNo") String serialNo);
|
||||
|
||||
List<AccountVo4List> selectByConditionAccount(
|
||||
@Param("name") String name,
|
||||
@Param("serialNo") String serialNo,
|
||||
@@ -32,4 +36,5 @@ public interface AccountMapperEx {
|
||||
@Param("accountId") Long accountId);
|
||||
|
||||
int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
|
||||
}
|
||||
@@ -84,7 +84,16 @@ public class AccountService {
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Account> getAccountByParam(String name, String serialNo) throws Exception{
|
||||
List<Account> list=null;
|
||||
try{
|
||||
list=accountMapperEx.getAccountByParam(name, serialNo);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<AccountVo4List> select(String name, String serialNo, String remark, int offset, int rows) throws Exception{
|
||||
@@ -547,10 +556,10 @@ public class AccountService {
|
||||
|
||||
}
|
||||
|
||||
public Map<String, Object> getStatistics() {
|
||||
public Map<String, Object> getStatistics(String name, String serialNo) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
try {
|
||||
List<Account> list = getAccount();
|
||||
List<Account> list = getAccountByParam(name, serialNo);
|
||||
String timeStr = Tools.getCurrentMonth();
|
||||
BigDecimal allMonthAmount = BigDecimal.ZERO;
|
||||
BigDecimal allCurrentAmount = BigDecimal.ZERO;
|
||||
|
||||
@@ -15,6 +15,20 @@
|
||||
<result column="AMList" jdbcType="VARCHAR" property="amList" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getAccountByParam" resultType="com.jsh.erp.datasource.entities.Account">
|
||||
select *
|
||||
FROM jsh_account
|
||||
where 1=1
|
||||
<if test="name != null and name !=''">
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="serialNo != null and serialNo !=''">
|
||||
<bind name="bindSerialNo" value="'%'+serialNo+'%'"/>
|
||||
and serial_no like #{bindSerialNo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByConditionAccount" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultListMap">
|
||||
select *
|
||||
FROM jsh_account
|
||||
@@ -173,6 +187,7 @@
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
) cc
|
||||
</select>
|
||||
|
||||
<update id="batchDeleteAccountByIds">
|
||||
update jsh_account
|
||||
set delete_flag='1'
|
||||
|
||||
Reference in New Issue
Block a user