去掉财务管理从后台获取最大id的逻辑
This commit is contained in:
@@ -5,6 +5,7 @@ import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.AccountHead;
|
||||
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
|
||||
import com.jsh.erp.exception.BusinessParamCheckingException;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.accountHead.AccountHeadService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
@@ -182,5 +183,38 @@ public class AccountHeadController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 新增财务信息和财务明细信息
|
||||
* create time: 2019/5/21 15:50
|
||||
* @Param: beanJson
|
||||
* @Param: inserted
|
||||
* @Param: deleted
|
||||
* @Param: updated
|
||||
* @Param: request
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/addAccountHeadAndDetail")
|
||||
public Object addAccountHeadAndDetail(@RequestParam("info") String beanJson,
|
||||
@RequestParam("inserted") String inserted,
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated,
|
||||
@RequestParam("listType") String listType,HttpServletRequest request) throws Exception{
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
accountHeadService.addAccountHeadAndDetail(beanJson,inserted,deleted,updated,listType);
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/updateAccountHeadAndDetail")
|
||||
public Object updateAccountHeadAndDetail(@RequestParam("id") Long id,@RequestParam("info") String beanJson,@RequestParam("inserted") String inserted,
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated,@RequestParam("listType") String listType) throws Exception{
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
accountHeadService.updateAccountHeadAndDetail(id,beanJson,inserted,deleted,updated,listType);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +43,7 @@ public interface AccountHeadMapperEx {
|
||||
List<AccountHead> getAccountHeadListByOrganIds(@Param("organIds") String[] organIds);
|
||||
|
||||
List<AccountHead> getAccountHeadListByHandsPersonIds(@Param("handsPersonIds") String[] handsPersonIds);
|
||||
|
||||
int addAccountHead(AccountHead accountHead);
|
||||
int updateAccountHead(AccountHead accountHead);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.mappers.AccountHeadMapper;
|
||||
import com.jsh.erp.datasource.mappers.AccountHeadMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.accountItem.AccountItemService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -22,6 +23,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -41,6 +43,8 @@ public class AccountHeadService {
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private AccountItemMapperEx accountItemMapperEx;
|
||||
@Resource
|
||||
private AccountItemService accountItemService;
|
||||
|
||||
public AccountHead getAccountHead(long id) throws Exception {
|
||||
AccountHead result=null;
|
||||
@@ -303,4 +307,49 @@ public class AccountHeadService {
|
||||
deleteTotal= batchDeleteAccountHeadByIds(ids);
|
||||
return deleteTotal;
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void addAccountHeadAndDetail(String beanJson, String inserted, String deleted, String updated, String listType) throws Exception {
|
||||
/**处理财务信息*/
|
||||
AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class);
|
||||
try{
|
||||
accountHeadMapperEx.addAccountHead(accountHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* create time: 2019/5/22 10:30
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 处理财务明细信息
|
||||
*
|
||||
*/
|
||||
accountItemService.saveDetials(inserted, deleted, updated, accountHead.getId(), listType);
|
||||
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void updateAccountHeadAndDetail(Long id, String beanJson, String inserted, String deleted, String updated, String listType)throws Exception {
|
||||
/**更新财务信息*/
|
||||
AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class);
|
||||
accountHead.setId(id);
|
||||
try{
|
||||
accountHeadMapperEx.updateAccountHead(accountHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* create time: 2019/5/22 10:30
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 更新财务明细信息
|
||||
*/
|
||||
accountItemService.saveDetials(inserted, deleted, updated, accountHead.getId(), listType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user