1、解决组织递归bug,2、解决月份最后一天bug
This commit is contained in:
@@ -53,20 +53,23 @@ public interface DepotItemMapperEx {
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("sumType") String sumType);
|
||||
|
||||
BigDecimal buyOrSalePrice(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("sumType") String sumType);
|
||||
|
||||
BigDecimal inOrOutPrice(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
BigDecimal getStockCheckSum(
|
||||
@Param("depotId") Long depotId,
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.jsh.erp.service.systemConfig.SystemConfigService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import com.jsh.erp.utils.Tools;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -259,13 +260,15 @@ public class DepotItemService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public BigDecimal buyOrSale(String type, String subType, Long MId, String MonthTime, String sumType) throws Exception{
|
||||
public BigDecimal buyOrSale(String type, String subType, Long MId, String monthTime, String sumType) throws Exception{
|
||||
BigDecimal result= BigDecimal.ZERO;
|
||||
try{
|
||||
String beginTime = monthTime + "-01 00:00:00";
|
||||
String endTime = Tools.lastDayOfMonth(monthTime) +" 23:59:59";
|
||||
if (SUM_TYPE.equals(sumType)) {
|
||||
result= depotItemMapperEx.buyOrSaleNumber(type, subType, MId, MonthTime, sumType);
|
||||
result= depotItemMapperEx.buyOrSaleNumber(type, subType, MId, beginTime, endTime, sumType);
|
||||
} else {
|
||||
result= depotItemMapperEx.buyOrSalePrice(type, subType, MId, MonthTime, sumType);
|
||||
result= depotItemMapperEx.buyOrSalePrice(type, subType, MId, beginTime, endTime, sumType);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
@@ -278,14 +281,16 @@ public class DepotItemService {
|
||||
* 统计采购或销售的总金额
|
||||
* @param type
|
||||
* @param subType
|
||||
* @param MonthTime
|
||||
* @param month
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public BigDecimal inOrOutPrice(String type, String subType, String MonthTime) throws Exception{
|
||||
public BigDecimal inOrOutPrice(String type, String subType, String month) throws Exception{
|
||||
BigDecimal result= BigDecimal.ZERO;
|
||||
try{
|
||||
result = depotItemMapperEx.inOrOutPrice(type, subType, MonthTime);
|
||||
String beginTime = month + "-01 00:00:00";
|
||||
String endTime = Tools.lastDayOfMonth(month) +" 23:59:59";
|
||||
result = depotItemMapperEx.inOrOutPrice(type, subType, beginTime, endTime);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ public class OrganizationService {
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getOrgIdByParentId(Long orgId) {
|
||||
List<Long> idList = new ArrayList<Long>();
|
||||
List<Long> idList = new ArrayList<>();
|
||||
OrganizationExample example = new OrganizationExample();
|
||||
example.createCriteria().andIdEqualTo(orgId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Organization> orgList = organizationMapper.selectByExample(example);
|
||||
@@ -292,9 +292,8 @@ public class OrganizationService {
|
||||
* @return
|
||||
*/
|
||||
public void getOrgIdByParentNo(List<Long> idList,Long id) {
|
||||
List<Long> list = new ArrayList<Long>();
|
||||
OrganizationExample example = new OrganizationExample();
|
||||
example.createCriteria().andParentIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.createCriteria().andParentIdEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Organization> orgList = organizationMapper.selectByExample(example);
|
||||
if(orgList!=null && orgList.size()>0) {
|
||||
for(Organization o: orgList) {
|
||||
|
||||
Reference in New Issue
Block a user