wuxw
2022-07-19 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54
service-fee/src/main/java/com/java110/fee/bmo/feeCollectionOrder/impl/SaveFeeCollectionOrderBMOImpl.java
@@ -2,19 +2,29 @@
import com.java110.core.annotation.Java110Transactional;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.feeCollectionOrder.FeeCollectionOrderDto;
import com.java110.dto.user.UserDto;
import com.java110.fee.bmo.feeCollectionOrder.ISaveFeeCollectionOrderBMO;
import com.java110.intf.fee.IFeeCollectionOrderInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.po.feeCollectionOrder.FeeCollectionOrderPo;
import com.java110.utils.util.Assert;
import com.java110.utils.util.DateUtil;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("saveFeeCollectionOrderBMOImpl")
public class SaveFeeCollectionOrderBMOImpl implements ISaveFeeCollectionOrderBMO {
    @Autowired
    private IFeeCollectionOrderInnerServiceSMO feeCollectionOrderInnerServiceSMOImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    /**
     * 添加小区信息
@@ -25,7 +35,17 @@
    @Java110Transactional
    public ResponseEntity<String> save(FeeCollectionOrderPo feeCollectionOrderPo) {
        //查询用户ID
        UserDto userDto = new UserDto();
        userDto.setUserId(feeCollectionOrderPo.getStaffId());
        List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
        Assert.listOnlyOne(userDtos, "员工不存在");
        feeCollectionOrderPo.setOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        feeCollectionOrderPo.setCollectionName(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B) + "催缴单");
        feeCollectionOrderPo.setState(FeeCollectionOrderDto.STATE_WAIT);
        feeCollectionOrderPo.setStaffName(userDtos.get(0).getName());
        int flag = feeCollectionOrderInnerServiceSMOImpl.saveFeeCollectionOrder(feeCollectionOrderPo);
        if (flag > 0) {